Skip to content

Commit d1b6106

Browse files
committed
workflows: add zizmor GitHub Actions security scan
Add zizmor.yml GitHub Actions workflow that runs zizmor static analysis against all SOF workflow files on every push to main and on every pull request targeting main. zizmor audits GitHub Actions workflows for security misconfigurations: unpinned action references, credential persistence, template injection, excessive permissions, pull_request_target misuse, poisoned pipeline attacks, and other supply-chain risks. While SOF already runs CodeQL analysis on workflows, zizmor covers a complementary and broader set of GitHub Actions-specific attack patterns that CodeQL does not detect. The two tools find different classes of issues and running both gives better coverage than either alone. A one-off manual scan (zizmor v1.25.2) of the existing SOF workflows found no exploitable vulnerabilities. The primary findings were 31 cases of actions referenced by mutable version tags instead of SHA hashes, and 22 checkouts missing `persist-credentials: false`. This workflow will prevent new regressions of this kind from being merged. The workflow follows the same conventions as the existing codeql.yml: - top-level `permissions: {}` with only required grants at job level - `actions/checkout` and `zizmorcore/zizmor-action` pinned to SHAs - `persist-credentials: false` on the checkout step - concurrency group that cancels superseded runs Findings are uploaded as SARIF to the GitHub Security tab via GitHub Advanced Security (SOF is a public repository). The run does not fail on findings; use a GitHub Ruleset to make it a blocking merge gate. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent c351193 commit d1b6106

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/zizmor.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: "Zizmor GitHub Actions Analysis"
3+
# yamllint disable-line rule:truthy
4+
on:
5+
push:
6+
branches:
7+
- 'main'
8+
pull_request:
9+
branches:
10+
- 'main'
11+
12+
permissions: {}
13+
14+
# Specifies group name that stops previous workflows if the name matches
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
zizmor:
21+
name: Analyze workflows with zizmor
22+
runs-on: ubuntu-latest
23+
permissions:
24+
security-events: write # Required to upload SARIF results to the Security tab
25+
actions: read # Required to read workflow information
26+
contents: read # Required to checkout repository
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
31+
with:
32+
persist-credentials: false
33+
34+
- name: Run zizmor
35+
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
36+
with:
37+
inputs: .github/workflows/

0 commit comments

Comments
 (0)