Skip to content

Commit 6c44fb9

Browse files
committed
ci(docker): multi-arch image, SBOM/provenance, Trivy scan
- Build linux/amd64 + linux/arm64 (pure CGO_ENABLED=0 Go, arm64 self-host is a real deploy target) via setup-qemu/buildx. - Attach max build provenance + SBOM attestations (id-token/attestations). - Scan the freshly built image by digest, failing on fixable HIGH/CRITICAL. - Add timeout-minutes to both jobs.
1 parent 601597a commit 6c44fb9

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/docker.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ concurrency:
1515
permissions:
1616
contents: read
1717
packages: write
18+
id-token: write # keyless build provenance attestation
19+
attestations: write
1820

1921
jobs:
2022
notify-guard:
2123
name: Notify Guard Tests
2224
runs-on: ubuntu-latest
25+
timeout-minutes: 10
2326
steps:
2427
- uses: actions/checkout@v4
2528

@@ -34,10 +37,15 @@ jobs:
3437
build-and-push:
3538
name: Build & Push
3639
runs-on: ubuntu-latest
40+
timeout-minutes: 20
3741
needs: notify-guard
3842
steps:
3943
- uses: actions/checkout@v4
4044

45+
- uses: docker/setup-qemu-action@v3
46+
47+
- uses: docker/setup-buildx-action@v3
48+
4149
- uses: docker/login-action@v3
4250
with:
4351
registry: ghcr.io
@@ -53,8 +61,23 @@ jobs:
5361
type=match,pattern=notify-v(.*),group=1
5462
5563
- uses: docker/build-push-action@v6
64+
id: build
5665
with:
5766
context: notify
5867
push: true
68+
platforms: linux/amd64,linux/arm64 # pure CGO_ENABLED=0 Go, arm64 self-host is a real target
5969
tags: ${{ steps.meta.outputs.tags }}
6070
labels: ${{ steps.meta.outputs.labels }}
71+
provenance: mode=max
72+
sbom: true
73+
74+
# Push-then-scan: a HIGH/CRITICAL fixable CVE in the alpine base turns the
75+
# run red so you know to bump the base. govulncheck (security.yml) covers
76+
# the Go layer; only Trivy sees the OS packages.
77+
- name: Scan published image
78+
uses: aquasecurity/trivy-action@v0.36.0
79+
with:
80+
image-ref: ghcr.io/psimaker/vaultsync-notify@${{ steps.build.outputs.digest }}
81+
severity: HIGH,CRITICAL
82+
ignore-unfixed: true
83+
exit-code: "1"

0 commit comments

Comments
 (0)