File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010permissions :
1111 contents : read
1212 packages : write
13+ id-token : write
1314
1415env :
1516 IMAGE_NAME : astrum-agent-runtime
@@ -64,12 +65,15 @@ jobs:
6465 - name : Verify runtime
6566 run : docker run --rm "${{ steps.meta.outputs.image }}:verify" verify-runtime
6667
67- - name : Push verified image
68+ - name : Push verified image with attestations
69+ id : push
6870 uses : docker/build-push-action@v6
6971 with :
7072 context : .
7173 file : ./Dockerfile
7274 push : true
75+ provenance : mode=max
76+ sbom : true
7377 tags : |
7478 ${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.tag }}
7579 ${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.latest }}
8185 org.opencontainers.image.version=${{ steps.meta.outputs.tag }}
8286 cache-from : type=gha
8387 cache-to : type=gha,mode=max
88+
89+ - name : Install cosign
90+ uses : sigstore/cosign-installer@v3.8.1
91+ with :
92+ cosign-release : ' v2.4.3'
93+
94+ - name : Sign image with cosign
95+ env :
96+ COSIGN_YES : true
97+ run : |
98+ cosign sign "${{ steps.meta.outputs.image }}@${{ steps.push.outputs.digest }}"
Original file line number Diff line number Diff line change 99
1010permissions :
1111 contents : read
12+ security-events : write
1213
1314env :
1415 IMAGE_NAME : astrum-agent-runtime
1516
1617jobs :
17- verify :
18- name : Build and verify image
18+ lint :
19+ name : Lint Dockerfile
1920 runs-on : ubuntu-24.04
21+ steps :
22+ - name : Checkout
23+ uses : actions/checkout@v4
24+
25+ - name : Run hadolint
26+ uses : hadolint/hadolint-action@v3.1.0
27+ with :
28+ dockerfile : Dockerfile
29+ format : sarif
30+ output-file : hadolint-results.sarif
31+ no-fail : true
32+
33+ - name : Upload hadolint results to GitHub Security
34+ uses : github/codeql-action/upload-sarif@v3
35+ with :
36+ sarif_file : hadolint-results.sarif
37+ category : hadolint
2038
39+ scan :
40+ name : Build and scan image
41+ runs-on : ubuntu-24.04
2142 steps :
2243 - name : Checkout
2344 uses : actions/checkout@v4
3758
3859 - name : Verify runtime
3960 run : docker run --rm "${{ env.IMAGE_NAME }}:pr-${{ github.event.number }}" verify-runtime
61+
62+ - name : Run Trivy vulnerability scanner
63+ uses : aquasecurity/trivy-action@v0.36.0
64+ with :
65+ image-ref : ${{ env.IMAGE_NAME }}:pr-${{ github.event.number }}
66+ format : sarif
67+ output : trivy-results.sarif
68+ severity : HIGH,CRITICAL
69+
70+ - name : Upload Trivy results to GitHub Security
71+ if : always()
72+ uses : github/codeql-action/upload-sarif@v3
73+ with :
74+ sarif_file : trivy-results.sarif
75+ category : trivy
You can’t perform that action at this time.
0 commit comments