Repository navigation
ci: check the pinned threat-model baseline hash against its tag - #370
Merged
Merged
Conversation
Fail when docs/threat-model.md at a baseline tag no longer matches the hash pinned in docs/audits/threat-model-baseline.md (or the tag is unreadable). Report, without failing, how many commits and lines the current document has drifted since the latest baseline. The pin and the baseline are untouched. Closes #366 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GqtiAsmkmDmpynCN35XTzg Signed-off-by: Claude <noreply@anthropic.com>
On the CI runner the script emitted a ::warning:: annotation instead of the plain DRIFT line the test expected. Set the variable explicitly per run. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GqtiAsmkmDmpynCN35XTzg Signed-off-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #366
What and why
Nothing verified the hash pinned in
docs/audits/threat-model-baseline.md; the only check was a manualshasumsnippet, which is howdocs/threat-model.mddrifted from B1 unnoticed.scripts/check_threat_model_baseline.py(standard library only):docs/threat-model.mdread from a baseline's git tag no longer hashes to the value pinned in the audit file (the immutability B1 claims), or if the pinned tag cannot be read. A tag that cannot be read is a failure, not a pass, so the CI job checks out full history with tags.::warning::annotation. Today it prints:2 commit(s) since the freeze, 80 lines added, 28 removed.It parses every
## Baseline Bnsection, so a future B2 is appended without editing the script: all baselines are checked for immutability, and drift is measured against the latest.Wiring: new
threat-model baselinejob inci.yml(own job,fetch-depth: 0andfetch-tags: true), plusmake threat-model-baseline. It is deliberately not inmake verify, because the shallow gate job and tagless clones do not have the tags. Tests intests/test_threat_model_baseline_check.pybuild throwaway git repos: untouched passes, edited pin fails, moved tag fails, missing tag fails, drift reports but exits 0, uncommitted edits count, B2 is measured separately from B1.Not touched
The pinned hash,
docs/audits/threat-model-baseline.md, anddocs/threat-model.mdare unchanged. Cutting B2 still needs a human re-review.Follow-up for the owner
I did not edit
.github/rulesets/main-branch.json. If you want the new job to be a required check, add its context (threat-model baseline (frozen tags must match their pins; drift is report-only)) there.Checklist
make lint type i18n doc-links markersgreen; new tests pass.make covrun locally as root shows one failure,test_a_failed_container_write_leaves_the_sealed_original_alone, which is the root-permission test fixed separately in test: make the failed container write test hold when the suite runs as root #369 and is unrelated to this change.CHANGELOG.mdentry addedGenerated by Claude Code