fix(ci): validate effective workflow contents permissions - #1248
Draft
seonghobae wants to merge 2 commits into
Draft
seonghobae wants to merge 2 commits into
seonghobae wants to merge 2 commits into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Repair finding
Successor security-policy repair stacked on formatter prerequisite #1176. The consolidated supply-chain test on protected
developchecks raw workflow text forcontents: read/permissions: read-all. A comment or unrelated string can therefore satisfy that assertion even when effective workflow or job permissions grantcontents: write.This lane does not take ownership of #1176's formatter delta. Base is #1176 exact
8fe6b6d99c009527ef0bcba419e6f6debdb23c23; exact current head is2f121f14d64fa0cb343e96e24fbd6ca522203db6. The PR is Open / Draft / mergeable and owns only semantic GitHub Actions permission validation.RED → causal repair
RED
d939aa6f6e29cc69afc212b0907664a0ae0d1937adds behavioral regressions requiring:ossf-scorecard.yml,release.yml, andsecurity-audit.ymlbackstops to keep repository contents read-only;# contents: readnot to hide effective workflowcontents: write;contents: writenot to override a read-only workflow token;The RED intentionally referenced the absent semantic verifier and was immediately followed by repair before any hosted terminal verdict, so no hosted RED is claimed.
Repair
2f121f14d64fa0cb343e96e24fbd6ca522203db6addsscripts/checks/workflow_permissions.py. It parses workflow YAML with the repository-pinned PyYAML dependency, requires explicit workflow-level read-only contents authority (read-allorcontents: read), and rejects workflow/jobwrite-allorcontents: write. Job-level maps may omitcontents, which GitHub interprets as no permission for unspecified scopes when job permissions are declared.Trust boundary
GitHub Actions workflow YAML is executable supply-chain policy. This check reasons over parsed permission values rather than comments/substrings. It does not weaken required checks, change runtime workflow permissions, add network/filesystem authority, or copy a central
.githubcontrol.Exact-head evidence / stack gate
Exact
2f121f14...currently has zero hosted PR workflow generations by design of the existing workflow admission rules: repository CI/security workflows declarepull_request.branches: [develop, main], while this repair is intentionally stacked on #1176's feature branch to avoid claiming ownership of its formatter delta. Zero runs therefore are not GREEN.Keep Draft. #1176 must integrate normally first; this lane then retargets/reconciles to protected
developwithout force-push and obtains fresh exact-head CI, security/SAST, SBOM/supply-chain, CodeQL/central evidence plus qualifying independent non-author approval. No self-approval, gate weakening, synthetic status, blind rerun, or source-neutral wake commit.