开启所有服务器防火墙,设置服务器间访问的ip白名单(点对点的白名单)
开放对应端口
firewall-cmd --zone=public --add-port=9000/tcp --permanent #允许ip192.168.0.1访问9001端口 firewall-cmd --permanent --add-rich-rule="rule family="ipv4"
source address="192.168.0.1" port protocol="tcp" port="9001" accept"
swagger-ui 生产环境关闭,页面也不许访问
1.在程序拦截器层面直接全部拦截,而不只是将swagger的enable置为false
2.nginx层面拦截,
#禁止swagger-ui页面访问
location ~^.+swagger-ui.html$ {
deny all;
}
密码规则复杂,验证码,前后端加密传输(动态秘钥,Session获取),验证码登录无论成功失败,Session中的都需要刷新(只前端刷新不行)
密码需同时存在大小写+符号+数字
Nginx层面限制,redis、ftp等各种中间件要设置密码
add_header X-Frame-Options SAMEORIGIN; add_header X-Xss-Protection 1; #add_header X-Content-Type-Options nosniff; #不显示版本号 server_tokens off; 数据库,中间件等严禁使用弱口