Skip to content

Commit 9f5d298

Browse files
committed
Update workflow names for clarity and add new SBOM workflows for Anchore Syft and Microsoft SBOM Tool
1 parent 089ecd8 commit 9f5d298

File tree

4 files changed

+74
-2
lines changed

4 files changed

+74
-2
lines changed

.github/workflows/CIS-Anchore-Grype.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# https://github.com/anchore/grype
22
# https://github.com/anchore/scan-action
33

4-
name: Anchore Grype Vulnerability Scan (Container Image Scanning)
4+
name: CIS - Anchore Grype Vulnerability Scan (Container Image Scanning)
55

66
on:
77
push:

.github/workflows/CIS-Trivy-AquaSecurity.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://github.com/aquasecurity/trivy
33
# https://github.com/aquasecurity/trivy-action
44

5-
name: Trivy Container Image Scanning
5+
name: CIS - Trivy Container Image Scanning
66

77
on:
88
push:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# https://github.com/anchore/syft
2+
# https://github.com/anchore/sbom-action
3+
4+
name: CSA - Anchore Syft SBOM Scan
5+
6+
on:
7+
push:
8+
branches: [main]
9+
10+
env:
11+
imageName: "webapp01"
12+
tag: ${{ github.sha }}
13+
14+
jobs:
15+
anchore-syft-Scan:
16+
name: Anchore Syft SBOM Scan
17+
18+
runs-on: ubuntu-latest
19+
20+
permissions:
21+
contents: write # required to upload to the Dependency submission API
22+
actions: read # to find workflow artifacts when attaching release assets
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Build the Docker image
29+
run: docker build ./src/webapp01 --file ./src/webapp01/Dockerfile --tag ${{ env.imageName }}:${{ env.tag }}
30+
31+
- name: Scan the image and upload dependency results
32+
uses: anchore/sbom-action@v0
33+
with:
34+
image: "${{ env.imageName }}:${{ env.tag }}"
35+
artifact-name: image.spdx.json
36+
dependency-snapshot: true
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# https://github.com/microsoft/sbom-tool
2+
3+
name: SCA - Microsoft SBOM Tool
4+
5+
on:
6+
workflow_dispatch:
7+
8+
env:
9+
SRC_PROJECT_PATH: '/webapp01/webapp01.csproj'
10+
AZURE_WEBAPP_PACKAGE_PATH: './src' # set this to the path to your web app project, defaults to the repository root
11+
DOTNET_VERSION: '9.0.x' # set this to the dot net version to use
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Setup .NET Core
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: ${{ env.DOTNET_VERSION }}
22+
- name: dotnet build
23+
run: |
24+
dotnet restore ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}${{ env.SRC_PROJECT_PATH }}
25+
dotnet build --configuration Release ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}${{ env.SRC_PROJECT_PATH }} --output buildOutput
26+
27+
- name: Generate SBOM
28+
run: |
29+
curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64
30+
chmod +x $RUNNER_TEMP/sbom-tool
31+
$RUNNER_TEMP/sbom-tool generate -b ./buildOutput -bc . -pn Test -pv 1.0.0 -ps MyCompany -nsb https://sbom.mycompany.com -V Verbose
32+
33+
- name: Upload a Build Artifact
34+
uses: actions/upload-artifact@v4
35+
with:
36+
path: buildOutput

0 commit comments

Comments
 (0)