Skip to content

Assert the Security Headers in the Live Check #500

Closed

Description

@ptr727

Summary

checks/check-live-urls.sh asserts X-Blog-Env and X-Blog-Release, and it reads no security header on either site. After #499, both site blocks send Strict-Transport-Security, X-Content-Type-Options, and Referrer-Policy, and the family block also sends a Content-Security-Policy. A Caddyfile edit that drops one of them passes every check, and the header is gone until someone reads it by hand. Copilot raised this on #499, and it was deferred here because it needs a design of its own.

What to decide

  • Which responses to read. The preflight request to the blog's / and the family page requests already hold their headers. Asserting there costs no extra request, which matters for the production edge's crawl budget. A redirect and a 404 are where a header outside the route block could go missing, so adding one of each is the other option.
  • What to assert. Presence alone, or the exact value. The exact value catches a weakened HSTS lifetime, but it also means a second copy of each value to keep in sync with the Caddyfile.
  • Tests. Whatever the check asserts needs a case under checks/tests that fails when a header is missing.

Done

The live check fails on a release whose blog or family responses lack one of the security headers, and a unit case proves it.

🤖 Generated with Claude Code

Activity

  1. ptr727 commented on Oct 24, 2026

    @ptr727
    OwnerAuthor

    Also print the proxy state from the preflight. The local review of #498 suggested the preflight print server and cf-ray from the headers it already reads (preflight_headers, header_of), next to its served by line. A hand run would then show whether it went through Cloudflare, and the hand probe #498 documents would no longer be needed. If this lands, shorten that OPERATIONS.md paragraph to point at the preflight line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions