Skip to content

Commit 6a7dcec

Browse files
authored
Add zizmor security analysis + dependabot cooldown (#165)
* Add zizmor GitHub Actions security analysis + dependabot cooldown * Harden existing workflows to pass zizmor (pedantic) Pin actions to commit SHAs (latest releases), add concurrency limits, and set persist-credentials: false on read-only checkouts.
1 parent 88787b8 commit 6a7dcec

6 files changed

Lines changed: 72 additions & 11 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "monthly"
8+
cooldown:
9+
default-days: 7

.github/workflows/continuous-integration.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
permissions:
1010
contents: read
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
tests:
1418
name: CI
@@ -41,14 +45,16 @@ jobs:
4145
experimental: true
4246

4347
steps:
44-
- uses: actions/checkout@v6
48+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
49+
with:
50+
persist-credentials: false
4551

46-
- uses: shivammathur/setup-php@v2
52+
- uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
4753
with:
4854
php-version: "${{ matrix.php-version }}"
4955
coverage: none
5056

51-
- uses: ramsey/composer-install@v4
57+
- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
5258
with:
5359
dependency-versions: highest
5460

.github/workflows/functional.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
permissions:
1010
contents: read
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
tests:
1418
name: Functional Tests
@@ -35,14 +39,16 @@ jobs:
3539
experimental: true
3640

3741
steps:
38-
- uses: actions/checkout@v6
42+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
43+
with:
44+
persist-credentials: false
3945

40-
- uses: shivammathur/setup-php@v2
46+
- uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
4147
with:
4248
php-version: "${{ matrix.php-version }}"
4349
coverage: xdebug
4450

45-
- uses: ramsey/composer-install@v4
51+
- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
4652
with:
4753
dependency-versions: highest
4854

.github/workflows/lint.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
permissions:
1010
contents: read
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
tests:
1418
name: "Lint"
@@ -22,9 +26,11 @@ jobs:
2226
- "nightly"
2327

2428
steps:
25-
- uses: actions/checkout@v6
29+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
with:
31+
persist-credentials: false
2632

27-
- uses: shivammathur/setup-php@v2
33+
- uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
2834
with:
2935
php-version: "${{ matrix.php-version }}"
3036
coverage: none

.github/workflows/phpstan.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
permissions:
1010
contents: read
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
tests:
1418
name: PHPStan
@@ -21,14 +25,16 @@ jobs:
2125
- "8.1"
2226

2327
steps:
24-
- uses: actions/checkout@v6
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
with:
30+
persist-credentials: false
2531

26-
- uses: shivammathur/setup-php@v2
32+
- uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
2733
with:
2834
php-version: "${{ matrix.php-version }}"
2935
coverage: none
3036

31-
- uses: ramsey/composer-install@v4
37+
- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
3238
with:
3339
dependency-versions: highest
3440

.github/workflows/zizmor.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: GitHub Actions Security Analysis with zizmor 🌈
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '.github/**.yml'
9+
pull_request:
10+
paths:
11+
- '.github/**.yml'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
zizmor:
22+
name: Run zizmor 🌈
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+
with:
28+
persist-credentials: false
29+
30+
- name: Run zizmor 🌈
31+
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
32+
with:
33+
advanced-security: false
34+
annotations: true
35+
persona: 'pedantic'

0 commit comments

Comments
 (0)