File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
workflows/check-vulnerabilities Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Check Vulnerabilities
2
+
3
+ on :
4
+ workflow_call :
5
+ inputs :
6
+ image :
7
+ description : Image to check
8
+ required : true
9
+ type : string
10
+ runs_on :
11
+ default : " [ubuntu-latest]"
12
+ description : Runner specification
13
+ required : false
14
+ type : string
15
+
16
+ jobs :
17
+ check-vulnerabilities :
18
+ runs-on : " ${{ inputs.runs_on}}"
19
+ steps :
20
+ - name : Install Cosign
21
+ uses : sigstore/cosign-installer@main
22
+ with :
23
+ cosign-release : ' v1.13.1'
24
+ - name : Check install!
25
+ run : cosign version
26
+ - name : Verify container
27
+ run : |
28
+ COSIGN_EXPERIMENTAL=1 cosign verify ${{ inputs.image }}
29
+ - name : Get SBOM
30
+ id : spdx
31
+ run : |
32
+ echo "spdx=$(COSIGN_EXPERIMENTAL=1 cosign verify-attestation --type spdx ${{ inputs.image }} | jq '.payload |= @base64d | .payload | fromjson | select( .predicateType=="https://spdx.dev/Document" ) | .predicate.Data | fromjson | .') >> $GITHUB_OUTPUT
33
+ - name : Scan image
34
+ uses : anchore/scan-action@v3
35
+ with :
36
+ sbom : ${{ steps.spdx.outputs.spdx }}
37
+ fail-build : true
38
+ severity-cutoff : critical
You can’t perform that action at this time.
0 commit comments