Skip to content

ci: add reusable Security Scan workflow (zizmor), pin actions to SHAs#21

Merged
jericht merged 4 commits into
mainlinefrom
add-reusable-security-scan
Jul 8, 2026
Merged

ci: add reusable Security Scan workflow (zizmor), pin actions to SHAs#21
jericht merged 4 commits into
mainlinefrom
add-reusable-security-scan

Conversation

@crowecawcaw

Copy link
Copy Markdown

Mirrors the aws-deadline/.github zizmor setup for the OpenJobDescription org.

What this adds

  • .github/workflows/reusable_security_scan.yml — a central, extensible security-scan umbrella workflow that member repos call from a thin stub. zizmor (GitHub Actions static analysis) is the first check; future checks are added here as sibling jobs so repos never need re-editing. Gated on high-severity findings (min-severity: high); findings report to the run log and PR annotations rather than the Security tab.
  • .github/workflows/security_scan.yml — a self-caller so this repo scans itself on push and PR to mainline (and weekly), modeled on the existing CodeQL caller. Other OpenJobDescription repos add an equivalent stub:
    jobs:
      security-scan:
        uses: OpenJobDescription/.github/.github/workflows/reusable_security_scan.yml@mainline
  • zizmor.yml — a single central config with an unpinned-uses policy (OpenJobDescription/*ref-pin, everything else → hash-pin), consumed by the reusable workflow via --config. One edit here updates policy for every consuming repo.
  • .github/dependabot.yml — keeps the SHA pins current.

Prep required to make the gate green

  • Pinned all third-party GitHub Actions to full commit SHAs with version comments across every reusable workflow and composite action. Our own OpenJobDescription/* reusable workflows keep their @mainline refs on purpose (allowed by the ref-pin policy).
  • Fixed all 19 high-severity template-injection findings by routing ${{ }} expansions through env: vars referenced as shell variables.

Verified locally with zizmor --config zizmor.yml --min-severity high .github/No findings to report (exit 0).

Draft

Leaving as a draft for review before publishing.

Mirror the aws-deadline/.github zizmor setup:

- Add reusable_security_scan.yml: a central, extensible security-scan
  umbrella workflow that member repos call from a thin stub. zizmor
  (GitHub Actions static analysis) is the first check; future checks are
  added here as sibling jobs so repos never need re-editing. Gated on
  high-severity findings (min-severity: high), reporting to the run log
  and PR annotations rather than the Security tab.

- Add security_scan.yml: a self-caller so this repo scans itself on push
  and PR to mainline (and weekly), modeled on the existing codeql caller.

- Add zizmor.yml: a single central config with an unpinned-uses policy
  (OpenJobDescription/* -> ref-pin, everything else -> hash-pin), consumed
  by reusable_security_scan.yml via --config. One edit here updates policy
  for every consuming repo.

- Pin all third-party GitHub Actions to full commit SHAs with version
  comments across every reusable workflow and composite action. Our own
  OpenJobDescription/* reusable workflows keep their @mainline refs on
  purpose. Add dependabot.yml to keep the SHAs current.

- Fix all high-severity template-injection findings by routing ${{ }}
  expansions through env vars referenced as shell variables, so the gate
  is green at min-severity: high.

Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>
Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>
The reusable workflow fetched zizmor.yml from OpenJobDescription/.github@mainline,
but the policy file does not exist on mainline until this PR merges — bootstrap
failure. Add a config-ref input (default mainline for member repos) and have the
.github self-caller pass the commit under test so the PR validates its own policy.

Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>
@crowecawcaw
crowecawcaw marked this pull request as ready for review July 8, 2026 20:12
@crowecawcaw
crowecawcaw requested a review from a team as a code owner July 8, 2026 20:12
Comment thread .github/workflows/security_scan.yml Outdated
Some OpenJobDescription repos (e.g. openjd-rs) use 'main' as their default
branch instead of 'mainline'. List both in the push/PR branch filters so the
same self-caller stub works regardless of the repo's branch name.

Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>
@crowecawcaw
crowecawcaw force-pushed the add-reusable-security-scan branch from a44688d to f821ac7 Compare July 8, 2026 22:27
@jericht
jericht merged commit 5fc0d61 into mainline Jul 8, 2026
5 checks passed
@jericht
jericht deleted the add-reusable-security-scan branch July 8, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants