部分绿盟低风险错误解决办法:
https://blog.csdn.net/yjfkeifk/article/details/117813169
使用绿盟进行安全检测,经常会出现:
检测到目标X-Content-Type-Options响应头缺失
检测到目标X-XSS-Protection响应头缺失
检测到目标Content-Security-Policy响应头缺失
检测到目标Strict-Transport-Security响应头缺失
检测到目标Referrer-Policy响应头缺失
检测到目标X-Permitted-Cross-Domain-Policies响应头缺失
检测到目标X-Download-Options响应头缺失
点击劫持:X-Frame-Options未配置
这类型低危风险,处理方法相当简单,在web.config中配制:
<customHeaders>
<!--检测到目标X-Content-Type-Options响应头缺失-->
<add name="X-Content-Type-Options" value="nosniff" />
<!--检测到目标X-XSS-Protection响应头缺失-->
<add name="X-XSS-Protection" value="1;mode=block" />
<!--检测到目标Content-Security-Policy响应头缺失-->
<add name="Content-Security-Policy" value="default-src 'self'" />
<!--检测到目标Strict-Transport-Security响应头缺失-->
<add name="Strict-Transport-Security" value="max-age=31536000" />
<!--检测到目标Referrer-Policy响应头缺失-->
<add name="Referrer-Policy" value="origin-when-cross-origin" />
<!--检测到目标X-Permitted-Cross-Domain-Policies响应头缺失-->
<add name="X-Permitted-Cross-Domain-Policies" value="master-only" />
<!--检测到目标X-Download-Options响应头缺失-->
<add name="X-Download-Options" value="noopen" />
<!--点击劫持:X-Frame-Options未配置-->
<add name="X-Frame-Options" value="SAMEORIGIN" />
</customHeaders>