Repository navigation
docs(security): bootstrap the .security threat model the security review gates against - #241
Conversation
…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
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 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
Awesome! |
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_failuresentry 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 baseon every PR here (for example on #237), so its model-backed checks never run. This adds the model it gates against:.security/threat-model.mdand.security/boundaries.yaml, in the layout defined by the Security team'sthreat-model-persistentandquick-pr-review-modelskills 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 withinvariant,enforced_by,paths,review_focus,known_failures,severity_floor; assets withsinks,gated_byand areachability_probe;surface_probes) andreferences/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 atestslist 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 asknown_failureswith 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_byandreviewed_onare 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 nullreviewed_byit should report the model as unreviewed and run its probes advisorily).Testing
Every probe in
boundaries.yamlwas run against 843d38f with the skill'sgit grepmechanics (exit status read directly,<ref>:prefix stripped). All returned status 0 with the expected sets, exceptunpinned-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 andpath:lineanchor was checked against this commit.oxfmt --checkpasses 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.