security: add environment gate and tag validation to update-main-version (TeamPCP)#273
Merged
Merged
Conversation
Addresses Finding 1 from the TeamPCP/GitHub Actions security audit (March 2026): - Add `environment: tag-release` to require human approval before any force-push runs. Create this environment in Settings → Environments with required reviewers. - Add preflight validation step that rejects any `target` input that is not an existing named tag in refs/tags/. This closes the exact attack vector used in the Trivy compromise — an attacker cannot point v2 at an arbitrary commit SHA or branch ref.
Without a bump2version call, the CI "Create Release" step is silently skipped because version-check.sh finds the existing tag. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bump version: 2.4.0 → 2.5.0
Bwvolleyball
approved these changes
Apr 2, 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
Addresses Finding 1 from the TeamPCP supply chain audit (March 2026), which identified
update-main-version.ymlas using the same force-push-to-mutable-tag pattern exploited in the Trivy compromise.Changes
1. Environment gate (
environment: tag-release)Blocks the job from running until a required reviewer approves it in the GitHub UI. Prevents a compromised or stolen credential from silently moving
v2to a malicious commit.2. Tag validation preflight step
Rejects any
targetinput that is not an existing named tag inrefs/tags/. This closes the exact TeamPCP attack vector — an attacker cannot pointv2at an arbitrary commit SHA or branch tip.Risk if not fixed
Every repo using
uses: stackhawk/hawkscan-action@v2resolves at runtime to whereverv2points. Without this gate, a single compromised workflow trigger could silently poison all customer CI pipelines.References