Skip to content

Commit 20c8551

Browse files
committed
Configurability of Collaborative Detection Severity Levels for OWASP Core Rule Set
1 parent 9e57528 commit 20c8551

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1738,6 +1738,10 @@ ${modsec\_dir}/activated\_rules.
17381738
- `anomaly_score_blocking`: De-/Activates the Collaborative Detection Blocking of the OWASP ModSecurity Core Rule Set. Default: off.
17391739
- `inbound_anomaly_threshold`: Sets the scoring threshold level of the inbound blocking rules for the Collaborative Detection Mode in the OWASP ModSecurity Core Rule Set. Default: '5'.
17401740
- `outbound_anomaly_threshold`: Sets the scoring threshold level of the outbound blocking rules for the Collaborative Detection Mode in the OWASP ModSecurity Core Rule Set. Default: '4'.
1741+
- `critical_anomaly_score`: Sets the scoring points of the critical severity level for the Collaborative Detection Mode in the OWASP ModSecurity Core Rule Set. Default: '5'.
1742+
- `error_anomaly_score`: Sets the scoring points of the error severity level for the Collaborative Detection Mode in the OWASP ModSecurity Core Rule Set. Default: '4'.
1743+
- `warning_anomaly_score`: Sets the scoring points of the warning severity level for the Collaborative Detection Mode in the OWASP ModSecurity Core Rule Set. Default: '3'.
1744+
- `notice_anomaly_score`: Sets the scoring points of the notice severity level for the Collaborative Detection Mode in the OWASP ModSecurity Core Rule Set. Default: '2'.
17411745

17421746
##### Class: `apache::mod::wsgi`
17431747

manifests/mod/security.pp

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
class apache::mod::security (
2-
$crs_package = $::apache::params::modsec_crs_package,
3-
$activated_rules = $::apache::params::modsec_default_rules,
4-
$modsec_dir = $::apache::params::modsec_dir,
5-
$modsec_secruleengine = $::apache::params::modsec_secruleengine,
6-
$audit_log_parts = $::apache::params::modsec_audit_log_parts,
7-
$secpcrematchlimit = $::apache::params::secpcrematchlimit,
2+
$crs_package = $::apache::params::modsec_crs_package,
3+
$activated_rules = $::apache::params::modsec_default_rules,
4+
$modsec_dir = $::apache::params::modsec_dir,
5+
$modsec_secruleengine = $::apache::params::modsec_secruleengine,
6+
$audit_log_parts = $::apache::params::modsec_audit_log_parts,
7+
$secpcrematchlimit = $::apache::params::secpcrematchlimit,
88
$secpcrematchlimitrecursion = $::apache::params::secpcrematchlimitrecursion,
9-
$allowed_methods = 'GET HEAD POST OPTIONS',
10-
$content_types = 'application/x-www-form-urlencoded|multipart/form-data|text/xml|application/xml|application/x-amf',
11-
$restricted_extensions = '.asa/ .asax/ .ascx/ .axd/ .backup/ .bak/ .bat/ .cdx/ .cer/ .cfg/ .cmd/ .com/ .config/ .conf/ .cs/ .csproj/ .csr/ .dat/ .db/ .dbf/ .dll/ .dos/ .htr/ .htw/ .ida/ .idc/ .idq/ .inc/ .ini/ .key/ .licx/ .lnk/ .log/ .mdb/ .old/ .pass/ .pdb/ .pol/ .printer/ .pwd/ .resources/ .resx/ .sql/ .sys/ .vb/ .vbs/ .vbproj/ .vsdisco/ .webinfo/ .xsd/ .xsx/',
12-
$restricted_headers = '/Proxy-Connection/ /Lock-Token/ /Content-Range/ /Translate/ /via/ /if/',
9+
$allowed_methods = 'GET HEAD POST OPTIONS',
10+
$content_types = 'application/x-www-form-urlencoded|multipart/form-data|text/xml|application/xml|application/x-amf',
11+
$restricted_extensions = '.asa/ .asax/ .ascx/ .axd/ .backup/ .bak/ .bat/ .cdx/ .cer/ .cfg/ .cmd/ .com/ .config/ .conf/ .cs/ .csproj/ .csr/ .dat/ .db/ .dbf/ .dll/ .dos/ .htr/ .htw/ .ida/ .idc/ .idq/ .inc/ .ini/ .key/ .licx/ .lnk/ .log/ .mdb/ .old/ .pass/ .pdb/ .pol/ .printer/ .pwd/ .resources/ .resx/ .sql/ .sys/ .vb/ .vbs/ .vbproj/ .vsdisco/ .webinfo/ .xsd/ .xsx/',
12+
$restricted_headers = '/Proxy-Connection/ /Lock-Token/ /Content-Range/ /Translate/ /via/ /if/',
1313
$secdefaultaction = 'deny',
1414
$anomaly_score_blocking = 'off',
1515
$inbound_anomaly_threshold = '5',
1616
$outbound_anomaly_threshold = '4',
17+
$critical_anomaly_score = '5',
18+
$error_anomaly_score = '4',
19+
$warning_anomaly_score = '3',
20+
$notice_anomaly_score = '2',
1721
) inherits ::apache::params {
1822
include ::apache
1923

templates/mod/security_crs.conf.erb

+4-4
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ SecAction \
8989
"id:'900001', \
9090
phase:1, \
9191
t:none, \
92-
setvar:tx.critical_anomaly_score=5, \
93-
setvar:tx.error_anomaly_score=4, \
94-
setvar:tx.warning_anomaly_score=3, \
95-
setvar:tx.notice_anomaly_score=2, \
92+
setvar:tx.critical_anomaly_score=<%= @critical_anomaly_score -%>, \
93+
setvar:tx.error_anomaly_score=<%= @error_anomaly_score -%>, \
94+
setvar:tx.warning_anomaly_score=<%= @warning_anomaly_score -%>, \
95+
setvar:tx.notice_anomaly_score=<%= @notice_anomaly_score -%>, \
9696
nolog, \
9797
pass"
9898

0 commit comments

Comments
 (0)