Imported Upstream version 2.5.11
[libapache-mod-security.git] / rules / base_rules / modsecurity_crs_49_enforcement.conf
1 # ---------------------------------------------------------------
2 # Core ModSecurity Rule Set ver.2.0.3
3 # Copyright (C) 2006-2009 Breach Security Inc. All rights reserved.
4 #
5 # The ModSecuirty Core Rule Set is distributed under GPL version 2
6 # Please see the enclosed LICENCE file for full details.
7 # ---------------------------------------------------------------
8
9
10
11 # Uncomment the anomaly sections you wish to use.
12 # You should set the score to the proper threshold you would prefer. If kept at "@gt 0"
13 # it will work similarly to previous Mod CRS rules and will create an event in the error_log
14 # file if there are any rules that match.  If you would like to lessen the number of events
15 # generated in the error_log file, you should increase the anomaly score threshold to
16 # something like "@gt 20".  This would only generate an event in the error_log file if
17 # there are multiple lower severity rule matches or if any 1 higher severity item matches.
18 #
19 # You should also set the desired disruptive action (deny, redirect, etc...).
20 #
21
22 # Alert and Deny on High Anomaly Scores
23 #
24 SecRule TX:ANOMALY_SCORE "@ge 20" \
25     "phase:2,t:none,nolog,auditlog,deny,msg:'Anomaly Score Exceeded (score %{TX.ANOMALY_SCORE}): %{tx.msg}',setvar:tx.inbound_tx_msg=%{tx.msg}"
26
27 # Alert on any anomalies
28 #
29 #SecRule TX:ANOMALY_SCORE "@ge 0" \
30 #    "phase:2,t:none,nolog,auditlog,pass,msg:'Anomaly Score Exceeded (score %{TX.ANOMALY_SCORE}): %{tx.msg}',setvar:tx.inbound_tx_msg=%{tx.msg}"
31
32 # Alert on SQL Injection anomalies
33 #
34 #SecRule TX:SQLI_SCORE "@gt 0" \
35 #    "phase:2,t:none,log,deny,msg:'SQL Injection Detected (score %{TX.SQLI_SCORE}): %{tx.msg}'"
36
37 # Alert on XSS anomalies
38 #
39 #SecRule TX:XSS_SCORE "!@eq 0" \
40 #    "phase:2,t:none,log,deny,msg:'XSS Detected (score %{TX.XSS_SCORE}): %{tx.msg}'"
41
42 # Alert on Protocol Policy anomalies
43 #
44 #SecRule TX:PROTOCOL_VIOLATION_SCORE "!@eq 0" \
45 #    "phase:2,t:none,log,deny,msg:'Protocol Violations Detected (score %{TX.PROTOCOL_VIOLATION_SCORE}): %{tx.msg}'"