Skip to content

Commit 32bc50c

Browse files
DrewDennisonclaude
andcommitted
Pin base image digest, add OCI labels, verification docs, dependabot, CI tests, and release workflow
- Pin debian:bookworm-slim to specific digest for reproducible builds - Add OCI labels (source, description, licenses, vendor, title, url) - Add image verification section to README - Add dependabot for GitHub Actions and Docker base image updates - Add CI workflow to build all example Dockerfiles on PRs - Add release workflow to auto-generate release notes on tags Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d0734ef commit 32bc50c

File tree

5 files changed

+109
-1
lines changed

5 files changed

+109
-1
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
- package-ecosystem: docker
8+
directory: /
9+
schedule:
10+
interval: weekly

.github/workflows/release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Create release
20+
run: gh release create "${{ github.ref_name }}" --generate-notes
21+
env:
22+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Test Examples
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
build-examples:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
example:
14+
- examples/lockfiles/npm
15+
- examples/lockfiles/maven
16+
- examples/lockfiles/poetry
17+
- examples/lockfiles/uv
18+
- examples/lockfiles/pip
19+
- examples/lockfiles/gradle
20+
- examples/lockfiles/bazel
21+
- examples/sbom/npm
22+
- examples/sbom/maven
23+
- examples/sbom/poetry
24+
- examples/sbom/uv
25+
- examples/sbom/pip
26+
- examples/sbom/gradle
27+
- examples/sbom/bazel
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Set up QEMU
34+
uses: docker/setup-qemu-action@v3
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
38+
39+
- name: Build ${{ matrix.example }}
40+
uses: docker/build-push-action@v6
41+
with:
42+
context: ${{ matrix.example }}
43+
platforms: linux/amd64,linux/arm64
44+
push: false

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
FROM debian:bookworm-slim
1+
FROM debian:bookworm-slim@sha256:98f4b71de414932439ac6ac690d7060df1f27161073c5036a7553723881bffbe
2+
3+
LABEL org.opencontainers.image.source="https://github.com/semgrep/supply-chain-base-image"
4+
LABEL org.opencontainers.image.description="Base Docker image for generating lockfiles and SBOMs from source code"
5+
LABEL org.opencontainers.image.licenses="MIT"
6+
LABEL org.opencontainers.image.vendor="Semgrep"
7+
LABEL org.opencontainers.image.title="Supply Chain Base Image"
8+
LABEL org.opencontainers.image.url="https://github.com/semgrep/supply-chain-base-image"
29

310
ENV SEMGREP_WORKSPACE=/semgrep/workspace
411
ENV SEMGREP_OUTPUT=/semgrep/outputs

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,31 @@ COPY my-script.sh /usr/local/bin/
113113
CMD ["my-script.sh"]
114114
```
115115

116+
## Verifying the Image
117+
118+
Every image we publish is signed and includes [SLSA v1.0 Build L3](https://slsa.dev/) provenance and an embedded SBOM. You can verify that the image you pulled was built by our CI pipeline and hasn't been tampered with.
119+
120+
### Verify build provenance
121+
122+
Requires the [GitHub CLI](https://cli.github.com/):
123+
124+
```bash
125+
gh attestation verify oci://ghcr.io/semgrep/supply-chain-base-image:main \
126+
-R semgrep/supply-chain-base-image
127+
```
128+
129+
### Inspect the embedded SBOM and provenance
130+
131+
```bash
132+
# View provenance
133+
docker buildx imagetools inspect ghcr.io/semgrep/supply-chain-base-image:main \
134+
--format '{{ json .Provenance }}'
135+
136+
# View SBOM
137+
docker buildx imagetools inspect ghcr.io/semgrep/supply-chain-base-image:main \
138+
--format '{{ json .SBOM }}'
139+
```
140+
116141
## Building the Base Image Locally
117142

118143
If you want to build the base image yourself instead of pulling from the registry:

0 commit comments

Comments
 (0)