Skip to content

Commit 86494cc

Browse files
committed
Add Permissions-Policy header
Closes #179
1 parent 9d2cb74 commit 86494cc

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

h5bp/security/permissions-policy.conf

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# ----------------------------------------------------------------------
2+
# | Permissions Policy |
3+
# ----------------------------------------------------------------------
4+
5+
# Set a strict Permissions Policy to mitigate access to browser features.
6+
#
7+
# The header uses a structured syntax, and allows sites to more tightly
8+
# restrict which origins can be granted access to features.
9+
# The list of available features: https://github.com/w3c/webappsec-permissions-policy/blob/main/features.md
10+
#
11+
# The example policy below aims to disable all features expect synchronous
12+
# `XMLHttpRequest` requests on the same origin.
13+
#
14+
# To check your Permissions Policy, you can use an online service, such as:
15+
# https://securityheaders.com/
16+
# https://observatory.mozilla.org/
17+
#
18+
# https://www.w3.org/TR/permissions-policy-1/
19+
# https://owasp.org/www-project-secure-headers/#permissions-policy
20+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy
21+
# https://scotthelme.co.uk/a-new-security-header-feature-policy/
22+
23+
<IfModule mod_headers.c>
24+
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"
25+
</IfModule>

0 commit comments

Comments
 (0)