Skip to content

Commit cb5753b

Browse files
add zizmor to run periodically
1 parent e9d57d9 commit cb5753b

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Periodic Zizmor
2+
3+
permissions: {}
4+
5+
on:
6+
schedule:
7+
# Set to run once a day at 10:00 UTC
8+
- cron: "0 10 * * *"
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
zizmor:
15+
name: Run zizmor
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
repository:
20+
# - owner: grafana
21+
# repo: grafana
22+
# - owner: grafana
23+
# repo: loki
24+
# - owner: grafana
25+
# repo: tempo
26+
# - owner: grafana
27+
# repo: mimir
28+
- owner: grafana
29+
repo: security-github-actions
30+
31+
env:
32+
ZIZMOR_VERSION: 1.6.0
33+
MIN_SEVERITY: high
34+
MIN_CONFIDENCE: low
35+
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
with:
40+
persist-credentials: false
41+
42+
- name: Get GitHub App Secrets
43+
uses: grafana/shared-workflows/actions/[email protected]
44+
with:
45+
common_secrets: |
46+
ZIZMOR_APP_ID=zizmor:app-id
47+
ZIZMOR_PRIVATE_KEY=zizmor:private-key
48+
export_env: false
49+
50+
- name: Authenticate App With GitHub
51+
uses: actions/create-github-app-token@v2
52+
id: get-token
53+
with:
54+
app-id: ${{ fromJson(steps.get-secrets.outputs.secrets).ZIZMOR_APP_ID }}
55+
private-key: ${{ fromJson(steps.get-secrets.outputs.secrets).ZIZMOR_PRIVATE_KEY }}
56+
owner: ${{ matrix.repository.owner }}
57+
repositories: |
58+
${{ matrix.repository.repo }}
59+
60+
- name: Checkout Target
61+
uses: actions/checkout@v4
62+
with:
63+
repository: ${{ matrix.repository.owner }}/${{ matrix.repository.repo }}
64+
token: ${{ steps.get-token.outputs.token }}
65+
path: target
66+
67+
- name: Setup UV
68+
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
69+
with:
70+
enable-cache: true
71+
activate-environment: true
72+
cache-suffix: ${{ env.ZIZMOR_VERSION }}
73+
cache-dependency-glob: ""
74+
75+
- name: Run zizmor
76+
env:
77+
ZIZMOR_CACHE_DIR: ${{ runner.temp }}/.cache/zizmor
78+
REPOSITORY: ${{ matrix.repository.owner }}/${{ matrix.repository.repo }}
79+
GH_TOKEN: ${{ steps.get-token.outputs.token }}
80+
shell: sh
81+
run: >-
82+
uvx zizmor@"${ZIZMOR_VERSION}"
83+
--format sarif
84+
--min-severity "${MIN_SEVERITY}"
85+
--min-confidence "${MIN_CONFIDENCE}"
86+
--config .github/zizmor.yml
87+
./target
88+
> results.sarif
89+
90+
- name: Upload SARIF results
91+
uses: github/codeql-action/[email protected]
92+
with:
93+
sarif_file: ./results.sarif
94+
token: ${{ steps.get-token.outputs.token }}
95+
checkout_path: ./target

.github/zizmor.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
rules:
2+
unpinned-uses:
3+
config:
4+
policies:
5+
"*": hash-pin
6+
actions/*: any
7+
github/*: any
8+
grafana/*: any
9+
forbidden-uses:
10+
config:
11+
deny:
12+
# Policy-banned by our security team due to CVE-2025-30066 & CVE-2025-30154.
13+
# https://www.cisa.gov/news-events/alerts/2025/03/18/supply-chain-compromise-third-party-tj-actionschanged-files-cve-2025-30066-and-reviewdogaction
14+
# https://nvd.nist.gov/vuln/detail/cve-2025-30066
15+
# https://nvd.nist.gov/vuln/detail/cve-2025-30154
16+
- reviewdog/*

0 commit comments

Comments
 (0)