|
286 | 286 | ) |
287 | 287 | } |
288 | 288 |
|
289 | | - if facts[:os]['release']['major'].to_i < 18 && facts[:os]['name'] == 'Ubuntu' |
290 | | - it { is_expected.to contain_apache__security__rule_link('base_rules/modsecurity_35_bad_robots.data') } |
291 | | - |
292 | | - it { |
293 | | - expect(subject).to contain_file('modsecurity_35_bad_robots.data').with( |
294 | | - path: '/etc/modsecurity/activated_rules/modsecurity_35_bad_robots.data', |
295 | | - target: '/usr/share/modsecurity-crs/base_rules/modsecurity_35_bad_robots.data', |
296 | | - ) |
297 | | - } |
298 | | - end |
299 | | - |
300 | | - describe 'with parameters' do |
301 | | - let :params do |
302 | | - { |
303 | | - activated_rules: [ |
304 | | - '/tmp/foo/bar.conf', |
305 | | - ], |
306 | | - audit_log_relevant_status: '^(?:5|4(?!01|04))', |
307 | | - audit_log_parts: 'ABCDZ', |
308 | | - audit_log_type: 'Concurrent', |
309 | | - audit_log_storage_dir: '/var/log/httpd/audit', |
310 | | - secdefaultaction: 'deny,status:406,nolog,auditlog', |
311 | | - secrequestbodyaccess: 'Off', |
312 | | - secresponsebodyaccess: 'On', |
313 | | - secrequestbodylimitaction: 'ProcessPartial', |
314 | | - secresponsebodylimitaction: 'Reject' |
315 | | - } |
316 | | - end |
317 | | - |
318 | | - if facts[:os]['release']['major'].to_i < 18 && facts[:os]['name'] == 'Ubuntu' |
319 | | - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogRelevantStatus "\^\(\?:5\|4\(\?!01\|04\)\)"$} } |
320 | | - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogParts ABCDZ$} } |
321 | | - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogStorageDir /var/log/httpd/audit$} } |
322 | | - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecRequestBodyAccess Off$} } |
323 | | - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecResponseBodyAccess On$} } |
324 | | - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecRequestBodyLimitAction ProcessPartial$} } |
325 | | - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecResponseBodyLimitAction Reject$} } |
326 | | - it { is_expected.to contain_file('/etc/modsecurity/security_crs.conf').with_content %r{^\s*SecDefaultAction "phase:2,deny,status:406,nolog,auditlog"$} } |
327 | | - |
328 | | - it { |
329 | | - expect(subject).to contain_file('bar.conf').with( |
330 | | - path: '/etc/modsecurity/activated_rules/bar.conf', |
331 | | - target: '/tmp/foo/bar.conf', |
332 | | - ) |
333 | | - } |
334 | | - end |
335 | | - end |
336 | | - |
337 | 289 | describe 'with custom parameters' do |
338 | 290 | let :params do |
339 | 291 | { |
|
0 commit comments