WAF (Web Application Firewall) - 網站應用系統防火牆
> 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) <<<
> 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
> 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 要增強安全性設定,必須參考其他網站的範例,並且對於常見的攻擊手法要實際先驗證過。
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |