The Permissions-Policy HTTP header replaces the existing Feature-Policy header for controlling delegation of permissions and powerful features. The header uses a structured syntax, and allows sites to more tightly restrict which origins can be granted access to features. This will be released in Really Simple SSL 4.1 before deprecation.
What is the Permissions Policy header
The Permission Policy header is a security header that controls which browser features can be used. Besides implementing these rules for your own content it can also prevent external iFrames from using these browser features, making it a powerful header to secure your site.
This allows you to have fine-grained control over which browser functions your site can use. There are many directives that can be controlled with the Permission Policy header, you will find a description of each feature at the bottom of this article, under “Descriptions per directive”. For an extensive overview of all directives, refer to this list by Mozilla.
Each directive can have one of these three values:
- Allowed: This feature is not included in your Permissions Policy and is allowed for your entire site, including external iFrames
- self: This feature is allowed for content coming from your own domain only, blocking this feature for external iFrames
- Not allowed: This feature is included in your Permissions Policy without value, it is not allowed on your site at all
How to use the Permissions Policy header generator
You can find the Permissions Header policy settings in the Premium tab from your Really Simple SSL Dashboard (Settings -> SSL -> Premium). To enable the Permission Policy header, enable the ‘Permissions Policy‘ option.
Once enabled, a new block containing a list of directives and their values will appear. By default, all directives will have the * value. You can change the value for each directive. After pressing the ‘Save’ button near the bottom of the page, the Permissions Policy will be automatically updated in your .htaccess file.
Descriptions per directive
Because not all of the available features are self-explanatory, a short description of each directive can be found below:
- Accelerometer: Allow or prevent requesting information about the acceleration of the device.
- Autoplay: Allow or prevent autoplaying of media (requested through the HTMLMediaElement interface).
- Camera: Allow or prevent the use of video input devices.
- Document-domain (deprecated, will be removed): Controls the domain portion of the origin of the current document, modifying how certain security checks are performed.
- Encrypted-media: Allow or prevent use of the “Encrypted Media Extensions” API, to control the playback of content subject to a digital restrictions management scheme.
- Fullscreen: Allow or prevent cross- and same-origin frames from using Fullscreen mode.
- Geolocation: Allow or prevent use of the Geolocation Interface.
- Gyroscope: Allow or prevent collecting information about the orientation of the device (using the angular velocity along the three axes).
- Magnetometer: Allow or prevent collecting information about the orientation of the device (as detected by the device’s primary magnetometer sensor).
- Microphone: Allow or prevent the use of audio input devices.
- Midi: Allow or prevent use of the Web MIDI API, which contains methods to display and request information from connected MIDI devices.
- Payment: Allow or prevent use of the Payment Request API (meant to reduce the steps needed to complete a payment by remembering payment information.)
- Picture-in-picture: Allow or prevent playing video’s in Picture-in-Picture mode.
- Sync-xhr: Allow or prevent synchronous XMLHttpRequest requests to retrieve data from a URL without having to do a full page refresh.
- USB: Allow or prevent use of the WebUSB API.
- New Interest-cohort: Used to prevent Google from using your site for browser fingerprinting via the FLoC trial.
Source: Mozilla Web Docs (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy)
Any questions or remarks? Contact us and let us know what you think!