diff options
author | Jonas Smedegaard <dr@jones.dk> | 2020-10-18 22:16:03 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2020-10-18 22:16:55 +0200 |
commit | ef6a1cbd75aa1cb89ccab9f3d28172fc19406fae (patch) | |
tree | 99c8a770dedadda7e333d7a491b651f4d1fe057d | |
parent | 63836d035b6d31d8e7888956acd2e895b7a2b4f4 (diff) |
add snippet local-securityheaders
-rw-r--r-- | apache2/conf-available/local-securityheaders.conf | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/apache2/conf-available/local-securityheaders.conf b/apache2/conf-available/local-securityheaders.conf new file mode 100644 index 0000000..a72a25e --- /dev/null +++ b/apache2/conf-available/local-securityheaders.conf @@ -0,0 +1,25 @@ +# Security headers +# More info: <https://securityheaders.com/> + +# Avoid Clickjack attacks +Header always set X-Frame-Options "SAMEORIGIN" + +# Enable reflective XSS protection and block response when detecting an attack +Header always set X-Xss-Protection "1; mode=block" + +# Use strict MIME types +Header always set X-Content-Type-Options "nosniff" + +# Do not send the referrer header when navigating from HTTPS to HTTP, +# but always send the full URL when navigating from HTTP to any origin. +# More info: <https://scotthelme.co.uk/a-new-security-header-referrer-policy/> +Header set Referrer-Policy "no-referrer-when-downgrade" + +# Allow images, scripts, AJAX, form actions, and CSS from the same origin, +# and disallow any other resources to load (eg object, frame, media, etc). +# More info: <https://content-security-policy.com/> +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';" + +# More info: <https://www.w3.org/TR/permissions-policy-1/> +# feature list: <https://github.com/w3c/webappsec-permissions-policy/blob/master/features.md> +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)" |