Skip to content

Commit 3601886

Browse files
committed
bugfix: fix the vhost security configuration
The modified variable was never passed to the template, resulting in a bad configuration of the vhost security if secrule were removed. Signed-off-by: Julien Godin <[email protected]>
1 parent bde17ea commit 3601886

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

manifests/vhost.pp

+4-4
Original file line numberDiff line numberDiff line change
@@ -2828,14 +2828,14 @@
28282828
}
28292829
}
28302830

2831-
if $modsec_disable_vhost or $modsec_disable_ids or !empty($modsec_disable_ips) or $modsec_disable_msgs or $modsec_disable_tags or $modsec_audit_log_destination or ($modsec_inbound_anomaly_threshold and $modsec_outbound_anomaly_threshold) or $modsec_allowed_methods {
2831+
if $modsec_disable_vhost or $_modsec_disable_ids or !empty($_modsec_disable_ips) or $_modsec_disable_msgs or $_modsec_disable_tags or $modsec_audit_log_destination or ($modsec_inbound_anomaly_threshold and $modsec_outbound_anomaly_threshold) or $modsec_allowed_methods {
28322832
$security_params = {
28332833
'modsec_disable_vhost' => $modsec_disable_vhost,
28342834
'modsec_audit_log_destination' => $modsec_audit_log_destination,
2835-
'_modsec_disable_ids' => $modsec_disable_ids,
2835+
'_modsec_disable_ids' => $_modsec_disable_ids,
28362836
'modsec_disable_ips' => $modsec_disable_ips,
2837-
'_modsec_disable_msgs' => $modsec_disable_msgs,
2838-
'_modsec_disable_tags' => $modsec_disable_tags,
2837+
'_modsec_disable_msgs' => $_modsec_disable_msgs,
2838+
'_modsec_disable_tags' => $_modsec_disable_tags,
28392839
'modsec_body_limit' => $modsec_body_limit,
28402840
'modsec_inbound_anomaly_threshold' => $modsec_inbound_anomaly_threshold,
28412841
'modsec_outbound_anomaly_threshold' => $modsec_outbound_anomaly_threshold,

templates/vhost/_security.epp

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<IfModule mod_security2.c>
22
<% if $modsec_disable_vhost {-%>
33
SecRuleEngine Off
4+
<% } else { -%>
5+
SecRuleEngine On
46
<% } -%>
57
<% if $modsec_audit_log_destination {-%>
68
SecAuditLog "<%= $modsec_audit_log_destination %>"

0 commit comments

Comments
 (0)