diff --git a/.changeset/csp-nonce-and-metrics-auth.md b/.changeset/csp-nonce-and-metrics-auth.md new file mode 100644 index 00000000..14b958d2 --- /dev/null +++ b/.changeset/csp-nonce-and-metrics-auth.md @@ -0,0 +1,11 @@ +--- +'ePDS': minor +--- + +Auth service tightens its Content-Security-Policy and locks down the metrics endpoint. + +**Affects:** Operators + +**Operators:** the auth service's `Content-Security-Policy` response header now uses a per-response nonce on the `script-src` directive instead of `'unsafe-inline'`. The resulting policy looks like `default-src 'self'; script-src 'self' 'nonce-'; style-src 'self' 'unsafe-inline'; img-src 'self' data: [client-origin]; connect-src 'self'`. All inline `` +` + +/** + * Inline ` +} + +/** + * Back-compat: the no-nonce variant of the inline script tag. Callers on + * services that set a CSP with `script-src 'nonce-...'` must use + * {@link previewClientIdScriptHtml} instead, passing the request nonce. + */ +export const PREVIEW_CLIENT_ID_SCRIPT_HTML = previewClientIdScriptHtml()