Repository navigation
ci: add actionlint to catch workflow script injection on PRs - #1030
Conversation
c71567e to
7e95d51
Compare
7e95d51 to
2b0eed3
Compare
PR rossoctl#933 introduced a command injection vulnerability that CodeQL missed (it only scans Python, not workflow YAML). Scorecard caught it post-merge but by then the vulnerability was on main. Changes: - Add actionlint as blocking PR check (detects expression injection in run: blocks, validates workflow syntax, reports inline via reviewdog) - Add pull_request trigger to Scorecard (runs Dangerous-Workflow analysis on PRs, disables OpenSSF API publishing since no OIDC on PR context) Both checks would have caught the injection in rossoctl#933 before merge. Signed-off-by: Ladislav Smola <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Ladislav Smola <[email protected]>
2b0eed3 to
b2f2823
Compare
pdettori
left a comment
There was a problem hiding this comment.
Addresses a real security gap (alert #188): CodeQL misses workflow YAML injection, Scorecard only runs post-merge. The actionlint addition is well-targeted — expression injection detection is exactly what's missing. The Scorecard-on-PR addition is appropriately marked experimental. All checks pass, actions are SHA-pinned, DCO signed-off.
Areas reviewed: CI/GitHub Actions, Security
Commits: 1, signed-off ✓
CI status: All passing (E2E HyperShift pending — requires maintainer trigger, expected)
| with: | ||
| fail_on_error: true | ||
| # Only report issues on lines changed in the PR (not pre-existing) | ||
| filter_mode: diff_context |
There was a problem hiding this comment.
Suggestion: Missing pull-requests: write permission for reporter: github-pr-review. Without it, reviewdog can't post inline PR annotations when actionlint finds issues — the job will still fail and block the PR, but contributors won't see why without digging into the Actions log.
Consider adding:
permissions:
contents: read
pull-requests: write
Problem
PR #933 introduced a command injection vulnerability in
e2e-hypershift-pr.yamlby parsing${{ github.event.comment.body }}in a bashrun:block. CodeQL passed because it only scans Python, not workflow YAML. The vulnerability was only caught by OpenSSF Scorecard post-merge on main (alert #188).Gap in CI
Fix
1. actionlint (reliable)
Add actionlint as a blocking PR check in
security-scans.yaml:${{ github.event.* }}inrun:blocks)fail_on_error: true)2. Scorecard on PRs (experimental)
Add
pull_requesttrigger to the existing Scorecard workflow:What this catches
Both checks would have flagged this unsafe pattern:
The safe alternative:
Test plan
${{ github.event.comment.body }}in a shellrun:block