Skip to content

Commit 12f7ed9

Browse files
committed
Add Document-Policy header
This header accomplishes the following: - Forbids document.write - Forbids document.domain - Forbids use of profiling APIs - Forbids popups (similar to the overly-agressive "sandbox" CSP directive; uplifed from the deprecated Feature-Policy header) These are preffed off in Chromium as "experimental"; the only DP directive currently enabled in Chromium is "force-load-at-top". More information: - Document-Policy explainer: https://github.com/wicg/document-policy/blob/main/document-policy-explainer.md - Document-Policy specification: https://wicg.github.io/document-policy/ - Current directives supported in Chromium: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/permissions_policy/document_policy_features.json5 To try this out, go to "chrome://flags" and enable experimental web platform features. See implementation status at https://bugs.chromium.org/p/chromium/issues/detail?id=993790.
1 parent ea84b60 commit 12f7ed9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

nginx/snippets/security-headers.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ include snippets/security-headers-base.conf;
33
add_header Content-Security-Policy "default-src 'none'; connect-src 'self' https://releases.grapheneos.org/; font-src 'self'; img-src 'self'; manifest-src 'self'; script-src 'self'; style-src 'self'; form-action 'none'; frame-ancestors 'none'; block-all-mixed-content; base-uri 'none'; require-trusted-types-for 'script'; trusted-types 'none'" always;
44

55
add_header Permissions-Policy "accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), clipboard-read=(), clipboard-write=(), display-capture=(), document-domain=(), encrypted-media=(), fullscreen=(), gamepad=(), geolocation=(), gyroscope=(), hid=(), idle-detection=(), interest-cohort=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), serial=(), speaker-selection=(), sync-xhr=(), usb=(), xr-spatial-tracking=()" always;
6+
7+
add_header Document-Policy "document-domain=?0, document-write=?0, popups=?0, js-profiling=?0"

0 commit comments

Comments
 (0)