LoginSignup
19
21

More than 5 years have passed since last update.

apacheで攻撃者に有用な情報を与えない対策

Last updated at Posted at 2014-12-11

nginxの場合は Nginx導入時、サクッと対応しておくと良いかもしれない - Qiita

確認
curl -I http://url〜

Apacheのバージョンを出力させない

httpd.conf
- ServerTokens Full
+ ServerTokens Prod
  • ServerSignature OffはProdの場合不要。
curl localhost/aaa
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <html><head>
 <title>404 Not Found</title>
 </head><body>
 <h1>Not Found</h1>
 <p>The requested URL /aaa was not found on this server.</p>
 <hr>
+<address>Apache/2.4.7 (Ubuntu) Server at localhost Port 80</address>
 </body></html>

PHPのバージョンを出力させない

php.ini
- expose_php = On
+ expose_php = Off

Apacheのwelcomeページを表示させない

cd /etc/httpd/conf.d/
mv welcome.conf welcome.conf.org

以下は今はしなくても良さそう。

IE6初期以前のBasic認証セキュリティ向上

telnet dummy.hoge.jp 80
  • OPTIONS / HTTP/1.0を入力しEnter2回。

Allow: GET,HEAD,POST,OPTIONS,TRACE

TRACEを無効にするには以下

httpd.conf
+ TraceEnable Off
19
21
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
21