1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Apache + mod_security + mod_security_crs

Last updated at Posted at 2015-07-09

#フリーのWAF(Webアプリケーションファイアウォール)を導入してみた。
<検証環境>
 ・CentOS 6.4
 ・Apache 2.2.15

対象モジュールをインストール
[root]# yum --enablerepo=epel install mod_security mod_security_crs
この辺の設定は、こんな感じで
[root]# vi /etc/httpd/conf.d/mod_security.conf
----------------------------------------------------------------
<IfModule mod_security2.c>
    # ModSecurity Core Rules Set configuration
        Include modsecurity.d/*.conf
        Include modsecurity.d/activated_rules/*.conf

    # Default recommended configuration
    SecRuleEngine On
#    SecRuleEngine DetectionOnly
    SecRequestBodyAccess On
----------------------------------------------------------------
動作確認。
自分のサイトURLの後ろに『?union+select』を付与してアクセスしてみると。。。
http://xxxxxx.com/index.php?union+select

#こうなる。
※背景は、ログ(/var/log/httpd/modsec_audit.log)をtailしている。
Wiresharkでパケットキャプチャして確認した。
ちゃんと動作してみるみたい。
mod_security_unionselect.png


1
1
1

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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?