跳到主要內容

安全性修正 - Apache: Disable the HTTP TRACE Method



Apache: Disable the HTTP TRACE Method

編輯 apache 的系統檔(Apache 1.3.34、2.0.55 以後版本)
$ vi /etc/httpd/conf/httpd.conf
最下方找空白的地方加入 
TraceEnable off
重啟 apache 服務 
$ service httpd restart
測試是否正常關閉
$ curl -i -X TRACE http://www._website_.com/
HTTP/1.1 405 Method Not Allowed
Date: Wed, 13 Feb 2013 14:30:32 GMT
Server: Apache/2.2.15 (CentOS)
Allow: 
Content-Length: 223
Content-Type: text/html; charset=iso-8859-1
 
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>405 Method Not Allowed</title>
</head><body>
<h1>Method Not Allowed</h1>
<p>The requested method TRACE is not allowed for the URL /.</p>
</body></html>

留言

這個網誌中的熱門文章

SSL Labs A+ 2021

可以先參考這篇進行修正,把內容放入 ssl.conf 裡基本上就有 A+  https://blog.camilord.com/2021/02/23/ssllabs-com-how-to-get-a-on-ssl-server-test-as-of-feb-2021/ 再搭配這篇調整 https://zurgl.com/how-to-get-a-100-score-on-ssl-labs-red-hat-centos-7-x-apache-lets-encrypt/

安全性修正 - 調整 SSL 安全性設定含檢測 Rank A+

SSL 相關安全測試含修正 SSL 申請可以透過 SSL For Free 進行申請免費 SSL https://www.sslforfree.com/ 檢測 SSL 憑證安全的十種工具 https://geekflare.com/ssl-test-certificate/#SSL-Labs 如果有使用 VirtualHost 記得加在設定裡就可以 $ vim /etc/httpd/conf/http.conf   <VirtualHost *:80> RewriteEngine on RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] Alias /cp /var/www/cp/public <Directory /var/www/cp> AllowOverride All </Directory> <Directory /var/www/html> AllowOverride All </Directory> DocumentRoot /var/www/html ServerName www.sakura-home.com.tw </VirtualHost> <VirtualHost *:443> Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;" RewriteEngine on RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] SSLEngine on SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 ...