Skip to content

Verifying a compose-lint release

Every release is signed in CI without a long-lived key. The release workflow's GitHub OIDC token gets a short-lived Sigstore certificate that names the workflow and the tag it ran for, and the signature is recorded in Sigstore's public transparency log. Verifying a release means checking that certificate, so pin both of these:

  • Identity: https://github.com/tmatens/compose-lint/.github/workflows/publish.yml@refs/tags/vX.Y.Z
  • Issuer: https://token.actions.githubusercontent.com

A check that only asks "is there a valid signature" proves nothing, since anyone can sign anything with their own identity.

Docker image

With cosign 3 (the signatures are stored as OCI referrers in the Sigstore bundle format):

VERSION=0.34.0
cosign verify \
  --certificate-identity "https://github.com/tmatens/compose-lint/.github/workflows/publish.yml@refs/tags/v${VERSION}" \
  --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
  "composelint/compose-lint:${VERSION}"

Pin the exact tag rather than a pattern. A pattern accepts any release's signature, so it cannot tell when a version tag has been moved onto an older, legitimately signed image; the exact identity can. Then pin the verified digest in your Compose file or CI, as the hardening walkthrough shows.

To accept any release, for example when checking latest, anchor the pattern at both ends:

cosign verify \
  --certificate-identity-regexp '^https://github\.com/tmatens/compose-lint/\.github/workflows/publish\.yml@refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$' \
  --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
  composelint/compose-lint:latest

The image also carries an SPDX SBOM and an OpenVEX document, attested with the same identity. cosign verify-attestation needs --type to find them:

cosign verify-attestation --type spdxjson \
  --certificate-identity "https://github.com/tmatens/compose-lint/.github/workflows/publish.yml@refs/tags/v${VERSION}" \
  --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
  "composelint/compose-lint:${VERSION}"

Use --type openvex for the VEX document.

From the release after 1.8.2, the image index also holds an SBOM that BuildKit wrote during the build, next to the build provenance. It is there so Docker Hub's Vulnerabilities column has an SBOM to read. It is not signed with the identity above, so verify the cosign one.

What a scan of the image reports

The image is built on a distroless Debian base, and an image scanner reports the CVEs of that base's packages along with compose-lint's own. As of 1.8.2 they fall into two groups.

Marked not_affected in the OpenVEX document. .vex/compose-lint.openvex.json carries 60 statements: 54 for CVEs in the base image's Debian packages and 6 for pip, whose code is stripped from the image. Each statement's impact_statement says why the CVE does not apply and what was checked. A scanner leaves these out of its results once it is given the document, and lists them otherwise. Applying the OpenVEX document to your own scan has the commands. A smoke test run inside every image built re-checks the facts the base-image statements rely on.

Open, with no fix to take. Three findings have no statement and stay in every scan. They are recorded, with the reason, in .vex/open-findings.json:

CVE Package Reported as Status in Debian
CVE-2019-1010022 glibc Stack guard bypass unfixed, unimportant
CVE-2019-1010024 glibc ASLR bypass through the thread stack and heap cache unfixed, unimportant
CVE-2019-1010025 glibc Heap address of a thread can be guessed unfixed, unimportant

All three were filed in 2019 as mitigation bypasses. glibc upstream does not treat them as security bugs and has released no fix, so there is no patched glibc to move to. Debian's tracker lists them as unfixed in every release and rates them unimportant.

They have no VEX statement because none would be true. Each describes a weaker exploit mitigation in glibc itself, not a code path that can be shown absent or unreached, and OpenVEX has no justification for that. Leaving them visible is the accurate record.

A finding outside both groups is new. If a fix exists it arrives with a base image update: the pinned digest is moved as new ones are published, and the next release ships it. One that still has no fix 14 days after publication is reviewed and ends up in one of the two groups above; a daily check compares a scan of the published image with both files and raises anything in neither.

Applying the OpenVEX document to your own scan

No scanner applies the document by default. These commands were tested on 1.8.2 with Trivy 0.76, Grype 0.122, Docker Scout 1.30 and OSV-Scanner 2.7.

Trivy can find the attested document itself:

trivy image --vex oci "composelint/compose-lint:${VERSION}"

Trivy marks this option experimental, and its documentation does not say whether it checks who signed the attestation. Run the cosign verify-attestation command above first if that matters to you.

Grype and Docker Scout do not look for the attestation, so they need the document as a file. This verifies the attestation and writes the document out of it:

cosign verify-attestation --type openvex \
  --certificate-identity "https://github.com/tmatens/compose-lint/.github/workflows/publish.yml@refs/tags/v${VERSION}" \
  --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
  "composelint/compose-lint:${VERSION}" \
  | jq -r '.payload' | base64 -d | jq '.predicate' > compose-lint.openvex.json
grype "composelint/compose-lint:${VERSION}" --vex compose-lint.openvex.json

docker scout cves --vex-location compose-lint.openvex.json --vex-author '.*' \
  "composelint/compose-lint:${VERSION}"

Docker Scout accepts VEX statements only from Docker's own authors unless --vex-author says otherwise. Without that option it loads the document and applies none of it. The Vulnerabilities column on Docker Hub does not apply the document either.

OSV-Scanner has no option to read a VEX document.

Python package

From 0.3.7 on, the wheel and sdist on PyPI are also attached to the GitHub Release, each with a Sigstore bundle beside it. With sigstore-python:

VERSION=0.34.0
pip download "compose-lint==${VERSION}" --no-deps --only-binary :all: -d .
gh release download "v${VERSION}" -R tmatens/compose-lint -p '*.whl.sigstore.json'
python -m sigstore verify identity \
  --cert-identity "https://github.com/tmatens/compose-lint/.github/workflows/publish.yml@refs/tags/v${VERSION}" \
  --cert-oidc-issuer "https://token.actions.githubusercontent.com" \
  --bundle "compose_lint-${VERSION}-py3-none-any.whl.sigstore.json" \
  "compose_lint-${VERSION}-py3-none-any.whl"

From 0.4.1 on, the same files also carry SLSA build provenance, which the GitHub CLI verifies:

gh attestation verify "compose_lint-${VERSION}-py3-none-any.whl" \
  --repo tmatens/compose-lint \
  --signer-workflow tmatens/compose-lint/.github/workflows/publish.yml

Every release on PyPI, including the earliest, also has PyPI's own PEP 740 attestations, shown under "Provenance" on the project page.

Reproducible install

pip install compose-lint resolves the newest release, and whatever dependency versions its ranges allow, at install time. For CI or production tooling, pin the version and install the dependencies from that release's hash-pinned lockfile, which release automation keeps current:

curl -fsSLO https://raw.githubusercontent.com/tmatens/compose-lint/v1.8.2/requirements.lock
pip install --require-hashes -r requirements.lock   # dependencies, hash-pinned
pip install --no-deps compose-lint==1.8.2          # the tool, version-pinned

What each release carries

Every image listed here is signed, and every release on PyPI carries PyPI's attestations; a "no" means an additional artifact did not exist yet, not that the release is unsigned. Run against a release that lacks the artifact, a command fails without implying tampering: cosign verify-attestation reports "none of the attestations matched the predicate type", gh attestation verify returns HTTP 404, and gh release download finds no bundle.

Releases Image signing identity Image SBOM Image VEX Wheel Sigstore bundle SLSA provenance
0.5.1 on publish.yml@refs/tags/vX.Y.Z yes yes yes yes
0.4.1 – 0.5.0 publish.yml@refs/tags/vX.Y.Z yes no yes yes
0.3.7 – 0.4.0 publish.yml@refs/tags/vX.Y.Z yes no yes no
0.3.6 publish.yml@refs/tags/v0.3.6 yes no no no
0.3.4 publish-channel.yml@refs/tags/v0.3.4 no no no no
0.3.3 docker-publish.yml@refs/tags/v0.3.3 no no no no

0.3.3 and 0.3.4 were signed by workflows that have since been removed: 0.3.3 by the first Docker workflow, which publish.yml replaced, and 0.3.4 by a republish workflow. Verify them with the identity in the table; the any-release pattern above does not match them. A republish now runs inside publish.yml on the release tag, so it signs with the same identity as the release itself.

The 0.3.2 image was published and signed by the first Docker workflow, then removed from Docker Hub. 0.3.0, 0.3.1 and 0.3.5 never had an image: the Docker workflow did not yet exist for 0.3.0, and the other two publishes failed before pushing.