AppScan检测“X-XSS-Protection”头缺失或不安全等问题解决方案
问题描述:用AppScan检测检查网页安全性能,出现以下问题:
1、检测到隐藏目录
2、缺少“Content-Security-Policy”头
3、缺少“X-Content-Type-Options”头
4、缺少“X-XSS-Protection”头
编程教程网小编用的是IIS服务器,在项目文件夹下面新建一个web.config文件,写入以下代码:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Content-Security-Policy" value="default-src *;style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval';img-src * data:;worker-src * blob:;font-src 'self' data:;" />
<add name="X-Content-Type-Options" value="nosniff" />
<add name="X-XSS-Protection" value="1" />
</customHeaders>
</httpProtocol>
<httpErrors>
<remove statusCode="403" subStatusCode="-1" />
<error statusCode="403" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="404.htm" responseMode="File" />
</httpErrors>
</system.webServer>
</configuration>
以上是编程学习网小编为您介绍的“AppScan检测“X-XSS-Protection”头缺失或不安全等问题解决方案”的全面内容,想了解更多关于 vuejs 内容,请继续关注编程基础学习网。