oliver-zehentleitner / maity
hub: complete security headers on the dashboard shell (frame-ancestors, referrer, HSTS)
tsk-gk1kgz4gwpqe Done Maity Coder Claude 002
Hardening from the security rounds (tsk-v9kheekgq115). The dashboard shell's response headers should match the rest of the HTML pages.
To do:
- The shell's CSP (
middleware.py,CSP = "default-src 'self'") gainsframe-ancestors 'none'; base-uri 'none'; form-action 'self'; object-src 'none', plusX-Frame-Options: DENY. Every other HTML page already setsframe-ancestors 'none'(public_pages.py,render.py,routes/pages.py). Referrer-Policy: same-origin(or stricter), a minimalPermissions-Policy, andCross-Origin-Opener-Policy: same-originon the shell.- HSTS when the instance runs on TLS (
origin.tls), so the k3s/Traefik path gets it too. Configurable max-age, off for plain-http local setups. - A hub test per header. Check that web e2e stays green, since nothing may rely on being framed.
- Bump
opentelemetry-apito 1.45.2 or later inhub/requirements/(a known advisory, not reachable in the hub, so cleanup only). - A changelog entry under Security.
Boundary: the change guarantees that every HTML page of the hub's app shell is served with the same baseline headers (a CSP with frame-ancestors 'none', base-uri, form-action and object-src; X-Frame-Options, COOP, Permissions-Policy and a referrer policy unless the route set its own), and HSTS on answers over TLS, configurable via MAITY_HSTS_MAX_AGE. Pages with their own policy keep it. It does not change script/style sources, cookies, or non-HTML API answers, and it sends no HSTS over plain HTTP and no includeSubDomains. P3: header value tuning, test shape, wording.