File tree Expand file tree Collapse file tree 4 files changed +81
-2
lines changed Expand file tree Collapse file tree 4 files changed +81
-2
lines changed Original file line number Diff line number Diff line change 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
66on :
77 push :
Original file line number Diff line number Diff line change 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
77on :
88 push :
Original file line number Diff line number Diff line change 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+ permissions :
15+ contents : read
16+ id-token : write # required to upload artifacts
17+
18+ jobs :
19+ anchore-syft-Scan :
20+ name : Anchore Syft SBOM Scan
21+
22+ runs-on : ubuntu-latest
23+
24+ permissions :
25+ contents : write # required to upload to the Dependency submission API
26+
27+ steps :
28+ - name : Checkout code
29+ uses : actions/checkout@v4
30+
31+ - name : Build the Docker image
32+ run : docker build ./src/webapp01 --file ./src/webapp01/Dockerfile --tag ${{ env.imageName }}:${{ env.tag }}
33+
34+ - name : Scan the image and upload dependency results
35+ uses : anchore/sbom-action@bb716408e75840bbb01e839347cd213767269d4a
36+ with :
37+ image : " ${{ env.imageName }}:${{ env.tag }}"
38+ artifact-name : image.spdx.json
39+ dependency-snapshot : true
Original file line number Diff line number Diff line change 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+ permissions :
14+ contents : read
15+ id-token : write # required to upload artifacts
16+
17+ jobs :
18+ build :
19+ runs-on : ubuntu-latest
20+ steps :
21+ - uses : actions/checkout@v4
22+ - name : Setup .NET Core
23+ uses : actions/setup-dotnet@v4
24+ with :
25+ dotnet-version : ${{ env.DOTNET_VERSION }}
26+ - name : dotnet build
27+ run : |
28+ dotnet restore ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}${{ env.SRC_PROJECT_PATH }}
29+ dotnet build --configuration Release ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}${{ env.SRC_PROJECT_PATH }} --output buildOutput
30+
31+ - name : Generate SBOM
32+ run : |
33+ curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64
34+ chmod +x $RUNNER_TEMP/sbom-tool
35+ $RUNNER_TEMP/sbom-tool generate -b ./buildOutput -bc . -pn Test -pv 1.0.0 -ps MyCompany -nsb https://sbom.mycompany.com -V Verbose
36+
37+ - name : Upload a Build Artifact
38+ uses : actions/upload-artifact@v4
39+ with :
40+ path : buildOutput
You can’t perform that action at this time.
0 commit comments