Add CI/CD security rules (mutable action refs, pull_request_target, script injection)#206
Open
seonghobae wants to merge 1 commit into
Open
Add CI/CD security rules (mutable action refs, pull_request_target, script injection)#206seonghobae wants to merge 1 commit into
seonghobae wants to merge 1 commit into
Conversation
…cript injection) GitHub Actions is a prime supply-chain/pipeline attack surface for AI-built repos, and only two narrow CI rules existed (secret env passthrough, GITHUB_TOKEN). scanner/rules/cicd.yml: - github-action-mutable-ref (WARNING) — `uses: x@main`/`@master` (pin to a SHA) - github-actions-pull-request-target (HIGH) — the fork-PR-with-secrets trigger - github-actions-script-injection (HIGH) — attacker-controllable `github.event.*` (issue/PR title/body, comment, head.ref) inlined into a workflow expression - Tests: tests/test_cicd_rules.py (2+ positive / 2+ negative per rule + severities). - Verified: e2e all 3 fire on a malicious workflow, 0 false positives on a safe one (@sha pins, github.event.number, secrets.*). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EywwS2Du8pimW7xqRP3An3
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
GitHub Actions is a prime supply-chain / pipeline attack surface, and only two narrow CI rules existed. Adds three high-precision rules in
scanner/rules/cicd.yml:github-action-mutable-ref(WARNING) —uses: x@main/@master(a moving branch runs with your secrets; pin to a commit SHA).github-actions-pull-request-target(HIGH) — the trigger that runs with repo secrets in a fork-PR context; poisoned-pipeline risk if it builds/runs PR code.github-actions-script-injection(HIGH) — attacker-controllablegithub.event.*(issue/PR title/body, comment body, head.ref) inlined into a${{ }}expression; command injection inrun:steps. Pass viaenv:and reference$VAR.Test plan
pytest—tests/test_cicd_rules.py(2+ positive / 2+ negative per rule + severities)@<sha>pins,github.event.number,secrets.*)🤖 Generated with Claude Code