Repository navigation
Send the Same Security Headers and Image Lifetime From Both Sites - #499
Conversation
The blog block gains the HSTS, nosniff, and Referrer-Policy headers the family block already sends, with the same values. The family images take the blog's one-hour image class, replacing a week for SVGs and no-cache for the root PNG and ICO files. deploy/README.md states each remaining difference and its reason, the family-only CSP included. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #499 +/- ##
========================================
Coverage 49.70% 49.70%
========================================
Files 10 10
Lines 3058 3058
========================================
Hits 1520 1520
Misses 1538 1538
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔵 Needs a closer look
Automated coverage for the new security headers is missing, and the HSTS documentation needs a clarification.
No open issues 🎉
What changed in this PR
This pull request aligns security headers and image-cache lifetimes between the blog and family Caddy site blocks while documenting the intentional differences that remain.
Changes:
- Adds HSTS,
nosniff, andReferrer-Policyheaders to the blog site block. - Applies one-hour caching to family SVG, PNG, and ICO assets while retaining CSS and JavaScript revalidation.
- Documents shared security headers, cache behavior, HSTS scope, and the family-only CSP.
- Updates operational documentation to reflect the shared security-header posture.
| File | Summary | Review status |
|---|---|---|
OPERATIONS.md |
Updates the family-site deployment description to reflect shared security headers. | No findings |
deploy/README.md |
Documents security headers, cache lifetimes, HSTS scope, and intentional site differences. | Nit: explain the includeSubDomains and preload omissions separately. |
deploy/Caddyfile |
Adds blog security headers and aligns family image-cache rules. | Moderate issue: add automated live-contract assertions for the security headers across representative responses. |
Review effort: Lite
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Answering the round on 4b1c724, "Automated coverage for the new security headers is missing, and the HSTS documentation needs a clarification":
|
Summary
Makes the blog and family site blocks consistent in posture, per #497 and its widened scope. The blog gains the security headers the family block already sends. The family images take the blog's one-hour image class.
deploy/README.mdnow states each difference that stays, with its reason.Every difference, and its disposition
Strict-Transport-Securitymax-age=31536000, the family value, with noincludeSubDomainsorpreloadX-Content-Type-OptionsnosniffReferrer-Policystrict-origin-when-cross-originContent-Security-Policydeploy/README.md"Security headers" section states this and lists what the family policy allowsfavicon.ico,apple-touch-icon.png,og-image.png)no-cachethrough@pageand now takepublic, max-age=3600, the blog's image classcrest.svg,favicon.svg)site.cssandsite.jsare not fingerprinted, so they must revalidate. "Cache lifetimes" now says soheader {}block beside the existing linesThe audit on #497 lists everything both sites already do the same way: environment and robots variables,
no-cacheon pages, redirects and errors, precompression, error handling, redirect codes,robots.txtand sitemaps, check coverage, logging, and zone settings. None needed a change.OPERATIONS.mdcorrects the one sentence that credited the security headers to the family block alone.Verification
5ff25e7to the local staging mirror.checks/check-live-urls.shpassed in full: 1294 URLs, with the family site included.404, a media404,robots.txt, root icons,/assets/, and media JPG, MOV and ZIP. On the family site:/, the302and308redirects,/en/,/af/, both404shapes,robots.txt, CSS, JS, both SVGs, ICO and both PNGs. Every response carries HSTS,nosniffandReferrer-Policy. Each lifetime matches the table above.nosniff, every type served has a correctContent-Type. That covers the blog's script and stylesheet assets,index.json, the feed and sitemap, and the.movand.zipmedia.markdownlint,editorconfig-checker,cspell,prose_lint.py --diffwithsentence-length, and thechecks/testsunit suite (128 tests). All clean.The later commits change only the README and OPERATIONS.md wording, so the staging release still serves this Caddyfile.
Local review
The local strict pass ran twice. The first raised four findings:
introducedwording findings were fixed in 4b1c724: two stated counts ("both"), a CSP sentence that left out the inline-style anddata:allowances, and "follows the same table".stylefinding, on text this change wrote, is declined. It suggested a shared Caddyfile snippet for the header lines repeated in both blocks. The Send HSTS, nosniff, and Referrer-Policy From the Blog Site Block #497 audit kept the per-block layout (disposition 8). The blocks already repeatX-Blog-EnvandX-Blog-Releasethe same way, andX-Robots-Tagdiffers per site, so a snippet would hold only part of each block's headers.The second pass found nothing.
After the Copilot round, f1c0960 and 2bc5653 give
includeSubDomainsandpreloadseparate reasons and name edge HSTS as the host side's setting. Those were the round's nit, plus oneintroducedfinding from the next local pass. That pass's other observation was that the blog CSP survey had no tracking issue. It is now #501. The final local pass found nothing.Deferred
checks/check-live-urls.sh. This is the Copilot round's other point, and it needs its own design (which responses to read, and presence or value).After release, tell the HomeAutomation-Config session so it can re-measure both names through the proxy. That step is part of the handoff, not of this PR.
🤖 Generated with Claude Code