LF_MODSEC not blocking as expected
Posted: 09 Nov 2015, 00:15
I'm trying to get LF_MODSEC to block IPs that trigger mod_security rules, but so far it's not working as I expect. Here are my settings:
MODSEC_LOG = /var/log/httpd/error_log
All vhosts are set to put errors in this log
LF_TRIGGER = 0
LF_TRIGGER_PERM = 0
LF_MODSEC = 5
LF_MODSEC_PERM = 86400
Here are some example rule triggers from /var/log/httpd/error_log. Each of these examples is repeated more than 5 times in the logs.
[Sun Nov 08 07:15:34 2015] [error] [client 31.11.143.54] ModSecurity: [file "/etc/httpd/modsecurity.d/99_asl_zzzz_threat_intelligence.conf"] [line "70"] [id "355504"] [rev "1"] [msg "Atomicorp.com WAF Rules: Threat Intelligence Match for Known attacker Source on Atomicorp Threat Intelligence RBL (TI-4). See this URL for details http://www.atomicrbl.com/lookup"] [severity "ERROR"] Access denied with code 403 (phase 2). RBL lookup of 54.143.11.31.threat4.atomicrbl.com. succeeded at REMOTE_ADDR. [hostname "www.ourdomain.org"] [uri "/path/to/script.js"] [unique_id "Vj9K9qLy1rMAAEUlScIAAAAr"]
[Sun Nov 08 13:33:37 2015] [error] [client 150.162.127.14] ModSecurity: [file "/etc/httpd/modsecurity.d/99_asl_zzzz_threat_intelligence.conf"] [line "52"] [id "350054"] [rev "1"] [msg "Atomicorp.com WAF Rules: Threat Intelligence Match for known Attacker source on Atomicorp Threat Intelligence RBL. See this URL for details http://www.atomicrbl.com/lookup (Previous TI-4 Match)"] [severity "ERROR"] Access denied with code 403 (phase 2). Operator EQ matched 1 at IP:threat4. [hostname "www.ourdomain.org"] [uri "/index.php"] [unique_id "Vj@jkaLy1rMAAEk3gFAAAAAT"]
[Sun Nov 08 10:12:53 2015] [error] [client 46.118.155.216] ModSecurity: [file "/etc/httpd/modsecurity.d/99_asl_zzzz_threat_intelligence.conf"] [line "56"] [id "350055"] [rev "1"] [msg "Atomicorp.com WAF Rules: Threat Intelligence Match for known multi event Attacker source on Atomicorp Threat Intelligence RBL. See this URL for details http://www.atomicrbl.com/lookup (Previous TI-5 Match)"] [severity "ALERT"] Access denied with code 403 (phase 2). Operator EQ matched 1 at IP:threat5. [hostname "www.ourdomain.org"] [uri "/"] [unique_id "Vj90haLy1rMAAELheDoAAAAs"]
[Sun Nov 08 14:58:57 2015] [error] [client 52.23.156.32] ModSecurity: [file "/etc/httpd/modsecurity.d/99_asl_zzzz_threat_intelligence.conf"] [line "73"] [id "355506"] [rev "1"] [msg "Atomicorp.com WAF Rules: Threat Intelligence Match for Known multi event attacker Source on Atomicorp Threat Intelligence RBL. See this URL for details http://www.atomicrbl.com/lookup"] [severity "ALERT"] Access denied with code 403 (phase 2). RBL lookup of 32.156.23.52.threat5.atomicrbl.com. succeeded at REMOTE_ADDR. [hostname "www.ourdomain.org"] [uri "/robots.txt"] [unique_id "Vj@3kaLy1rMAAAnKrs8AAAAY"]
Should the '#mod_security v2 (apache)' entry in regex.pm not match these log entries?
Any help getting this working would be appreciated.
Thanks,
Kirk
MODSEC_LOG = /var/log/httpd/error_log
All vhosts are set to put errors in this log
LF_TRIGGER = 0
LF_TRIGGER_PERM = 0
LF_MODSEC = 5
LF_MODSEC_PERM = 86400
Here are some example rule triggers from /var/log/httpd/error_log. Each of these examples is repeated more than 5 times in the logs.
[Sun Nov 08 07:15:34 2015] [error] [client 31.11.143.54] ModSecurity: [file "/etc/httpd/modsecurity.d/99_asl_zzzz_threat_intelligence.conf"] [line "70"] [id "355504"] [rev "1"] [msg "Atomicorp.com WAF Rules: Threat Intelligence Match for Known attacker Source on Atomicorp Threat Intelligence RBL (TI-4). See this URL for details http://www.atomicrbl.com/lookup"] [severity "ERROR"] Access denied with code 403 (phase 2). RBL lookup of 54.143.11.31.threat4.atomicrbl.com. succeeded at REMOTE_ADDR. [hostname "www.ourdomain.org"] [uri "/path/to/script.js"] [unique_id "Vj9K9qLy1rMAAEUlScIAAAAr"]
[Sun Nov 08 13:33:37 2015] [error] [client 150.162.127.14] ModSecurity: [file "/etc/httpd/modsecurity.d/99_asl_zzzz_threat_intelligence.conf"] [line "52"] [id "350054"] [rev "1"] [msg "Atomicorp.com WAF Rules: Threat Intelligence Match for known Attacker source on Atomicorp Threat Intelligence RBL. See this URL for details http://www.atomicrbl.com/lookup (Previous TI-4 Match)"] [severity "ERROR"] Access denied with code 403 (phase 2). Operator EQ matched 1 at IP:threat4. [hostname "www.ourdomain.org"] [uri "/index.php"] [unique_id "Vj@jkaLy1rMAAEk3gFAAAAAT"]
[Sun Nov 08 10:12:53 2015] [error] [client 46.118.155.216] ModSecurity: [file "/etc/httpd/modsecurity.d/99_asl_zzzz_threat_intelligence.conf"] [line "56"] [id "350055"] [rev "1"] [msg "Atomicorp.com WAF Rules: Threat Intelligence Match for known multi event Attacker source on Atomicorp Threat Intelligence RBL. See this URL for details http://www.atomicrbl.com/lookup (Previous TI-5 Match)"] [severity "ALERT"] Access denied with code 403 (phase 2). Operator EQ matched 1 at IP:threat5. [hostname "www.ourdomain.org"] [uri "/"] [unique_id "Vj90haLy1rMAAELheDoAAAAs"]
[Sun Nov 08 14:58:57 2015] [error] [client 52.23.156.32] ModSecurity: [file "/etc/httpd/modsecurity.d/99_asl_zzzz_threat_intelligence.conf"] [line "73"] [id "355506"] [rev "1"] [msg "Atomicorp.com WAF Rules: Threat Intelligence Match for Known multi event attacker Source on Atomicorp Threat Intelligence RBL. See this URL for details http://www.atomicrbl.com/lookup"] [severity "ALERT"] Access denied with code 403 (phase 2). RBL lookup of 32.156.23.52.threat5.atomicrbl.com. succeeded at REMOTE_ADDR. [hostname "www.ourdomain.org"] [uri "/robots.txt"] [unique_id "Vj@3kaLy1rMAAAnKrs8AAAAY"]
Should the '#mod_security v2 (apache)' entry in regex.pm not match these log entries?
Any help getting this working would be appreciated.
Thanks,
Kirk