fix: pin reviewed workflow file surface - #172
Open
sylvesterkaczmarek wants to merge 2 commits into
Open
Conversation
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
Make the repository's CI policy reject unreviewed GitHub Actions workflow files instead of validating only the known protected workflow subset.
Problem
script/validate-locksperforms unusually strict structural validation of Fence's reviewed workflows, but it does not assert the complete filename set under.github/workflows.The validator derives the set of workflows containing
pull_request:and requires that set to equal the reviewed PR workflow list. It then applies exact contracts to specific known workflow names. A newly added push-only workflow does not change that PR-workflow set and is not covered by any of the named exact contracts.That leaves a policy gap: a new workflow file can exist outside the reviewed workflow surface even though Fence treats workflow permissions, runners, commands, and immutable dependencies as part of its supply-chain boundary.
Evidence / reproduction
acceptance.yml,action-acceptance-ubuntu-latest.yml,action-acceptance.yml,action-drift-canary.yml,build.yml,integration.yml,lint.yml,release.yml, andtest.yml.validate_ci_evidenceenumerates every*.yml/*.yamlfile, but its global checks only require one explicit top-levelon:mapping and unquoted structural keys.pull_request:, so an added push-only workflow leaves that assertion unchanged.set(workflow_sources)equals the reviewed nine-file workflow surface..github/workflows/unreviewed.ymlwith an expliciton: pushtrigger, a syntactically ordinary job, andpermissions: contents: write. Because it has nopull_request:trigger and no known workflow name, it is outside the exact protected-workflow contracts.Change
script/lintThis does not change any existing workflow, permission, trigger, runner, or command. It makes addition/removal of a workflow an explicit reviewed policy change rather than an implicit extension of the CI surface.