Saltstack Official Apache Formula
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

152 rindas
4.1KB

  1. enforced_directives:
  2. # httpd directives enforced in all configuration files and sections
  3. # data structure :
  4. # directive:
  5. # value: numeric or string - value to enforce
  6. # add_if_absent: False (default) - True -> add it to server configuration if it is absent from pillar
  7. # onlyif_pillar_is: different (default) |greater|lower -> compare numeric values
  8. # - greater : enforce value if the pillar content is > value
  9. # - lower : enforce value if the pillar content is < value
  10. # match : regex
  11. # container : enforce only on the specified container
  12. # regex_group_position : the position of the group to substitute in regex
  13. # values : list of dict - for multiple replacements in the same directive
  14. # Set TimeOut to 10 or less
  15. Timeout:
  16. value: 10
  17. onlyif_pillar_is: 'greater'
  18. add_if_absent: True
  19. # Set Timeout Limits for Request Headers
  20. RequestReadTimeout:
  21. values:
  22. -
  23. match: '(?<=header=)(\d+-)?(\d+)'
  24. value: 40
  25. onlyif_pillar_is: 'greater'
  26. regex_group_position: 2
  27. -
  28. match: '(?<=body=)(\d+-)?(\d+)'
  29. value: 20
  30. onlyif_pillar_is: 'greater'
  31. regex_group_position: 2
  32. # Disable the SSL v3.0 Protocol
  33. SSLProtocol:
  34. value: ''
  35. match: '(?<!-)((\+)?SSLv3)'
  36. regex_group_position: 1
  37. # Minimize Options for Directories to NOT have a value of Includes
  38. Options:
  39. match: '(?<!-)((\+)?Includes)'
  40. value: ''
  41. regex_group_position: 1
  42. container: 'Directory'
  43. # Set the KeepAlive directive to On
  44. KeepAlive:
  45. value: 'On'
  46. add_if_absent: True
  47. # Set MaxKeepAliveRequests to 100 or greater
  48. MaxKeepAliveRequests:
  49. value: 100
  50. onlyif_pillar_is: 'lower'
  51. add_if_absent: True
  52. # Set KeepAliveTimeout to 15 or less
  53. KeepAliveTimeout:
  54. value: 15
  55. onlyif_pillar_is: 'greater'
  56. add_if_absent: True
  57. # Disable HTTP TRACE Method
  58. TraceEnable:
  59. value: 'off'
  60. add_if_absent: True
  61. # Set ServerSignature to 'Off'
  62. ServerSignature:
  63. value: 'off'
  64. add_if_absent: True
  65. # Set ServerToken to 'Prod'
  66. ServerTokens:
  67. value: 'Prod'
  68. # Secure Core Dump Directory
  69. CoreDumpDirectory:
  70. value: '/var/log/httpd'
  71. # Disable SSL Insecure Renegotiation
  72. SSLInsecureRenegotiation:
  73. value: 'off'
  74. # Ensure SSL Compression is not Enabled
  75. SSLCompression:
  76. value: 'off'
  77. # Restrict Override
  78. AllowOverride:
  79. value: 'None'
  80. AllowOverrideList:
  81. value: 'None'
  82. PidFile:
  83. value: '/etc/httpd/run/httpd.pid'
  84. ScoreBoardFile:
  85. value: '/var/run/apache_runtime_status'
  86. SSLHonorCipherOrder:
  87. value: 'On'
  88. enforced_containers:
  89. # httpd sections (containers) enforced in all configuration files and sections
  90. Directory:
  91. # Restrict Override for the OS Root Directory
  92. -
  93. item: '/'
  94. directives:
  95. - AllowOverride: 'None'
  96. - Require: 'all denied'
  97. - Options: 'None'
  98. # Limit HTTP Request Methods
  99. -
  100. item: '/var/www'
  101. directives:
  102. - Options: 'None'
  103. containers:
  104. LimitExcept:
  105. -
  106. item: 'GET POST OPTIONS'
  107. directives:
  108. - Require: 'all denied'
  109. FilesMatch:
  110. # Restrict Access to .ht* files
  111. -
  112. item: '"^\.ht"'
  113. directives:
  114. - Require: 'all denied'
  115. containers_to_remove:
  116. # Remove Default HTML Content
  117. Location:
  118. - '/server-info'
  119. - '/server-status'
  120. - '/perl-status'
  121. server_supplemental_directives:
  122. # httpd directives added as it in httpd.conf
  123. # Restrict HTTP protocol versions
  124. - RewriteEngine: 'On'
  125. - RewriteCond: '%{THE_REQUEST} !HTTP/1\.1$'
  126. - RewriteRule: '.* - [F]'
  127. vhost_supplemental_directives:
  128. # httpd directives added as it in vhost config file
  129. # Inherit server options
  130. - RewriteEngine: 'On'
  131. - RewriteOptions: 'Inherit'
  132. modules:
  133. # httpd modules: enforce enabled and disabled
  134. enforce_disabled:
  135. - "dav"
  136. - "dav_fs"
  137. - "status"
  138. - "autoindex"
  139. - "userdir"
  140. - "info"
  141. enforce_enabled:
  142. - "log_config"
  143. - "reqtimeout"
  144. - "rewrite"