feat: add runner-guard to static-analysis-report workflow#24749
feat: add runner-guard to static-analysis-report workflow#24749
Conversation
- Add separate runner_guard pre-job with permissions: contents: read only (0 secrets) that installs runner-guard v2.6.0 via go install, runs source-to-sink scan, and uploads JSON results as artifact - Add download step for runner-guard artifact in agent steps - Add create-issue safe-output with max: 3 for runner-guard findings - Add Phase 6 agent instructions to analyze runner-guard output and create up to 3 GitHub issues for Critical/High severity findings (deduplication included) - Update discussion template to include runner-guard taint analysis section - Update success criteria and tool references throughout - Recompile lock file Agent-Logs-Url: https://github.com/github/gh-aw/sessions/1e2a44fe-daed-4cf7-9995-8d0acda0030d Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Separate stderr from stdout to avoid mixing error messages into JSON output - Add binary existence check after go install for better diagnostics - Add JSON validity check with fallback to empty result on parse failure - Remove hardcoded detection rule count (use generic description) - Clarify deduplication strategy: match on rule ID in issue title Agent-Logs-Url: https://github.com/github/gh-aw/sessions/1e2a44fe-daed-4cf7-9995-8d0acda0030d Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/bd3bc6a5-f8bc-4944-b21f-a2336dc93e45 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
The workflow already uses Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@Copile merge main and recompile in dev mode |
|
@copilot merge main and recompile in dev mode |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ae208215-3f37-41d1-970c-bedf44be1ffe Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done — merged main and recompiled all 181 workflows in dev mode (commit Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Adds a new runner-guard scan to the “Static Analysis Report” workflow so the agent can consume runner-guard findings alongside zizmor/poutine/actionlint and optionally open limited GitHub issues for critical results.
Changes:
- Add a
runner_guardpre-job that installs and runs runner-guard, then uploads JSON results as an artifact. - Extend the agent workflow to download runner-guard results and update the discussion/reporting instructions to include runner-guard output.
- Introduce a
create-issuesafe-output configuration (prefix/labels/max) for runner-guard Critical/High findings.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/static-analysis-report.md | Adds runner-guard job/artifact + updates agent steps and report template to incorporate runner-guard and issue creation. |
| .github/workflows/static-analysis-report.lock.yml | Compiled/locked workflow reflecting the new runner-guard job dependency, artifact download, and safe-output tool config. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (4)
.github/workflows/static-analysis-report.md:53
- The PR description says runner-guard should scan
.github/workflows/, but this job scans the entire repo (scan .). This will likely increase runtime/noise and doesn’t match the documented behavior; consider scanning only.github/workflows/(or make the description match the broader scan).
"$RUNNER_GUARD" scan . --format json > /tmp/runner-guard-results.json 2>/tmp/runner-guard-stderr.log || true
.github/workflows/static-analysis-report.md:56
- The fallback JSON construction interpolates raw stderr into a JSON string using shell quoting and
tr, which can still produce invalid JSON (newlines, backslashes, control chars, etc.). Since downstream steps parse this file as JSON, generate the fallback JSON via a proper JSON encoder (e.g., python/json.dumps) or omit/log stderr separately to keep/tmp/runner-guard-results.jsonalways valid.
if ! python3 -c "import json,sys; json.load(open('/tmp/runner-guard-results.json'))" 2>/dev/null; then
echo '{"findings":[],"stderr":"'"$(cat /tmp/runner-guard-stderr.log | head -20 | tr '"' "'")"'"}' > /tmp/runner-guard-results.json
.github/workflows/static-analysis-report.lock.yml:1326
- The PR description says runner-guard should scan
.github/workflows/, but this job scans the entire repo (scan .). This will likely increase runtime/noise and doesn’t match the documented behavior; consider scanning only.github/workflows/(or make the description match the broader scan).
"$RUNNER_GUARD" scan . --format json > /tmp/runner-guard-results.json 2>/tmp/runner-guard-stderr.log || true
.github/workflows/static-analysis-report.lock.yml:1329
- The fallback JSON construction interpolates raw stderr into a JSON string using shell quoting and
tr, which can still produce invalid JSON (newlines, backslashes, control chars, etc.). Since downstream steps parse this file as JSON, generate the fallback JSON via a proper JSON encoder (e.g., python/json.dumps) or omit/log stderr separately to keep/tmp/runner-guard-results.jsonalways valid.
if ! python3 -c "import json,sys; json.load(open('/tmp/runner-guard-results.json'))" 2>/dev/null; then
echo '{"findings":[],"stderr":"'"$(cat /tmp/runner-guard-stderr.log | head -20 | tr '"' "'")"'"}' > /tmp/runner-guard-results.json
- Files reviewed: 2/2 changed files
- Comments generated: 2
| - name: Checkout repository | ||
| uses: actions/checkout@v6.0.2 | ||
| with: | ||
| persist-credentials: false |
There was a problem hiding this comment.
This job runs go install ... without setting up a Go toolchain. Relying on whatever Go happens to be preinstalled on ubuntu-latest can lead to flakes or version incompatibility with runner-guard; consider adding an explicit actions/setup-go step (this workflow already uses it elsewhere, e.g. .github/workflows/static-analysis-report.lock.yml:339-343).
This issue also appears in the following locations of the same file:
- line 53
- line 55
| persist-credentials: false | |
| persist-credentials: false | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' |
| - name: Checkout repository | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false |
There was a problem hiding this comment.
This job runs go install ... without setting up a Go toolchain. Relying on whatever Go happens to be preinstalled on ubuntu-latest can lead to flakes or version incompatibility with runner-guard; consider adding an explicit actions/setup-go step (this workflow already sets up Go in the agent job at static-analysis-report.lock.yml:339-343).
This issue also appears in the following locations of the same file:
- line 1326
- line 1328
| persist-credentials: false | |
| persist-credentials: false | |
| - name: Set up Go | |
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
| with: | |
| go-version: "1.22" |
Summary
Updates
.github/workflows/static-analysis-report.mdto also run runner-guard (CI/CD source-to-sink vulnerability scanner by Vigilant-LLC) alongside the existing zizmor, poutine, and actionlint tools.Changes
New
runner_guardpre-job (0 secrets)permissions: contents: readonly — no GITHUB_TOKEN write access, no other secretsgo installand scans.github/workflows/for pipeline injection vulnerabilities (fork checkout exploits, expression injection, secret exfiltration, unpinned actions, AI config injection, supply chain steganography)New
create-issuesafe-outputtitle-prefix: "[runner-guard] ",labels: [security, automation],max: 3Agent instructions (Phase 6)
steps:/tmp/gh-aw/runner-guard-results.json, parses findings, and creates up to 3 issues for Critical/High severity findings[runner-guard]+ rule ID before creating