Files

19 lines
1.3 KiB
Plaintext

# Security headers of the app Nginx. Nginx drops every inherited add_header
# in a block that sets its own, so each block that adds a header (named
# error locations) includes this file again.
#
# CSP: the built SPA is one module script and one stylesheet from the same
# origin, fonts and logos are bundled files, and the API is same-origin, so no
# external host and no inline code is allowed. frame-ancestors is the modern
# form of X-Frame-Options and base-uri/form-action/object-src close the
# injection routes that default-src does not cover. When telemetry (Faro)
# is connected it posts to the same-origin /telemetry, which connect-src
# 'self' already allows.
add_header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self'; connect-src 'self'; manifest-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; object-src 'none'" always;
add_header X-Content-Type-Options nosniff always;
add_header Referrer-Policy strict-origin-when-cross-origin always;
add_header X-Frame-Options DENY always;
add_header Cross-Origin-Opener-Policy same-origin always;
add_header Cross-Origin-Resource-Policy same-origin always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), usb=(), interest-cohort=()" always;