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.

30 lines
1.0KB

  1. require_relative '../../../kitchen/data/spec_helper'
  2. describe 'apache.mod_security' do
  3. case os[:family]
  4. when 'redhat'
  5. modspec_file = '/etc/httpd/conf.d/mod_security.conf'
  6. when 'debian', 'ubuntu'
  7. modspec_file = '/etc/modsecurity/modsecurity.conf-recommended'
  8. else
  9. # No other supported ATM
  10. end
  11. describe file(modspec_file) do
  12. it { should exist }
  13. it { should be_mode 644 }
  14. it { should be_owned_by 'root' }
  15. it { should be_grouped_into 'root' }
  16. its(:content) { should match /SecRuleEngine On/ }
  17. its(:content) { should match /SecRequestBodyAccess On/ }
  18. its(:content) { should match /SecRequestBodyLimit 14000000/ }
  19. its(:content) { should match /SecRequestBodyNoFilesLimit 114002/ }
  20. its(:content) { should match /SecRequestBodyInMemoryLimit 114002/ }
  21. its(:content) { should match /SecRequestBodyLimitAction Reject/ }
  22. its(:content) { should match /SecPcreMatchLimit 15000/ }
  23. its(:content) { should match /SecPcreMatchLimitRecursion 15000/ }
  24. its(:content) { should match /SecDebugLogLevel 3/ }
  25. end
  26. end