Skip to content

docs(security): bootstrap the .security threat model the security review gates against - #241

Merged
nickvigilante merged 1 commit into
mainfrom
vigilante/docs-1359-threat-model
Oct 21, 2026
Merged

nickvigilante merged 1 commit into
mainfrom
vigilante/docs-1359-threat-model

Conversation

@nickvigilante

Copy link
Copy Markdown
Collaborator

Merge order

Independent. It changes no code, so it can land before or after the open security fix PRs (#229, #230, #232, #234, #238, #239, #240). When each of those lands, its known_failures entry here should move from open to fixed in that PR or a follow-up.

Summary

The Coder Agents security review currently reports SKIPPED: no .security/ model at base on every PR here (for example on #237), so its model-backed checks never run. This adds the model it gates against: .security/threat-model.md and .security/boundaries.yaml, in the layout defined by the Security team's threat-model-persistent and quick-pr-review-model skills in coder/security-skills. It also adds .security/ to CODEOWNERS, as that spec asks, because narrowing the model is the edit that most weakens later reviews.

Design

The format comes from skills/threat-model-persistent/references/boundary-index.md (the YAML schema: boundaries with invariant, enforced_by, paths, review_focus, known_failures, severity_floor; assets with sinks, gated_by and a reachability_probe; surface_probes) and references/model-template.md (the four Markdown sections). No other repository in the org has a .security/ directory yet, so there was no worked example to copy. I added a tests list to each boundary, which the schema does not define, so the reviewer can see what pins each invariant; consumers that don't know the key should ignore it.

Eight boundaries: corpus render (sanitizer allowlist, .md-only sync, link schemes, plain-text twins), search client sinks (hits never parsed as raw HTML), the publish build/publish split (no write secret in the build job, digest-checked packages, plan regenerated, no caches, no workflow commands from artifact text), archive lifecycle (prefix confinement, manifest write last, cleanup re-reads the upload marker before every delete), router serving (path checks, archive-only origin, per-key CSP, bounded reads, redirect host/path checks), CSP and headers, workflow triggers and tokens, and dist-release. Seven assets carry reachability probes (the archive, mirror, manifest and Vercel tokens, the archive objects, the manifest, the coder.com origin and the dist tarballs), and nine surface probes cover triggers, write grants, secret names, unpinned actions, workflow-command emitters, raw-HTML sinks, router routes, off-site redirect hosts and CSP origins.

Sources: ARCHITECTURE.md, AGENTS.md, apps/docs/README.md (publisher, cleanup, docs-publish), apps/router/README.md, packages/docs-transforms/README.md, the workflows at 843d38f, the repository's rulesets and environments read through the API, and the two security assessments with their eight findings. Fixed findings are recorded as known_failures with the PR that fixed them; open ones (code-tab storage keys, the single-job preview workflow, workflow commands in publish logs, heading ids, the coder.com redirect loop, build-time DoS) are recorded as open on the boundary they belong to.

reviewed_by and reviewed_on are null. Per the skill, the reviewer treats a null-reviewed model as advisory, so this PR does not make anything blocking; Security (Lisa or JD) signs it off by filling those two fields in a follow-up or in this PR.

QA

There is nothing to see on the site; this adds documentation and one CODEOWNERS rule. The check is the security review's gate line on the next PR opened after this merges: it should read something other than SKIPPED: no .security/ model at base (with a null reviewed_by it should report the model as unreviewed and run its probes advisorily).

Testing

Every probe in boundaries.yaml was run against 843d38f with the skill's git grep mechanics (exit status read directly, <ref>: prefix stripped). All returned status 0 with the expected sets, except unpinned-actions, which returns status 1 (no matches) because every action is pinned; I checked that pattern matches a tag pin and a short SHA and does not match a 40-hex pin. Every file path and path:line anchor was checked against this commit. oxfmt --check passes on the YAML. The Markdown is one sentence per line with padded tables.

Upstream

No. This is this repository's own security model.

https://linear.app/codercom/issue/DOCS-1359


🤖 Built with AI assistance.

…iew gates against

The Coder Agents security review skips its model-backed gate on every PR
here because the repository has no .security/ model at the base ref, so
its invariant checks and probes never run. This adds that model in the
layout the Security team's threat-model-persistent and
quick-pr-review-model skills define: threat-model.md for the argument
(assets, actors, trust boundaries, attacker stories, severity
calibration) and boundaries.yaml for the lookup the reviewer parses
(eight boundaries with invariants, enforcing code, tests, review focus
and known failures; seven assets with reachability probes; nine surface
probes).

It is built from ARCHITECTURE.md, AGENTS.md, the publisher and router
READMEs, the workflows as they stand at this commit, and the two
security assessments and their findings, recording each fixed failure
and each open gap on the boundary it belongs to. Every probe was run
against this commit and returns a non-empty or intentionally empty set.

reviewed_by stays null, so the gate stays advisory until Security signs
it off. .security/ joins CODEOWNERS because narrowing the model is the
edit that most weakens future reviews.

Assisted-by: AI
@linear-code

linear-code Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
DOCS-1359 Add a .security/ threat model so security review can gate docs-engine PRs

Follow-up from Cedric's review of coder/docs-engine#237: the security reviewer skipped its gate because the repository has no .security/ model at the base commit ("Bootstrap .security/ with threat-model so later PRs can be gated").

Write the model from what already exists: the untrusted-corpus threat model in ARCHITECTURE.md, the security dossier, and Lisa's two assessments (security-assessments#280 and #378), including the actors, trust boundaries (untrusted build job vs secret-holding publish job, router vs private Blob store, search dialog sinks) and the invariants each finding relied on. Match the format the Coder Agents security reviewer expects; check another coder repository that already has .security/ for the layout before writing.

Review in Linear

@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
coder-docs Ignored Ignored Oct 21, 2026 9:23pm UTC
coder-docs-router Ignored Ignored Oct 21, 2026 9:23pm UTC

Request Review

@nickvigilante
nickvigilante requested a review from cjfit October 21, 2026 22:20
@nickvigilante
nickvigilante marked this pull request as ready for review October 21, 2026 22:20
@nickvigilante
nickvigilante requested a review from bpmct as a code owner October 21, 2026 22:20
@cjfit

cjfit commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Awesome!

@nickvigilante
nickvigilante merged commit 52a6941 into main Oct 21, 2026
29 checks passed
@nickvigilante
nickvigilante deleted the vigilante/docs-1359-threat-model branch October 21, 2026 22:37
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.

2 participants