CI-hardening: move permissions to the job level
Instead of giving all jobs write permissions, default to no permissions and enable them on a per-job basis. This does not change anything for us, but avoids accidental write permissions if a new job gets added without considering that it inherits the top level permissions, even if it doesn't need them. See https://woodruffw.github.io/zizmor/audits/#excessive-permissions
This commit is contained in:
parent
7eed3d8bc1
commit
5bf958fd1b
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
@ -19,14 +19,16 @@ on:
|
||||
env:
|
||||
PYTHONUNBUFFERED: 1
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
|
||||
schedule:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency: autobuild-maint
|
||||
|
||||
outputs:
|
||||
@ -96,6 +98,9 @@ jobs:
|
||||
timeout-minutes: 4320
|
||||
needs: schedule
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency: autobuild-build-${{ matrix.name }}
|
||||
|
||||
if: ${{ needs.schedule.outputs.build-plan != '[]' }}
|
||||
|
||||
6
.github/workflows/maint.yml
vendored
6
.github/workflows/maint.yml
vendored
@ -19,8 +19,7 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
permissions: {}
|
||||
|
||||
concurrency: autobuild-maint
|
||||
|
||||
@ -29,6 +28,9 @@ jobs:
|
||||
schedule:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
|
||||
- name: Dump inputs
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user