Skip to content

Commit 9b1db9f

Browse files
committed
Add permissions section to SBOM workflows for artifact uploads
1 parent 9f5d298 commit 9b1db9f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/SCA-Anchore-Syft-SBOM.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ env:
1111
imageName: "webapp01"
1212
tag: ${{ github.sha }}
1313

14+
permissions:
15+
contents: read
16+
id-token: write # required to upload artifacts
17+
1418
jobs:
1519
anchore-syft-Scan:
1620
name: Anchore Syft SBOM Scan
@@ -19,7 +23,6 @@ jobs:
1923

2024
permissions:
2125
contents: write # required to upload to the Dependency submission API
22-
actions: read # to find workflow artifacts when attaching release assets
2326

2427
steps:
2528
- name: Checkout code
@@ -29,7 +32,7 @@ jobs:
2932
run: docker build ./src/webapp01 --file ./src/webapp01/Dockerfile --tag ${{ env.imageName }}:${{ env.tag }}
3033

3134
- name: Scan the image and upload dependency results
32-
uses: anchore/sbom-action@v0
35+
uses: anchore/sbom-action@bb716408e75840bbb01e839347cd213767269d4a
3336
with:
3437
image: "${{ env.imageName }}:${{ env.tag }}"
3538
artifact-name: image.spdx.json

.github/workflows/SCA-Microsoft-SBOM.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ env:
1010
AZURE_WEBAPP_PACKAGE_PATH: './src' # set this to the path to your web app project, defaults to the repository root
1111
DOTNET_VERSION: '9.0.x' # set this to the dot net version to use
1212

13+
permissions:
14+
contents: read
15+
id-token: write # required to upload artifacts
16+
1317
jobs:
1418
build:
1519
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)