问题描述:用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 内容,请继续关注编程基础学习网。
沃梦达教程
本文标题为:AppScan检测“X-XSS-Protection”头缺失或不安全等问题解决方案
猜你喜欢
- ajax同步验证单号是否存在的方法 2023-01-21
- 编写轻量ajax组件02--浅析AjaxPro 2022-10-17
- JS中获取 DOM 元素的绝对位置实例详解 2024-02-25
- Vue3 使用 element-plus 不生效的原因之一 2023-10-08
- 块级元素的三种垂直水平居中的方法 2024-01-05
- ajax提交数据到后台php接收(实现方法) 2023-02-14
- 史上最强vue总结来了,这原因我服了 2023-10-08
- networkInformation.downlink测用户网速方法详解 2023-12-24
- 兼容Firefox和IE的onpropertychange事件oninput 2023-12-23
- CSS教程:vlink,alink,link和a:link 2024-02-06