亚洲色图欧美日韩在线播放-户外操美女逼逼中国-免费久久99国产精品自在现-欧美激情五月综合啪啪-九九日本黄色精品视频-亚洲成年网址青青草原-欧美性爱精品在线免费观看-国产精品一区二区美女-日电影一区二区三区

網站低危漏洞通過偽靜態(tài)功能處理方法

很多網站通過第三方平臺掃描會出現很多低危漏洞,特別是使用綠盟進行安全檢測經常會出現。Linux和虛擬主機都會有這個情況,可以通過偽靜態(tài)的方式進行設置。

 

Windows主機

Windows主機需要在wwwroot目錄下的web.config里面添加以下規(guī)則:

 

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <system.webServer>

     <httpProtocol>

    <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' 'unsafe-inline' ; img-src 'self' data:" />

<!--檢測到目標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>

</httpProtocol>

    </system.webServer>

</configuration>

 

請注意規(guī)則必須要添加節(jié)點,如果添加錯誤會導致網站無法打開。

 

Linux主機

wwwroot目錄下的.htaccess中添加以下規(guī)則:

 

#檢測到目標X-Content-Type-Options響應頭缺失

Header set X-Content-Type-Options "nosniff"

#檢測到目標X-XSS-Protection響應頭缺失

Header set X-XSS-Protection "1; mode=block"

#檢測到目標Strict-Transport-Security響應頭缺失

Header set Strict-Transport-Security: "max-age=31536000 ; includeSubDomains ;"

#檢測到目標Referrer-Policy響應頭缺失

Header set Referrer-Policy: strict-origin-when-cross-origin

#檢測到目標X-Permitted-Cross-Domain-Policies響應頭缺失

Header set X-Permitted-Cross-Domain-Policies "master-only"

#檢測到目標X-Download-Options響應頭缺失

Header set X-Download-Options "noopen"

#點擊劫持:X-Frame-Options未配置

Header set X-Frame-Options "SAMEORIGIN"

 

注意:無論windows還是Linux主機,添加規(guī)則即可生效不需要做其他設置。



編輯:三五互聯
日期:2023-07-11

收藏 】 【 打印 】   
您可對文檔進行評分喲~

勾選遇到的問題提交給我們,收到反饋后保證及時修正更新!

提交反饋需要先登陸會員帳號

上一篇:已經沒有了。
下一篇:已經沒有了。
若文檔內容對您沒有幫助,不能解決問題? 您還可以 咨詢在線客服提交工單搜索常見問題 ,我們將竭誠為您服務。
  >> 相關文章
 
分享至: