Skip to content

SMOODEV-1840: Edge security-headers policy on SmooaiNextEdge (0.2.0)#6

Merged
brentrager merged 1 commit into
mainfrom
SMOODEV-1840-security-headers
Jun 13, 2026
Merged

SMOODEV-1840: Edge security-headers policy on SmooaiNextEdge (0.2.0)#6
brentrager merged 1 commit into
mainfrom
SMOODEV-1840-security-headers

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Adds a CloudFront ResponseHeadersPolicy to SmooaiNextEdge, attached to all three cache behaviors (HTML, /_next/static/*, /_next/image*).

Why the edge, not next.config.ts: the edge layer covers paths the origin never serves (static assets, optimized images, error responses) and applies uniformly to every @smooai/deploy consumer — security headers are an edge concern.

Default baseline (on by default): HSTS (2yr, includeSubDomains, preload), X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN, Referrer-Policy: strict-origin-when-cross-origin, Permissions-Policy: camera=(), microphone=(), geolocation=().

New securityHeaders prop: false to disable, or an object to override. CSP is opt-in (contentSecurityPolicy + optional cspReportOnly) — a strict policy needs an inline-script audit first, so it's omitted by default.

Typecheck passes. Takes effect on the next prod SST deploy. Bumps to 0.2.0.

🤖 Generated with Claude Code

…aiNextEdge (0.2.0)

Security headers belong at the CloudFront edge, not next.config.ts: the edge
covers paths the origin never serves (static assets, optimized images, error
responses) and applies uniformly to every @smooai/deploy consumer. Adds a
ResponseHeadersPolicy attached to all three cache behaviors with a sensible
default baseline (HSTS, nosniff, frame-options, referrer-policy,
permissions-policy). CSP is opt-in to avoid breaking sites with a strict
untested policy. Controlled via the new securityHeaders prop.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2253783

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@brentrager brentrager merged commit 82dd1d9 into main Jun 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant