Skip to content

Commit e273907

Browse files
authored
Merge pull request #2523 from JGodin-C2C/main
2 parents 97449e4 + 4a392e5 commit e273907

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

manifests/mod/security.pp

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
# @param modsec_secruleengine
2424
# Configures the rules engine.
2525
#
26+
# @param debug_log_level
27+
# Configures the debug log level.
28+
#
2629
# @param audit_log_relevant_status
2730
# Configures which response status code is to be considered relevant for the purpose of audit logging.
2831
#
@@ -143,6 +146,7 @@
143146
Optional[Array[String]] $custom_rules_set = $apache::params::modsec_custom_rules_set,
144147
Stdlib::Absolutepath $modsec_dir = $apache::params::modsec_dir,
145148
String $modsec_secruleengine = $apache::params::modsec_secruleengine,
149+
Integer[0, 9] $debug_log_level = 0,
146150
String $audit_log_relevant_status = '^(?:5|4(?!04))',
147151
String $audit_log_parts = $apache::params::modsec_audit_log_parts,
148152
String $audit_log_type = $apache::params::modsec_audit_log_type,
@@ -262,6 +266,7 @@
262266
'audit_log_type' => $audit_log_type,
263267
'audit_log_format' => $audit_log_format,
264268
'audit_log_storage_dir' => $audit_log_storage_dir,
269+
'debug_log_level' => $debug_log_level,
265270
'logroot' => $logroot,
266271
}
267272

spec/classes/mod/security_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
audit_log_type: 'Concurrent',
105105
audit_log_format: 'JSON',
106106
audit_log_storage_dir: '/var/log/httpd/audit',
107+
debug_log_level: 3,
107108
secdefaultaction: 'deny,status:406,nolog,auditlog',
108109
secrequestbodyaccess: 'Off',
109110
secresponsebodyaccess: 'On',
@@ -118,6 +119,7 @@
118119
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogFormat JSON$} }
119120
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogStorageDir /var/log/httpd/audit$} }
120121
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecRequestBodyAccess Off$} }
122+
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecDebugLogLevel 3$} }
121123
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecResponseBodyAccess On$} }
122124
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecRequestBodyLimitAction ProcessPartial$} }
123125
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecResponseBodyLimitAction Reject$} }

templates/mod/security.conf.epp

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
SecResponseBodyMimeType text/plain text/html text/xml
4545
SecResponseBodyLimit 524288
4646
SecResponseBodyLimitAction <%= $secresponsebodylimitaction %>
47-
SecDebugLogLevel 0
47+
SecDebugLogLevel <%= $debug_log_level %>
4848
SecAuditEngine RelevantOnly
4949
SecAuditLogRelevantStatus "<%= $audit_log_relevant_status %>"
5050
SecAuditLogParts <%= $audit_log_parts %>

0 commit comments

Comments
 (0)