Skip to content

Commit 4f9fdfa

Browse files
vdemeestertekton-robot
authored andcommitted
ci: fix remaining zizmor findings and add zizmor CI check
- Scope checks: write to linting job instead of workflow level in ci.yaml - Add permissions: {} at workflow level for bump-payload-on-main, bump-payload-on-releases, and slash workflows - Scope job-level permissions for bump-payload jobs (contents: write, pull-requests: write) - Add zizmor GitHub Actions security analysis workflow Resolves all high/low/info zizmor findings. Only secrets-outside-env (medium, requires GitHub environment setup) and secrets-inherit (chatops_retest, needs plumbing changes) remain. Related: #3300 Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
1 parent 5e5f323 commit 4f9fdfa

File tree

5 files changed

+39
-1
lines changed

5 files changed

+39
-1
lines changed

.github/workflows/bump-payload-on-main.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ on: # yamllint disable-line rule:truthy
66
# Run this every week day at 1AM
77
- cron: '0 1 * * 1-5'
88

9+
permissions: {}
10+
911
jobs:
1012
bump-payloads:
1113
name: "Bump payloads"
1214
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
pull-requests: write
1318
if: github.repository_owner == 'tektoncd' # do not run this elsewhere
1419
steps:
1520
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/bump-payload-on-releases.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ on: # yamllint disable-line rule:truthy
66
# Run this every week day at 2AM
77
- cron: '0 2 * * 1-5'
88

9+
permissions: {}
10+
911
jobs:
1012
build-release-matrix:
1113
runs-on: ubuntu-latest
14+
permissions: {}
1215
if: github.repository_owner == 'tektoncd' # do not run this elsewhere
1316
steps:
1417
- id: set-matrix
@@ -21,6 +24,9 @@ jobs:
2124
bump-payloads:
2225
needs: build-release-matrix
2326
runs-on: ubuntu-latest
27+
permissions:
28+
contents: write
29+
pull-requests: write
2430
strategy:
2531
matrix:
2632
branch: ${{ fromJSON(needs.build-release-matrix.outputs.branches) }}

.github/workflows/ci.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ defaults:
1616

1717
permissions:
1818
contents: read
19-
checks: write # Used to annotate code in the PR
2019

2120
jobs:
2221
changes:
@@ -84,6 +83,9 @@ jobs:
8483
needs: [changes]
8584
name: lint
8685
runs-on: ubuntu-latest
86+
permissions:
87+
contents: read
88+
checks: write # Used to annotate code in the PR
8789
steps:
8890
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8991
with:

.github/workflows/slash.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ on:
2323
types:
2424
- created
2525

26+
permissions: {}
27+
2628
jobs:
2729
check_comments:
2830
runs-on: ubuntu-latest

.github/workflows/zizmor.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: GitHub Actions Security Analysis with zizmor
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["**"]
8+
9+
permissions: {}
10+
11+
jobs:
12+
zizmor:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
security-events: write
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
with:
20+
persist-credentials: false
21+
22+
- name: Run zizmor
23+
uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2

0 commit comments

Comments
 (0)