Skip to content

Commit e3f10c8

Browse files
committed
Add tests for SecBodyAccess params
1 parent 9aecf77 commit e3f10c8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec/classes/mod/security_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,17 @@
7979
audit_log_type: 'Concurrent',
8080
audit_log_storage_dir: '/var/log/httpd/audit',
8181
secdefaultaction: 'deny,status:406,nolog,auditlog',
82+
secrequestbodyaccess: 'Off',
83+
secresponsebodyaccess: 'On',
8284
}
8385
end
8486

8587
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogRelevantStatus "\^\(\?:5\|4\(\?!01\|04\)\)"$} }
8688
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogParts ABCDZ$} }
8789
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogType Concurrent$} }
8890
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogStorageDir /var/log/httpd/audit$} }
91+
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecRequestBodyAccess Off$} }
92+
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecResponseBodyAccess On$} }
8993
it { is_expected.to contain_file('/etc/httpd/modsecurity.d/security_crs.conf').with_content %r{^\s*SecDefaultAction "phase:2,deny,status:406,nolog,auditlog"$} }
9094
it {
9195
is_expected.to contain_file('bar.conf').with(
@@ -227,6 +231,8 @@
227231
audit_log_type: 'Concurrent',
228232
audit_log_storage_dir: '/var/log/httpd/audit',
229233
secdefaultaction: 'deny,status:406,nolog,auditlog',
234+
secrequestbodyaccess: 'Off',
235+
secresponsebodyaccess: 'On',
230236
}
231237
end
232238

@@ -235,6 +241,8 @@
235241
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogRelevantStatus "\^\(\?:5\|4\(\?!01\|04\)\)"$} }
236242
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogParts ABCDZ$} }
237243
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogStorageDir /var/log/httpd/audit$} }
244+
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecRequestBodyAccess Off$} }
245+
it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecResponseBodyAccess On$} }
238246
it { is_expected.to contain_file('/etc/modsecurity/security_crs.conf').with_content %r{^\s*SecDefaultAction "phase:2,deny,status:406,nolog,auditlog"$} }
239247
it {
240248
is_expected.to contain_file('bar.conf').with(

0 commit comments

Comments
 (0)