问题描述:用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”头缺失或不安全等问题解决方案
基础教程推荐
猜你喜欢
- 浅谈css元素居中 2024-03-10
- css实现鼠标悬停时滑出层提示的方法 2023-12-21
- web标准常见问题集合3 2022-11-06
- 移动端开发1px线的理解与解决办法 2024-01-17
- 使用postcss-plugin-px2rem和postcss-pxtorem(postcss-px2rem)-px自动转换rem的配置方法-vue-cli3.0 2023-10-08
- javascript原型链图解的总结和实践 2023-08-12
- 拖拽插件SortableJS的简单使用(带缓存) 2022-07-24
- CSS Gird布局教程指南 2023-12-09
- BOM系列第三篇之定时器应用(时钟、倒计时、秒表和闹钟) 2023-12-01
- 基于Node的React图片上传组件实现实例代码 2024-03-08
