Skip to content

Add gha-shield code-scanning starter#3311

Open
Fabridev444 wants to merge 1 commit into
actions:mainfrom
Fabridev444:add-gha-shield-code-scanning
Open

Add gha-shield code-scanning starter#3311
Fabridev444 wants to merge 1 commit into
actions:mainfrom
Fabridev444:add-gha-shield-code-scanning

Conversation

@Fabridev444
Copy link
Copy Markdown

Adds a starter workflow for gha-shield — a code-scanning Action that scans .github/workflows/*.yml for 13 categorized security rules.

Why this might be useful for the catalog

The existing code-scanning catalog focuses on application code (SAST for JS/Python/Java/Ruby/Go, container scanning, dependency scanning). gha-shield fills a different gap: scanning the workflow YAMLs themselves. Most repos accumulate workflow vulnerabilities (unpinned actions, command injection via `${{ github.event.* }}`, missing `permissions:`, hardcoded keys in `env:`, etc.) that no SAST tool covers.

The 13 rules at a glance

Rule Severity What it catches
`unpinned-action` HIGH third-party action not pinned to a 40-char SHA
`prtarget-checkout-prref` CRIT `pull_request_target` + checkout of attacker-controlled ref
`cmd-injection` CRIT tainted `${{ … }}` interpolated into `run:` (with `SAFE_LEAF_FIELDS` allowlist)
`no-permissions` MED external trigger without explicit `permissions:`
`continue-on-error-auth` HIGH `continue-on-error: true` on auth/test/audit steps
`secret-in-if` MED `secrets.*` inside `if:` (debug-log leak)
`curl-pipe-bash` HIGH remote scripts piped straight to a shell
`untrusted-download` MED gist/raw/paste download without checksum
`scheduled-broad-perms` MED `schedule:` + missing/loose token scope
`workflow-run-untrusted-checkout` CRIT `workflow_run` + checkout of triggering workflow's ref
`hardcoded-secret` CRIT provider-prefixed key (sk-, ghp_, AKIA…) in `env:`
`third-party-action-token` HIGH/MED untrusted-owner action receiving `GITHUB_TOKEN` / `secrets.*`
`no-timeout-minutes` LOW externally-triggered jobs without `timeout-minutes`

Compliance with the contributing guidelines

  • Simple as needed — single job, one Action invocation, three inputs (all with defaults).
  • No 3rd-party services — the Action runs entirely in the runner, no telemetry, no logs.
  • Not dependent on a paid service — V1 is free forever; the optional Pro tier ships separately and is not required.
  • SHA-pinning for non-`actions` org — the starter uses `Fabridev444/gha-shield@v1.0.1` (a published tag); happy to switch to the SHA `` if that's preferred, just say the word.

Receipts

Happy to iterate on the starter content, the properties JSON, or the icon — let me know what fits best.

@Fabridev444 Fabridev444 requested review from a team as code owners May 26, 2026 20:25
@github-actions github-actions Bot added the code-scanning Related to workflows that show on the Code Scanning setup page label May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-scanning Related to workflows that show on the Code Scanning setup page

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants