forked from repo-mirrors/cnpg-postgres-containers
ci(security): reduce workflow permissions (#207)
By default, set all the workflow permissions to read-all, then provide permissions one by one to each job requiring more permissions. Closes #206 Signed-off-by: Jonathan Gonzalez V <jonathan.gonzalez@enterprisedb.com> Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
This commit is contained in:
committed by
GitHub
parent
037a5d142f
commit
5c35abd07e
2
.github/workflows/bake.yaml
vendored
2
.github/workflows/bake.yaml
vendored
@@ -17,6 +17,8 @@ on:
|
|||||||
default: ""
|
default: ""
|
||||||
description: "A comma separated list of targets to build. If empty, all targets will be built."
|
description: "A comma separated list of targets to build. If empty, all targets will be built."
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Start by building images for testing. We want to run security checks before pushing those to production.
|
# Start by building images for testing. We want to run security checks before pushing those to production.
|
||||||
testbuild:
|
testbuild:
|
||||||
|
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -8,6 +8,8 @@ on:
|
|||||||
- Debian/ClusterImageCatalog*.yaml
|
- Debian/ClusterImageCatalog*.yaml
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_STAGING: "ghcr.io/${{ github.repository_owner }}/postgresql-testing"
|
IMAGE_STAGING: "ghcr.io/${{ github.repository_owner }}/postgresql-testing"
|
||||||
IMAGE_RELEASE: "ghcr.io/${{ github.repository_owner }}/postgresql"
|
IMAGE_RELEASE: "ghcr.io/${{ github.repository_owner }}/postgresql"
|
||||||
@@ -179,6 +181,8 @@ jobs:
|
|||||||
name: Generate ClusterImageCatalog
|
name: Generate ClusterImageCatalog
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
needs: build
|
needs: build
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
|
2
.github/workflows/update.yml
vendored
2
.github/workflows/update.yml
vendored
@@ -9,6 +9,8 @@ defaults:
|
|||||||
run:
|
run:
|
||||||
shell: 'bash -Eeuo pipefail -x {0}'
|
shell: 'bash -Eeuo pipefail -x {0}'
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Run update script
|
name: Run update script
|
||||||
|
Reference in New Issue
Block a user