security.j2 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {% if ansible_prolog -%}
  2. {% from 'templates/ansible/prolog.j2' import prolog with context %}
  3. {{ prolog() }}
  4. {% endif -%}
  5. #
  6. # Disable access to the entire file system except for the directories that
  7. # are explicitly allowed later.
  8. #
  9. # This currently breaks the configurations that come with some web application
  10. # Debian packages.
  11. #
  12. #<Directory />
  13. # AllowOverride None
  14. # Order Deny,Allow
  15. # Deny from all
  16. #</Directory>
  17. # Changing the following options will not really affect the security of the
  18. # server, but might make attacks slightly more difficult in some cases.
  19. #
  20. # ServerTokens
  21. # This directive configures what you return as the Server HTTP response
  22. # Header. The default is 'Full' which sends information about the OS-Type
  23. # and compiled in modules.
  24. # Set to one of: Full | OS | Minimal | Minor | Major | Prod
  25. # where Full conveys the most information, and Prod the least.
  26. #
  27. #ServerTokens Minimal
  28. ServerTokens Prod
  29. #ServerTokens Full
  30. #
  31. # Optionally add a line containing the server version and virtual host
  32. # name to server-generated pages (internal error documents, FTP directory
  33. # listings, mod_status and mod_info output etc., but not CGI generated
  34. # documents or custom error documents).
  35. # Set to "EMail" to also include a mailto: link to the ServerAdmin.
  36. # Set to one of: On | Off | EMail
  37. #
  38. #ServerSignature Off
  39. ServerSignature Off
  40. #
  41. # Allow TRACE method
  42. #
  43. # Set to "extended" to also reflect the request body (only for testing and
  44. # diagnostic purposes).
  45. #
  46. # Set to one of: On | Off | extended
  47. #
  48. TraceEnable Off
  49. #TraceEnable On
  50. #
  51. # Forbid access to version control directories
  52. #
  53. # If you use version control systems in your document root, you should
  54. # probably deny access to their directories. For example, for subversion:
  55. #
  56. <DirectoryMatch "/\.(svn|git)">
  57. Deny from all
  58. Satisfy all
  59. </DirectoryMatch>
  60. #
  61. # Setting this header will prevent MSIE from interpreting files as something
  62. # else than declared by the content type in the HTTP headers.
  63. # Requires mod_headers to be enabled.
  64. #
  65. <IfModule mod_headers.c>
  66. Header set X-Content-Type-Options: "nosniff"
  67. </IfModule>
  68. #
  69. # Some browsers have a built-in XSS filter that will detect some cross site
  70. # scripting attacks. By default, these browsers modify the suspicious part of
  71. # the page and display the result. This behavior can create various problems
  72. # including new security issues. This header will tell the XSS filter to
  73. # completely block access to the page instead.
  74. # Requires mod_headers to be enabled.
  75. #
  76. <IfModule mod_headers.c>
  77. Header set X-XSS-Protection: "1; mode=block"
  78. </IfModule>
  79. #
  80. # Setting this header will prevent other sites from embedding pages from this
  81. # site as frames. This defends against clickjacking attacks.
  82. # Requires mod_headers to be enabled.
  83. #
  84. <IfModule mod_headers.c>
  85. Header set X-Frame-Options: "sameorigin"
  86. </IfModule>
  87. #
  88. # Various protections
  89. # - stuff that should not be accessible publicly
  90. # - PHP files that should be invoked
  91. #
  92. <DirectoryMatch "/atos/param/">
  93. Deny from all
  94. Satisfy all
  95. </DirectoryMatch>
  96. <LocationMatch "/wp-content/uploads/.*\.php.*">
  97. Deny from all
  98. Satisfy all
  99. </LocationMatch>
  100. <Location "/xmlrpc.php">
  101. Deny from all
  102. Satisfy all
  103. </Location>