workflow: Add top-level permissions

Set:
```
permissions:
  contents: read
```
as the default top-level permissions explicitly
to conform to recommended security practices e.g.
https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
This commit is contained in:
stevenhorsman 2025-05-28 15:05:52 +01:00
parent 353d0822fd
commit 088e97075c
53 changed files with 161 additions and 0 deletions

View File

@ -9,6 +9,9 @@ on:
- labeled
- unlabeled
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

View File

@ -11,6 +11,9 @@ on:
paths:
- '.github/workflows/**'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

View File

@ -13,6 +13,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
run-cri-containerd:
strategy:

View File

@ -13,6 +13,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
run-cri-containerd:
strategy:

View File

@ -12,6 +12,9 @@ on:
required: true
type: string
permissions:
contents: read
name: Build checks preview riscv64
jobs:
check:

View File

@ -5,6 +5,9 @@ on:
required: true
type: string
permissions:
contents: read
name: Build checks
jobs:
check:

View File

@ -21,6 +21,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
build-asset:
runs-on: ubuntu-22.04

View File

@ -21,6 +21,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
build-asset:
runs-on: ubuntu-22.04-arm

View File

@ -21,6 +21,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
build-asset:
permissions:

View File

@ -21,6 +21,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
build-asset:
runs-on: riscv-builder

View File

@ -21,6 +21,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
build-asset:
runs-on: s390x

View File

@ -11,6 +11,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
cargo-deny-runner:
runs-on: ubuntu-22.04

View File

@ -8,6 +8,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
kata-containers-ci-on-push:
permissions:

View File

@ -2,6 +2,9 @@ name: Kata Containers CI (manually triggered)
on:
workflow_dispatch:
permissions:
contents: read
jobs:
kata-containers-ci-on-push:
permissions:

View File

@ -3,6 +3,10 @@ on:
- cron: '0 5 * * *'
name: Nightly CI for s390x
permissions:
contents: read
jobs:
check-internal-test-result:
runs-on: s390x

View File

@ -7,6 +7,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
kata-containers-ci-on-push:
permissions:

View File

@ -14,6 +14,9 @@ on:
- reopened
- labeled
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

View File

@ -16,6 +16,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
build-kata-static-tarball-amd64:
uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml

View File

@ -20,6 +20,9 @@ on:
type: string
default: no
permissions:
contents: read
jobs:
build-kata-static-tarball-amd64:
uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml

View File

@ -4,6 +4,9 @@ on:
- cron: "0 0 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
cleanup-resources:
runs-on: ubuntu-22.04

View File

@ -19,6 +19,9 @@ on:
schedule:
- cron: '45 0 * * 1'
permissions:
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})

View File

@ -6,6 +6,9 @@ on:
- reopened
- synchronize
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

View File

@ -6,6 +6,9 @@ on:
- reopened
- synchronize
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

View File

@ -2,6 +2,9 @@ on:
schedule:
- cron: '0 23 * * 0'
permissions:
contents: read
name: Docs URL Alive Check
jobs:
test:

View File

@ -31,6 +31,8 @@ on:
skip_static:
value: ${{ jobs.skipper.outputs.skip_static }}
permissions:
contents: read
jobs:
skipper:

View File

@ -12,6 +12,9 @@ on:
- reopened
- labeled
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

View File

@ -6,6 +6,9 @@ on:
- reopened
- synchronize
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

View File

@ -5,6 +5,9 @@ on:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

View File

@ -31,6 +31,9 @@ on:
required: true
type: string
permissions:
contents: read
jobs:
kata-payload:
runs-on: ${{ inputs.runner }}

View File

@ -6,6 +6,9 @@ on:
required: true
type: string
permissions:
contents: read
jobs:
build-kata-static-tarball-amd64:
uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml

View File

@ -6,6 +6,9 @@ on:
required: true
type: string
permissions:
contents: read
jobs:
build-kata-static-tarball-arm64:
uses: ./.github/workflows/build-kata-static-tarball-arm64.yaml

View File

@ -6,6 +6,9 @@ on:
required: true
type: string
permissions:
contents: read
jobs:
build-kata-static-tarball-ppc64le:
uses: ./.github/workflows/build-kata-static-tarball-ppc64le.yaml

View File

@ -6,6 +6,9 @@ on:
required: true
type: string
permissions:
contents: read
jobs:
build-kata-static-tarball-s390x:
uses: ./.github/workflows/build-kata-static-tarball-s390x.yaml

View File

@ -2,6 +2,9 @@ name: Release Kata Containers
on:
workflow_dispatch
permissions:
contents: read
jobs:
release:
runs-on: ubuntu-22.04

View File

@ -1,4 +1,8 @@
name: CI | Run cri-containerd tests on ppc64le
permissions:
contents: read
on:
workflow_call:
inputs:

View File

@ -25,6 +25,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
run-k8s-tests:
strategy:

View File

@ -22,6 +22,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
run-k8s-tests-amd64:
strategy:

View File

@ -22,6 +22,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
run-k8s-tests-on-arm64:
strategy:

View File

@ -22,6 +22,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
run-k8s-tests:
strategy:

View File

@ -22,6 +22,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
run-k8s-tests:
strategy:

View File

@ -25,6 +25,9 @@ on:
required: false
type: string
permissions:
contents: read
jobs:
# Generate jobs for testing CoCo on non-TEE environments
run-stability-k8s-tests-coco-nontee:

View File

@ -25,6 +25,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
run-k8s-tests-on-tdx:
strategy:

View File

@ -22,6 +22,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
run-kata-deploy-tests:
strategy:

View File

@ -22,6 +22,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
run-kata-deploy-tests:
strategy:

View File

@ -13,6 +13,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
run-monitor:
strategy:

View File

@ -22,6 +22,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
run-metrics:
strategy:

View File

@ -13,6 +13,9 @@ on:
type: string
default: ""
permissions:
contents: read
jobs:
run-runk:
# Skip runk tests as we have no maintainers. TODO: Decide when to remove altogether

View File

@ -10,6 +10,9 @@ on:
- reopened
- synchronize
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

View File

@ -11,6 +11,9 @@ on:
- reopened
- synchronize
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

View File

@ -4,6 +4,9 @@ on:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
stale:
runs-on: ubuntu-22.04

View File

@ -6,6 +6,9 @@ on:
- reopened
- labeled # a workflow runs only when the 'ok-to-test' label is added
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

View File

@ -6,6 +6,9 @@ on:
- reopened
- synchronize
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

View File

@ -1,5 +1,9 @@
on: ["pull_request"]
name: Unit tests
permissions:
contents: read
jobs:
test:
strategy: