List the Rust crates in release SBOMs; check GHCR signatures (K-S7) #493

Merged
jcoffey-dev merged 1 commits from feat/sbom-crates into main 2026-11-19 23:08:25 +00:00
3 changed files with 18 additions and 8 deletions

No files matched your search

+7 -6
View File
@@ -162,18 +162,19 @@ jobs:
run: |
set -euo pipefail
sign() { echo "signing $1"; cosign sign --yes "$1"; }
SIGNED_GHCR=()
sign "$SERVER"
[ -z "$RELAY" ] || sign "$RELAY"
if [ "$GHCR" = true ]; then
# The GHCR copy is the same digest; a version GHCR never got is
# skipped, not failed
for ref in "$SERVER_GHCR" ${RELAY_GHCR:+"$RELAY_GHCR"}; do
if docker buildx imagetools inspect "$ref" >/dev/null 2>&1; then sign "$ref"
if docker buildx imagetools inspect "$ref" >/dev/null 2>&1; then sign "$ref"; SIGNED_GHCR+=("$ref")
else echo "::warning::$ref isn't on GHCR; not signed there"; fi
done
fi
# Check at once, as a user would
for ref in "$SERVER" ${RELAY:+"$RELAY"}; do
for ref in "$SERVER" ${RELAY:+"$RELAY"} ${SIGNED_GHCR[@]+"${SIGNED_GHCR[@]}"}; do
cosign verify "$ref" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity-regexp "^https://github.com/$GITHUB_REPOSITORY/\.github/workflows/sign\.yml@refs/(tags/v.+|heads/main)$" \
@@ -200,24 +201,24 @@ jobs:
sbom "$RELAY@$R_AMD64" "inbuxa-relay-$VERSION-linux-amd64.spdx.json"
sbom "$RELAY@$R_ARM64" "inbuxa-relay-$VERSION-linux-arm64.spdx.json"
fi
- uses: actions/attest-sbom@c604332985a26aa8cf1bdc465b92731239ec6b9e # v4.1.0
- uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
with:
subject-name: ${{ steps.v.outputs.server }}
subject-digest: ${{ steps.d.outputs.server_amd64 }}
sbom-path: sbom/inbuxa-${{ steps.v.outputs.version }}-linux-amd64.spdx.json
- uses: actions/attest-sbom@c604332985a26aa8cf1bdc465b92731239ec6b9e # v4.1.0
- uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
with:
subject-name: ${{ steps.v.outputs.server }}
subject-digest: ${{ steps.d.outputs.server_arm64 }}
sbom-path: sbom/inbuxa-${{ steps.v.outputs.version }}-linux-arm64.spdx.json
- if: ${{ steps.d.outputs.relay }}
uses: actions/attest-sbom@c604332985a26aa8cf1bdc465b92731239ec6b9e # v4.1.0
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
with:
subject-name: ${{ steps.v.outputs.relay }}
subject-digest: ${{ steps.d.outputs.relay_amd64 }}
sbom-path: sbom/inbuxa-relay-${{ steps.v.outputs.version }}-linux-amd64.spdx.json
- if: ${{ steps.d.outputs.relay }}
uses: actions/attest-sbom@c604332985a26aa8cf1bdc465b92731239ec6b9e # v4.1.0
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
with:
subject-name: ${{ steps.v.outputs.relay }}
subject-digest: ${{ steps.d.outputs.relay_arm64 }}
+6 -1
View File
@@ -21,6 +21,11 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
g++-aarch64-linux-gnu binutils-aarch64-linux-gnu \
g++-x86-64-linux-gnu binutils-x86-64-linux-gnu
RUN rustup target add "$(cat /target.txt)"
# inbuxa: K-S7: cargo-auditable records the crates in the binary, so the
# SBOM the release workflow makes from this image lists them (not only the
# Debian packages)
ARG CARGO_AUDITABLE_VERSION=0.7.7
RUN cargo install --locked "cargo-auditable@${CARGO_AUDITABLE_VERSION}"
COPY --from=planner /recipe.json /recipe.json
# inbuxa: [patch.crates-io] points sieve-rs at vendor/, and the recipe only
# carries the workspace's own manifests, so cooking the dependencies needs the
@@ -33,7 +38,7 @@ COPY . .
# source document.
ARG INBUXA_REVISION=""
ENV INBUXA_REVISION=${INBUXA_REVISION}
RUN RUSTFLAGS="$(cat /flags.txt)" cargo build --target "$(cat /target.txt)" --release -p inbuxa --no-default-features --features "sqlite postgres mysql rocks s3 redis azure nats"
RUN RUSTFLAGS="$(cat /flags.txt)" cargo auditable build --target "$(cat /target.txt)" --release -p inbuxa --no-default-features --features "sqlite postgres mysql rocks s3 redis azure nats"
RUN mv "/build/target/$(cat /target.txt)/release" "/output"
# inbuxa: migrations spec, MG-4: the inbuxa-migrate the server runs, a
+5 -1
View File
@@ -16,9 +16,13 @@
# Docker Hub images, pulled through Google's mirror, as in Dockerfile.
FROM mirror.gcr.io/library/rust:1-alpine3.22 AS builder
RUN apk add --no-cache musl-dev build-base cmake perl libcap ca-certificates
# The crates go into the binary (cargo-auditable), so the image's SBOM lists
# them: there is nothing else in a scratch image to find
ARG CARGO_AUDITABLE_VERSION=0.7.7
RUN cargo install --locked "cargo-auditable@${CARGO_AUDITABLE_VERSION}"
WORKDIR /build
COPY . .
RUN cargo build --release --locked -p inbuxa-relay && \
RUN cargo auditable build --release --locked -p inbuxa-relay && \
install -m 0755 target/release/inbuxa-relay /inbuxa-relay && \
# Static, or it won't run on a host without musl
! ldd /inbuxa-relay 2>/dev/null | grep -q '=>' && \