漏洞掃描,解決缺少“X-XSS-Protection”,“X-Content-Type-Options”, “Content-Security-Policy”頭問題

缺少“X-XSS-Protection”,“X-Content-Type-Options”, “Content-Security-Policy”頭
解決方法
用AppScan掃描網站,高危問題:缺少“X-XSS-Protection”,“X-Content-Type-Options”, “Content-Security-Policy”頭解決方式


解決方法
將下面內容添加到nginx.conf 文件http 結構下

# security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy "default-src 'self' http: https://* data: blob: 'unsafe-eval' 'unsafe-inline';child-src 'none' " always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
# . files
location ~ /\.(?!well-known) {
        deny all;
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章