WAF - mod security(Reverse Proxy)

  • You do not have permissions to view this page - please try logging in.

簡介

WAF (Web Application Firewall) - 網站應用系統防火牆

  • 此方案不適用 Mindtouch,因為 Mindtouch 本機的 Apache 也會做一次 Reverse Proxy,這導致網站內的所有連結都不正確。
  • 適用系統:Ubuntu 12.04

安裝

> apt-get install apache2 libapache2-modsecurity libapache2-mod-proxy-html

> a2enmod proxy proxy_http
> service apache2 restart

> apachectl -M

security2_module (shared)  <<<
proxy_module (shared) <<<

設定 mod_proxy

> vi /etc/apache2/mods-enabled/proxy.conf

<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
        AddDefaultCharset off
        Order deny,allow
        Deny from all
        #Allow from .example.com
        Allow from all
</Proxy>
ProxyVia Block

ProxyPass / http://192.168.7.62/
ProxyPassReverse / http://192.168.7.62/
</IfModule>

192.168.7.62 是實際 Web Server 的內部 IP。

>service apache2 restart

設定 mod_security

> mv /etc/modsecurity/modsecurity.conf-recommend /etc/modsecurity/modsecurity.conf

編輯 /etc/apache2/mods-enabled/mod-security.conf

<IfModule security2_module>
        Include "/etc/modsecurity/*.conf"
</IfModule> 

編輯 /etc/modsecurity/modsecurity.conf,加上這一行

# -- Hiding the Apache engine
SecServerSignature "Microsoft-IIS/5.0"

> service apache restart

建議:mod_security 要增強安全性設定,必須參考其他網站的範例,並且對於常見的攻擊手法要實際先驗證過。

標籤 (Edit tags)
  • No tags
您必須 登入 才能發佈評論。
Powered by MindTouch Core