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 - labeled
- unlabeled - unlabeled
permissions:
contents: read
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true cancel-in-progress: true

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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