Saltstack Official Apache Formula
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

mod_security_spec.rb 1.2KB

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