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.

217 Zeilen
9.6KB

  1. #
  2. # This file is managed by Salt! Do not edit by hand!
  3. #
  4. LoadModule ssl_module libexec/apache24/mod_ssl.so
  5. <IfModule mod_ssl.c>
  6. #
  7. # Pseudo Random Number Generator (PRNG):
  8. # Configure one or more sources to seed the PRNG of the SSL library.
  9. # The seed data should be of good random quality.
  10. # WARNING! On some platforms /dev/random blocks if not enough entropy
  11. # is available. This means you then cannot use the /dev/random device
  12. # because it would lead to very long connection times (as long as
  13. # it requires to make more entropy available). But usually those
  14. # platforms additionally provide a /dev/urandom device which doesn't
  15. # block. So, if available, use this one instead. Read the mod_ssl User
  16. # Manual for more details.
  17. #
  18. SSLRandomSeed startup builtin
  19. SSLRandomSeed startup file:/dev/urandom 512
  20. SSLRandomSeed connect builtin
  21. SSLRandomSeed connect file:/dev/urandom 512
  22. ##
  23. ## SSL Global Context
  24. ##
  25. ## All SSL configuration in this context applies both to
  26. ## the main server and all SSL-enabled virtual hosts.
  27. ##
  28. #
  29. # Some MIME-types for downloading Certificates and CRLs
  30. #
  31. AddType application/x-x509-ca-cert .crt
  32. AddType application/x-pkcs7-crl .crl
  33. # Pass Phrase Dialog:
  34. # Configure the pass phrase gathering process.
  35. # The filtering dialog program (`builtin' is a internal
  36. # terminal dialog) has to provide the pass phrase on stdout.
  37. SSLPassPhraseDialog builtin
  38. # Inter-Process Session Cache:
  39. # Configure the SSL Session Cache: First the mechanism
  40. # to use and second the expiring timeout (in seconds).
  41. #SSLSessionCache dbm:${APACHE_RUN_DIR}/ssl_scache
  42. SSLSessionCache shmcb:${APACHE_RUN_DIR}/ssl_scache(512000)
  43. SSLSessionCacheTimeout 300
  44. # Semaphore:
  45. # Configure the path to the mutual exclusion semaphore the
  46. # SSL engine uses internally for inter-process synchronization.
  47. <IfVersion < 2.4>
  48. SSLMutex file:${APACHE_RUN_DIR}/ssl_mutex
  49. </IfVersion>
  50. # SSL Cipher Suite:
  51. # List the ciphers that the client is permitted to negotiate.
  52. # See the mod_ssl documentation for a complete list.
  53. # enable only secure ciphers:
  54. #SSLCipherSuite HIGH:MEDIUM:!ADH
  55. SSLCipherSuite EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA
  56. # Mitigate the CRIME attack
  57. #SSLCompression off
  58. # Use this instead if you want to allow cipher upgrades via SGC facility.
  59. # In this case you also have to use something like
  60. # SSLRequire %{SSL_CIPHER_USEKEYSIZE} >= 128
  61. # see http://httpd.apache.org/docs/2.2/ssl/ssl_howto.html.en#upgradeenc
  62. #SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
  63. # enable only secure protocols: SSLv3 and TLSv1, but not SSLv2
  64. SSLProtocol all -SSLv2 -SSLv3
  65. SSLHonorCipherOrder On
  66. # (bettercrypto.org)
  67. # Add six earth month HSTS header for all users...
  68. Header add Strict-Transport-Security "max-age=15768000"
  69. # If you want to protect all subdomains, use the following header
  70. # ALL subdomains HAVE TO support HTTPS if you use this!
  71. # Strict-Transport-Security: max-age=15768000 ; includeSubDomains
  72. # SSL Engine Switch:
  73. # Enable/Disable SSL for this virtual host.
  74. SSLEngine on
  75. SSLOptions +StrictRequire
  76. # A self-signed (snakeoil) certificate can be created by installing
  77. # the ssl-cert package. See
  78. # /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
  79. # If both key and certificate are stored in the same file, only the
  80. # SSLCertificateFile directive is needed.
  81. SSLCertificateFile {{ salt['pillar.get']('apache:ssl:default_cert', '/usr/local/etc/apache24/server.crt') }}
  82. SSLCertificateKeyFile {{ salt['pillar.get']('apache:ssl:default_key', '/usr/local/etc/apache24/server.key') }}
  83. # Server Certificate Chain:
  84. # Point SSLCertificateChainFile at a file containing the
  85. # concatenation of PEM encoded CA certificates which form the
  86. # certificate chain for the server certificate. Alternatively
  87. # the referenced file can be the same as SSLCertificateFile
  88. # when the CA certificates are directly appended to the server
  89. # certificate for convinience.
  90. #SSLCertificateChainFile /usr/local/etc/apache24/ssl.crt/server-ca.crt
  91. # Certificate Authority (CA):
  92. # Set the CA certificate verification path where to find CA
  93. # certificates for client authentication or alternatively one
  94. # huge file containing all of them (file must be PEM encoded)
  95. # Note: Inside SSLCACertificatePath you need hash symlinks
  96. # to point to the certificate files. Use the provided
  97. # Makefile to update the hash symlinks after changes.
  98. #SSLCACertificatePath /etc/ssl/certs/
  99. #SSLCACertificateFile /usr/local/etc/apache24/ssl.crt/ca-bundle.crt
  100. # Certificate Revocation Lists (CRL):
  101. # Set the CA revocation path where to find CA CRLs for client
  102. # authentication or alternatively one huge file containing all
  103. # of them (file must be PEM encoded)
  104. # Note: Inside SSLCARevocationPath you need hash symlinks
  105. # to point to the certificate files. Use the provided
  106. # Makefile to update the hash symlinks after changes.
  107. #SSLCARevocationPath /usr/local/etc/apache24/ssl.crl/
  108. #SSLCARevocationFile /usr/local/etc/apache24/ssl.crl/ca-bundle.crl
  109. # Client Authentication (Type):
  110. # Client certificate verification type and depth. Types are
  111. # none, optional, require and optional_no_ca. Depth is a
  112. # number which specifies how deeply to verify the certificate
  113. # issuer chain before deciding the certificate is not valid.
  114. #SSLVerifyClient require
  115. #SSLVerifyDepth 10
  116. # Access Control:
  117. # With SSLRequire you can do per-directory access control based
  118. # on arbitrary complex boolean expressions containing server
  119. # variable checks and other lookup directives. The syntax is a
  120. # mixture between C and Perl. See the mod_ssl documentation
  121. # for more details.
  122. #<Location />
  123. #SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
  124. # and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
  125. # and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
  126. # and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
  127. # and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
  128. # or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
  129. #</Location>
  130. # SSL Engine Options:
  131. # Set various options for the SSL engine.
  132. # o FakeBasicAuth:
  133. # Translate the client X.509 into a Basic Authorisation. This means that
  134. # the standard Auth/DBMAuth methods can be used for access control. The
  135. # user name is the `one line' version of the client's X.509 certificate.
  136. # Note that no password is obtained from the user. Every entry in the user
  137. # file needs this password: `xxj31ZMTZzkVA'.
  138. # o ExportCertData:
  139. # This exports two additional environment variables: SSL_CLIENT_CERT and
  140. # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
  141. # server (always existing) and the client (only existing when client
  142. # authentication is used). This can be used to import the certificates
  143. # into CGI scripts.
  144. # o StdEnvVars:
  145. # This exports the standard SSL/TLS related `SSL_*' environment variables.
  146. # Per default this exportation is switched off for performance reasons,
  147. # because the extraction step is an expensive operation and is usually
  148. # useless for serving static content. So one usually enables the
  149. # exportation for CGI and SSI requests only.
  150. # o StrictRequire:
  151. # This denies access when "SSLRequireSSL" or "SSLRequire" applied even
  152. # under a "Satisfy any" situation, i.e. when it applies access is denied
  153. # and no other module can change it.
  154. # o OptRenegotiate:
  155. # This enables optimized SSL connection renegotiation handling when SSL
  156. # directives are used in per-directory context.
  157. #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
  158. <FilesMatch "\.(cgi|shtml|phtml|php)$">
  159. SSLOptions +StdEnvVars
  160. </FilesMatch>
  161. <Directory /usr/lib/cgi-bin>
  162. SSLOptions +StdEnvVars
  163. </Directory>
  164. # SSL Protocol Adjustments:
  165. # The safe and default but still SSL/TLS standard compliant shutdown
  166. # approach is that mod_ssl sends the close notify alert but doesn't wait for
  167. # the close notify alert from client. When you need a different shutdown
  168. # approach you can use one of the following variables:
  169. # o ssl-unclean-shutdown:
  170. # This forces an unclean shutdown when the connection is closed, i.e. no
  171. # SSL close notify alert is send or allowed to received. This violates
  172. # the SSL/TLS standard but is needed for some brain-dead browsers. Use
  173. # this when you receive I/O errors because of the standard approach where
  174. # mod_ssl sends the close notify alert.
  175. # o ssl-accurate-shutdown:
  176. # This forces an accurate shutdown when the connection is closed, i.e. a
  177. # SSL close notify alert is send and mod_ssl waits for the close notify
  178. # alert of the client. This is 100% SSL/TLS standard compliant, but in
  179. # practice often causes hanging connections with brain-dead browsers. Use
  180. # this only for browsers where you know that their SSL implementation
  181. # works correctly.
  182. # Notice: Most problems of broken clients are also related to the HTTP
  183. # keep-alive facility, so you usually additionally want to disable
  184. # keep-alive for those clients, too. Use variable "nokeepalive" for this.
  185. # Similarly, one has to force some clients to use HTTP/1.0 to workaround
  186. # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
  187. # "force-response-1.0" for this.
  188. BrowserMatch "MSIE [2-6]" \
  189. nokeepalive ssl-unclean-shutdown \
  190. downgrade-1.0 force-response-1.0
  191. # MSIE 7 and newer should be able to use keepalive
  192. BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
  193. </IfModule>