Skip to content

Commit 903a762

Browse files
authored
Merge pull request #414 from coreruleset/fix/harden-gha-workflows
fix: harden GitHub Actions workflows
2 parents 57f51f5 + 056020b commit 903a762

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on: # yamllint disable-line rule:truthy
88
paths:
99
- 'README-containers.md'
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
build:
1316
runs-on: ubuntu-latest

.github/workflows/publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@ on:
44
release:
55
types: [published]
66

7+
permissions: {}
8+
79
jobs:
810
prepare:
911
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
1014
outputs:
1115
matrix: ${{ steps.generate.outputs.matrix }}
1216
steps:
1317
- name: Checkout
1418
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # actions/checkout@v5
1519
- name: List targets
1620
id: generate
17-
uses: docker/bake-action/subaction/matrix@v6
21+
uses: docker/bake-action/subaction/matrix@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6
1822
with:
1923
target: default
2024

.github/workflows/verifyimage.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request:
55
branches:
66
- main
7+
8+
permissions:
9+
contents: read
10+
711
env:
812
# sha256sum format: <hash><space><format (space for text)><file name>
913
MODSECURITY_RECOMMENDED: "ccff8ba1f12428b34ff41960d8bf773dd9f62b9a7c77755247a027cb01896d4f modsecurity.conf-recommended"
@@ -19,7 +23,7 @@ jobs:
1923
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # actions/checkout@v5
2024
- name: Generate matrix
2125
id: generate
22-
uses: docker/bake-action/subaction/matrix@v6
26+
uses: docker/bake-action/subaction/matrix@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6
2327
with:
2428
target: default
2529
- name: Check modsecurity recommended
@@ -30,6 +34,9 @@ jobs:
3034
3135
build:
3236
runs-on: ubuntu-latest
37+
permissions:
38+
contents: read
39+
packages: write
3340
needs:
3441
- prepare
3542
strategy:

0 commit comments

Comments
 (0)