nas-burnin/app
Brandon Walter 3a9bdc9e15
Some checks are pending
Security scan / pip-audit (push) Waiting to run
Security scan / bandit (push) Waiting to run
Security scan / gitleaks (push) Waiting to run
feat: CSP + security headers middleware + session-fixation defense (1.0.0-27)
#6 — defense-in-depth security headers:
* New _SecurityHeadersMiddleware emits five headers on every response:
  - Content-Security-Policy: tight default-src 'self', allow-list the
    three CDNs we actively load (unpkg for HTMX, cdnjs for QR codes,
    jsdelivr for xterm.js), plus 'unsafe-inline' for the inline script
    in settings.html and inline style in job_print.html. Tighten via
    nonces later if you want true CSP-level XSS protection.
  - X-Content-Type-Options: nosniff
  - Referrer-Policy: same-origin
  - X-Frame-Options: DENY (no clickjacking)
  - Permissions-Policy: camera/microphone/geolocation/interest-cohort
    all blocked
* Middleware ordering: SecurityHeaders -> AuthGate -> Session, so
  headers go on EVERY response including 401/403/redirects.

#7 — session-fixation defense:
* request.session.clear() now runs BEFORE setting user_id/username on
  successful /login AND /api/v1/auth/setup. Discards any pre-login
  payload an attacker might have seeded the cookie with. Combined
  with SameSite=strict + the HMAC-signed Starlette session cookie,
  this closes the residual fixation surface.

Verified: curl -sSI /login returns all five headers; container boots
clean; /health 200; existing session for the operator continues to
work because we only clear on the LOGIN flow itself.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:28:13 -04:00
..
static feat: secret handling — status badges + redacted endpoint + rotation audit (1.0.0-26) 2026-05-02 18:15:57 -04:00
templates feat: secret handling — status badges + redacted endpoint + rotation audit (1.0.0-26) 2026-05-02 18:15:57 -04:00
__init__.py Initial commit — TrueNAS Burn-In Dashboard v0.5.0 2026-02-24 00:08:29 -05:00
auth.py feat: app-level login + hardening sweep (1.0.0-22 -> 1.0.0-23) 2026-05-02 11:08:29 -04:00
auth_cli.py feat: app-level login + hardening sweep (1.0.0-22 -> 1.0.0-23) 2026-05-02 11:08:29 -04:00
burnin.py feat: app-level login + hardening sweep (1.0.0-22 -> 1.0.0-23) 2026-05-02 11:08:29 -04:00
config.py feat: CSP + security headers middleware + session-fixation defense (1.0.0-27) 2026-05-02 18:28:13 -04:00
database.py feat: app-level login + hardening sweep (1.0.0-22 -> 1.0.0-23) 2026-05-02 11:08:29 -04:00
logging_config.py Initial commit — TrueNAS Burn-In Dashboard v0.5.0 2026-02-24 00:08:29 -05:00
mailer.py feat: app-level login + hardening sweep (1.0.0-22 -> 1.0.0-23) 2026-05-02 11:08:29 -04:00
main.py feat: CSP + security headers middleware + session-fixation defense (1.0.0-27) 2026-05-02 18:28:13 -04:00
models.py feat: pool-membership lock + cancellation hardening + smart_health refresh + tunables (1.0.0-13 -> 1.0.0-21) 2026-05-02 09:25:56 -04:00
notifier.py Stage 7: SSH architecture, SMART attribute monitoring, drive reset, and polish 2026-02-24 08:09:30 -05:00
poller.py feat: daily security scan — pip-audit + bandit + gitleaks (1.0.0-24) 2026-05-02 17:07:22 -04:00
renderer.py Stage 7: SSH architecture, SMART attribute monitoring, drive reset, and polish 2026-02-24 08:09:30 -05:00
retention.py feat: app-level login + hardening sweep (1.0.0-22 -> 1.0.0-23) 2026-05-02 11:08:29 -04:00
routes.py feat: CSP + security headers middleware + session-fixation defense (1.0.0-27) 2026-05-02 18:28:13 -04:00
settings_store.py feat: pool-membership lock + cancellation hardening + smart_health refresh + tunables (1.0.0-13 -> 1.0.0-21) 2026-05-02 09:25:56 -04:00
ssh_client.py feat: app-level login + hardening sweep (1.0.0-22 -> 1.0.0-23) 2026-05-02 11:08:29 -04:00
terminal.py chore: re-sync deployed work that pre-dates this session 2026-05-02 09:24:42 -04:00
truenas.py chore: re-sync deployed work that pre-dates this session 2026-05-02 09:24:42 -04:00