Skip to content

ci(sign-object): harden the image release (tags, labels, nonroot, provenance)#54

Open
entlein wants to merge 2 commits into
release/sbob-rc3from
fix/sign-object-release-v0.0.3
Open

ci(sign-object): harden the image release (tags, labels, nonroot, provenance)#54
entlein wants to merge 2 commits into
release/sbob-rc3from
fix/sign-object-release-v0.0.3

Conversation

@entlein

@entlein entlein commented Jul 7, 2026

Copy link
Copy Markdown

Hardens the sign-object image build to release best-practices, ahead of cutting v0.0.3 (referenced by the Bill-of-Behavior signing/tamper docs).

Dockerfile (cmd/sign-object/Dockerfile)

  • Base pinned by digest and switched to the nonroot distroless static variant (gcr.io/distroless/static-debian13:nonroot@sha256:963fa6c5…, UID 65532) — reproducible, non-root.
  • Build with -trimpath -ldflags="-s -w" (smaller, no local paths).
  • OCI labels: title, description, licenses=Apache-2.0, source.

Workflow (.github/workflows/sign-object.yaml)

  • Replace the ad-hoc tag step with docker/metadata-action (SHA-pinned): every image gets an immutable sha-<short> tag plus the workflow_dispatch version tag; latest only on the default branch.
  • Apply the OCI labels; enable provenance: true + sbom: true attestations.
  • Multi-arch (linux/amd64,linux/arm64) unchanged.

.dockerignore — trims the build context.

Already minimal (distroless static, static CGO-off binary) and Apache-2.0-licensed; this makes tagging immutable, labels the license on the image, drops root, and adds supply-chain attestation. The PR build (pull_request) validates the image without pushing.

…venance)

- Dockerfile: pin the distroless base by digest and use the nonroot variant
  (UID 65532); build with -trimpath -ldflags="-s -w"; add OCI labels
  (title, description, licenses=Apache-2.0, source).
- Workflow: replace the ad-hoc tag step with docker/metadata-action (SHA-pinned),
  emitting an immutable sha- tag plus the dispatch/version tag, with OCI labels;
  enable provenance + SBOM attestation.
- Add .dockerignore to trim the build context.
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3c555ed4-9440-4060-9420-a5e41074ed34

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sign-object-release-v0.0.3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.228 0.259 +13.6%
Peak CPU (cores) 0.288 0.289 +0.4%
Avg Memory (MiB) 306.887 261.970 -14.6%
Peak Memory (MiB) 308.348 267.828 -13.1%
Dedup Effectiveness

No data available.

Plain `docker run -v "$PWD:/work" …` failed with the nonroot distroless base
(permission denied writing to the host dir); users had to pass
`--user $(id -u):$(id -g)`. Switch to a small alpine base + su-exec entrypoint
that detects the bind-mounted /work owner and drops to it, so files are written
user-owned with no flag. sign-object still never runs as root when a non-root
/work is mounted.
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.231 0.231 -0.4%
Peak CPU (cores) 0.245 0.242 -1.1%
Avg Memory (MiB) 280.761 269.287 -4.1%
Peak Memory (MiB) 283.949 271.598 -4.3%
Dedup Effectiveness

No data available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant