summaryrefslogtreecommitdiff
path: root/apache2/conf-available/local-securityheaders.conf
blob: a72a25e51a30959479fa02c4f93c9dec58d24edd (plain)
  1. # Security headers
  2. # More info: <https://securityheaders.com/>
  3. # Avoid Clickjack attacks
  4. Header always set X-Frame-Options "SAMEORIGIN"
  5. # Enable reflective XSS protection and block response when detecting an attack
  6. Header always set X-Xss-Protection "1; mode=block"
  7. # Use strict MIME types
  8. Header always set X-Content-Type-Options "nosniff"
  9. # Do not send the referrer header when navigating from HTTPS to HTTP,
  10. # but always send the full URL when navigating from HTTP to any origin.
  11. # More info: <https://scotthelme.co.uk/a-new-security-header-referrer-policy/>
  12. Header set Referrer-Policy "no-referrer-when-downgrade"
  13. # Allow images, scripts, AJAX, form actions, and CSS from the same origin,
  14. # and disallow any other resources to load (eg object, frame, media, etc).
  15. # More info: <https://content-security-policy.com/>
  16. Header set Content-Security-Policy "default-src 'none'; script-src 'self'; connect-src 'self'; img-src 'self'; style-src 'self'; base-uri 'self'; form-action 'self';"
  17. # More info: <https://www.w3.org/TR/permissions-policy-1/>
  18. # feature list: <https://github.com/w3c/webappsec-permissions-policy/blob/master/features.md>
  19. Header set Permissions-Policy "accelerometer(self), ambient-light-sensor(self), autoplay(self), battery(self), camera(self), cross-origin-isolated(self), display-capture(self), document-domain(self), encrypted-media(self), execution-while-not-rendered(self), execution-while-out-of-viewport(self), fullscreen(self), geolocation(self), gyroscope(self), magnetometer(self), microphone(self), midi(self), navigation-override(self), payment(self), picture-in-picture(self), publickey-credentials-get(self), screen-wake-lock(self), sync-xhr(self), usb(self), web-share(self), xr-spatial-tracking(self)"