Skip to content

Commit

Permalink
.github: workflows: restrict top-level workflow permissions
Browse files Browse the repository at this point in the history
Only permit reading the repository contents by default, and set further
privileges at the job level to satisfy OpenSSF Scorecard criteria.

Link: https://github.com/ossf/scorecard/blob/9ff40de429d0c7710076070387c8755494a9f187/docs/checks.md#token-permissions
Link: https://securityscorecards.dev/viewer/?uri=github.com/OFS/linux-dfl-backport
Signed-off-by: Peter Colberg <peter.colberg@intel.com>
  • Loading branch information
pcolberg committed Sep 18, 2024
1 parent cb86311 commit 5ada08e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Build kernel development containers

# https://github.com/ossf/scorecard/blob/9ff40de429d0c7710076070387c8755494a9f187/docs/checks.md#token-permissions
permissions:
packages: write
contents: read

on:
push:
Expand All @@ -25,6 +26,9 @@ on:

jobs:
container:
permissions:
packages: write

runs-on: ubuntu-latest

strategy:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/dkms.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build dkms packages

# https://github.com/ossf/scorecard/blob/9ff40de429d0c7710076070387c8755494a9f187/docs/checks.md#token-permissions
permissions:
contents: read

on:
push:
branches:
Expand Down Expand Up @@ -30,6 +34,9 @@ on:

jobs:
dkms:
permissions:
packages: read

runs-on: ubuntu-latest

strategy:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/modules.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build and install modules

# https://github.com/ossf/scorecard/blob/9ff40de429d0c7710076070387c8755494a9f187/docs/checks.md#token-permissions
permissions:
contents: read

on:
push:
branches:
Expand Down Expand Up @@ -30,6 +34,9 @@ on:

jobs:
modules:
permissions:
packages: read

runs-on: ubuntu-latest

strategy:
Expand Down

0 comments on commit 5ada08e

Please sign in to comment.