AppScan 扫描出漏洞 'Content-Security-Policy' 头中缺少 'Script-Src' 或 'Default-src' 策略或相应策略不安全,服务器的域名为 https://172.16.15.87:8444,并且允许 https://172.16.15.87:8090 访问,如何通过 Nginx 处理内容:可以通过在 Nginx 的配置文件中添加以下内容来解决该漏洞:

add_header Content-Security-Policy 'default-src https: 'unsafe-inline' 'unsafe-eval'; script-src https://172.16.15.87:8090 https://172.16.15.87:8444 'unsafe-inline' 'unsafe-eval';';

这将在响应头中添加 Content-Security-Policy 头,并设置默认策略为 https 和允许从 https://172.16.15.87:8090 和 https://172.16.15.87:8444 访问脚本。同时,还允许使用 '不安全的内联' 和 '不安全的评估'。这将解决 'Content-Security-Policy' 头中缺少 'Script-Src' 或 'Default-src' 策略或相应策略不安全的问题。

Nginx 配置 Content-Security-Policy 解决 AppScan 漏洞

原文地址: https://www.cveoy.top/t/topic/oBiA 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录