Repository navigation
feat(audit): GitHub workflow supply-chain and token-scoping rule expansion - #1975
Merged
Merged
Conversation
…nsion Adds GHA059-GHA062 to the github lexicon's post-synth checks, closing the gaps issue #445 named in workflow pin-provenance, generated-token scope, usage policy, and vulnerability intelligence: - GHA059 stale/missing pin annotation (flags both a missing trailing version comment and an internally-inconsistent one, no network needed). - GHA060 over-scoped generated GitHub App token (permission-* scopes unused or unevidenced by consuming steps). - GHA061 opt-in action-usage policy (allow/deny lists) — silent unless a caller supplies a policy via evaluateUsagePolicy(). - GHA062 advisory cross-reference against an injected vulnerability feed — degrades to no findings, never an error, when no feed is supplied. Per epic #350's design spine, GHA061/GHA062 take their config/feed as a function argument rather than fetching or reading fs themselves — the pure core stays network- and fs-free. PostSynthContext carries no per-check runtime config channel today, so the shipped checks pass an empty default (matching the existing TRUSTED_ACTION_OWNERS convention); a project opts in by wrapping evaluateUsagePolicy/checkAdvisories in its own `lint.policies` check with real data. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 26, 2026
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.
Summary
Closes gaps #445 named in GitHub Actions workflow auditing: pin provenance, generated-token scope, usage policy, and vulnerability intelligence. Adds four new rules to the github lexicon's post-synth checks, following the existing GHA-series conventions (id, severity, dimension/category, tier, remediation, authority citation) established by #351.
Rule ids + behaviors
merge-worthy/guidance). Flags a SHA-pinneduses:with no trailing version comment ("missing"), and — without any network call — flags an internally-inconsistent one: the same commit SHA annotated with two different labels somewhere in the workflow, or the same label attached to two different SHAs ("mismatched"). Either shape proves at least one label is wrong.merge-worthy/guidance). Targets the well-known GitHub App token actions (actions/create-github-app-token,tibdex/github-app-token,getsentry/action-github-app-token). Flags a minted token whosepermission-<scope>: write/admininput is either never referenced by a consuming step ("unused") or shows no textual evidence of that scope being exercised anywhere else in the job ("no-signal").merge-worthy/guidance, opt-in). An allow/deny list over third-partyuses:references, for environments that constrain which external components may run. Silent when unconfigured.merge-worthy/guidance). Cross-references pinned refs (by SHA or tag) against a caller-supplied advisory feed. Degrades to no findings — never an error — when no feed is supplied.All four are
category: "security", and GHA059/060/062 cite an authority (OSSF Scorecard Pinned-Dependencies/Token-Permissions/Vulnerabilities, GitHub hardening docs) — added a newSCORECARD_VULNauthority constant topackages/core/src/audit/catalog.tsfor GHA062.How the policy/feed inputs are injected
Per epic #350's design spine, the pure core never fetches or reads the filesystem itself.
PostSynthContextcarries no per-check runtime config channel today (see the existingTRUSTED_ACTION_OWNERSdoc comment for the same constraint on GHA029), so:evaluateUsagePolicy(yaml, policy: ActionUsagePolicy)andcheckAdvisories(yaml, feed?: AdvisoryFeed)are exported as pure functions that take their config/feed as a plain argument — fully testable and injectable by any caller.gha061/gha062PostSynthChecks (run automatically duringchant build/chant lint/chant audit) call these with an empty default (DEFAULT_ACTION_USAGE_POLICY = {},DEFAULT_ADVISORY_FEED = { entries: [] }) — so by default they report nothing, satisfying "opt-in" and "graceful degradation" directly.lint.policiesentry (chant.config.ts) that importsevaluateUsagePolicy/checkAdvisoriesand wraps them in its ownPostSynthCheckwith real data (its allow/deny list, or a pre-fetched/local advisory feed structure) — never afetch()inside the rule itself.Test results
Regenerated
lexicons/github/src/lint/post-synth/index.tsvianpm run generate:barrels(committed barrel, DO NOT hand-edit) anddocs/src/content/docs/lint-rules/audit-rules.mdxviarenderRulesReference()to stay in sync with the catalog perrules-doc.test.ts.Notes for reviewers
packages/core/src/audit/catalog.tsedit to a single additive authority constant (SCORECARD_VULN) — other agents are working elsewhere inpackages/core/src/audit, so the rest of the new-rule metadata lives in the github lexicon's ownaudit-catalog.ts(audit: lexicons contribute their audit rule catalog metadata (dedupe core's central RULE_CATALOG) #687's per-lexicon ownership pattern).Fixes #445
🤖 Generated with Claude Code