Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define permissions following the principle of least privilege #2676

Merged
merged 17 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/image-arm-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- '**'

permissions: read-all
concurrency:
group: ci-arm-${{ github.head_ref || github.ref }}-${{ github.repository }}
cancel-in-progress: true
Expand All @@ -14,6 +15,21 @@ env:
jobs:
opensuse:
uses: ./.github/workflows/reusable-docker-arm-build.yaml
permissions:
id-token: write # OIDC support
contents: write
security-events: write
actions: read
attestations: read
checks: read
deployments: read
discussions: read
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
statuses: read
with:
flavor: opensuse
flavor_release: leap-15.6
Expand All @@ -23,6 +39,21 @@ jobs:
worker: fast
alpine:
uses: ./.github/workflows/reusable-docker-arm-build.yaml
permissions:
id-token: write # OIDC support
contents: write
security-events: write
actions: read
attestations: read
checks: read
deployments: read
discussions: read
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
statuses: read
with:
flavor: alpine
flavor_release: "3.19"
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/image-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master

permissions: read-all
concurrency:
group: ci-arm-${{ github.head_ref || github.ref }}-${{ github.repository }}
cancel-in-progress: true
Expand Down Expand Up @@ -169,6 +170,21 @@ jobs:

nvidia-arm-core:
uses: ./.github/workflows/reusable-docker-arm-build.yaml
permissions:
id-token: write # OIDC support
contents: write
security-events: write
actions: read
attestations: read
checks: read
deployments: read
discussions: read
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
statuses: read
needs: build-nvidia-base
secrets: inherit
with:
Expand All @@ -181,6 +197,21 @@ jobs:

build-arm-core:
uses: ./.github/workflows/reusable-docker-arm-build.yaml
permissions:
id-token: write # OIDC support
contents: write
security-events: write
actions: read
attestations: read
checks: read
deployments: read
discussions: read
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
statuses: read
secrets: inherit
with:
flavor: ${{ matrix.flavor }}
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/image-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
paths:
- '**'

permissions: read-all
concurrency:
group: ci-image-${{ github.head_ref || github.ref }}-${{ github.repository }}
cancel-in-progress: true
Expand All @@ -12,6 +13,21 @@ env:
jobs:
core-ubuntu-22-lts:
uses: ./.github/workflows/reusable-build-flavor.yaml
permissions:
contents: write
security-events: write
id-token: write
actions: read
attestations: read
checks: read
deployments: read
discussions: read
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
statuses: read
with:
flavor: ubuntu
flavor_release: "22.04"
Expand All @@ -23,6 +39,21 @@ jobs:

core-ubuntu-24-lts:
uses: ./.github/workflows/reusable-build-flavor.yaml
permissions:
contents: write
security-events: write
id-token: write
actions: read
attestations: read
checks: read
deployments: read
discussions: read
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
statuses: read
with:
flavor: ubuntu
flavor_release: "24.04"
Expand All @@ -34,6 +65,21 @@ jobs:

core-alpine:
uses: ./.github/workflows/reusable-build-flavor.yaml
permissions:
contents: write
security-events: write
id-token: write
actions: read
attestations: read
checks: read
deployments: read
discussions: read
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
statuses: read
with:
flavor: alpine
flavor_release: "3.19"
Expand All @@ -45,6 +91,21 @@ jobs:

standard:
uses: ./.github/workflows/reusable-build-provider.yaml
permissions:
id-token: write # OIDC support
contents: write
security-events: write
actions: read
attestations: read
checks: read
deployments: read
discussions: read
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
statuses: read
with:
flavor: opensuse
flavor_release: "leap-15.6"
Expand Down Expand Up @@ -189,6 +250,21 @@ jobs:

custom-partitioning:
uses: ./.github/workflows/reusable-custom-partitioning-test.yaml
permissions:
id-token: write # OIDC support
contents: write
security-events: write
actions: read
attestations: read
checks: read
deployments: read
discussions: read
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
statuses: read
with:
flavor: ${{ matrix.flavor }}
flavor_release: ${{ matrix.flavorRelease }}
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- '**'

permissions: read-all
concurrency:
group: ci-image-${{ github.head_ref || github.ref }}-${{ github.repository }}
cancel-in-progress: true
Expand Down Expand Up @@ -35,6 +36,21 @@ jobs:
echo "::set-output name=matrix::{\"include\": $content }"
core:
uses: ./.github/workflows/reusable-build-flavor.yaml
permissions:
id-token: write # OIDC support
contents: write
security-events: write
actions: read
attestations: read
checks: read
deployments: read
discussions: read
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
statuses: read
secrets: inherit
with:
flavor: ${{ matrix.flavor }}
Expand Down Expand Up @@ -267,6 +283,21 @@ jobs:
- "leap-15.6"
standard:
uses: ./.github/workflows/reusable-build-provider.yaml
permissions:
id-token: write # OIDC support
contents: write
security-events: write
actions: read
attestations: read
checks: read
deployments: read
discussions: read
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
statuses: read
secrets: inherit
with:
flavor: ${{ matrix.flavor }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
paths:
- '**'
permissions: read-all
env:
FORCE_COLOR: 1
jobs:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/release-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
tags:
- 'v*'
permissions: read-all
jobs:
get-core-matrix:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -141,6 +142,21 @@ jobs:

nvidia-arm-core:
uses: ./.github/workflows/reusable-docker-arm-build.yaml
permissions:
id-token: write # OIDC support
contents: write
security-events: write
actions: read
attestations: read
checks: read
deployments: read
discussions: read
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
statuses: read
needs: build-nvidia-base
secrets: inherit
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
tags:
- v*

permissions: read-all
jobs:
get-core-matrix:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-build-flavor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
required: true
type: string

permissions: read-all
jobs:
build:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-build-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
required: true
type: string

permissions: read-all
jobs:
build:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-custom-partitioning-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
required: true
type: string

permissions: read-all
jobs:
test:
runs-on: fast
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-docker-arm-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ on:
required: true
type: string

permissions: read-all
jobs:
build:
runs-on: ${{ inputs.worker }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-encryption-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
required: true
type: string

permissions: read-all
jobs:
test:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-image-and-iso-arm-generic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ on:
required: true
type: string

permissions: read-all
jobs:
build:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-install-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
required: false
type: boolean

permissions: read-all
jobs:
test:
runs-on: kvm
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-provider-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
required: true
type: string

permissions: read-all
jobs:
test:
runs-on: fast
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
required: false
type: string

permissions: read-all
jobs:
test:
runs-on: kvm
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-qemu-acceptance-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
required: false
type: string

permissions: read-all
jobs:
test:
runs-on: ubuntu-latest
Expand Down
Loading
Loading