Saltstack Official Apache Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1KB

  1. # frozen_string_literal: true
  2. control 'apache mod_security configuration' do
  3. title 'should match desired lines'
  4. modspec_file =
  5. case platform[:family]
  6. when 'redhat', 'fedora'
  7. '/etc/httpd/conf.d/mod_security.conf'
  8. when 'debian'
  9. '/etc/modsecurity/modsecurity.conf-recommended'
  10. when 'suse'
  11. '/etc/apache2/conf.d/mod_security2.conf'
  12. end
  13. describe file(modspec_file) do
  14. it { should be_file }
  15. its('mode') { should cmp '0644' }
  16. its('owner') { should eq 'root' }
  17. its('group') { should eq 'root' }
  18. its('content') { should match(/SecRuleEngine On/) }
  19. its('content') { should match(/SecRequestBodyAccess On/) }
  20. its('content') { should match(/SecRequestBodyLimit 14000000/) }
  21. its('content') { should match(/SecRequestBodyNoFilesLimit 114002/) }
  22. its('content') { should match(/SecRequestBodyInMemoryLimit 114002/) }
  23. its('content') { should match(/SecRequestBodyLimitAction Reject/) }
  24. its('content') { should match(/SecPcreMatchLimit 15000/) }
  25. its('content') { should match(/SecPcreMatchLimitRecursion 15000/) }
  26. its('content') { should match(/SecDebugLogLevel 3/) }
  27. end
  28. end