Skip to content

Commit

Permalink
Add Permissions-Policy header
Browse files Browse the repository at this point in the history
Closes #179
  • Loading branch information
LeoColomb committed Jun 24, 2021
1 parent 9d2cb74 commit 86494cc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions h5bp/security/permissions-policy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ----------------------------------------------------------------------
# | Permissions Policy |
# ----------------------------------------------------------------------

# Set a strict Permissions Policy to mitigate access to browser features.
#
# The header uses a structured syntax, and allows sites to more tightly
# restrict which origins can be granted access to features.
# The list of available features: https://github.com/w3c/webappsec-permissions-policy/blob/main/features.md
#
# The example policy below aims to disable all features expect synchronous
# `XMLHttpRequest` requests on the same origin.
#
# To check your Permissions Policy, you can use an online service, such as:
# https://securityheaders.com/
# https://observatory.mozilla.org/
#
# https://www.w3.org/TR/permissions-policy-1/
# https://owasp.org/www-project-secure-headers/#permissions-policy
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy
# https://scotthelme.co.uk/a-new-security-header-feature-policy/

<IfModule mod_headers.c>
Header always set Permissions-Policy "accelerometer=(),autoplay=(),camera=(),display-capture=(),document-domain=(),encrypted-media=(),fullscreen=(),geolocation=(),gyroscope=(),magnetometer=(),microphone=(),midi=(),payment=(),picture-in-picture=(),publickey-credentials-get=(),screen-wake-lock=(),sync-xhr=(self),usb=(),web-share=(),xr-spatial-tracking=()" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i"
</IfModule>

0 comments on commit 86494cc

Please sign in to comment.