Skip to content

Commit 070ef54

Browse files
committed
ci(security): reduce the workflow permissions to read-all
By default all the workflows should have read-all permissions and any extra permission required should be added explicitly per job. Closes #84 Signed-off-by: Jonathan Gonzalez V. <[email protected]>
1 parent 84f77b9 commit 070ef54

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

.github/workflows/build-commitfest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ defaults:
1515
# default failure handling for shell scripts in 'run' steps
1616
shell: 'bash -Eeuo pipefail -x {0}'
1717

18+
permissions: read-all
19+
1820
jobs:
1921
build-pg:
2022
name: Build the patch for PostgreSQL

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ defaults:
2020
# default failure handling for shell scripts in 'run' steps
2121
shell: 'bash -Eeuo pipefail -x {0}'
2222

23+
permissions: read-all
24+
2325
jobs:
2426
build-pg:
2527
name: Build generic PostgreSQL image from sources

.github/workflows/continuous-delivery.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ defaults:
1919
# default failure handling for shell scripts in 'run' steps
2020
shell: 'bash -Eeuo pipefail -x {0}'
2121

22+
permissions: read-all
23+
2224
jobs:
2325
build-pg:
2426
name: Build the Trunk of PostgreSQL

.github/workflows/reusable-e2e.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ defaults:
3737
# default failure handling for shell scripts in 'run' steps
3838
shell: 'bash -Eeuo pipefail -x {0}'
3939

40+
permissions: read-all
41+
4042
jobs:
4143
e2e-local:
4244
name: Run E2E on local executors
4345
runs-on: ubuntu-24.04
46+
permissions:
47+
packages: write
4448
env:
4549
TEST_DEPTH: ${{ inputs.test_depth }}
4650
FEATURE_TYPE: ${{ inputs.feature_type }}

.github/workflows/run-e2e-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ on:
1919
description: 'E2E feature type filter. See https://github.com/cloudnative-pg/cloudnative-pg/blob/main/contribute/e2e_testing_environment/README.md#using-feature-type-test-selectionfilter'
2020
required: false
2121

22+
permissions: read-all
23+
2224
jobs:
2325
evaluate-env:
2426
name: Evaluate input env variables
@@ -62,6 +64,8 @@ jobs:
6264
needs:
6365
- evaluate-env
6466
uses: ./.github/workflows/reusable-e2e.yml
67+
permissions:
68+
packages: write
6569
with:
6670
postgres_img: ${{ needs.evaluate-env.outputs.pg_image }}
6771
major_version: ${{ needs.evaluate-env.outputs.pg_major }}

0 commit comments

Comments
 (0)