Skip to content

image: expose in-toto attestation statements via the API#52636

Open
smerkviladze wants to merge 1 commit into
moby:masterfrom
smerkviladze:add-attestation-statements
Open

image: expose in-toto attestation statements via the API#52636
smerkviladze wants to merge 1 commit into
moby:masterfrom
smerkviladze:add-attestation-statements

Conversation

@smerkviladze
Copy link
Copy Markdown
Contributor

- What I did
Added Statements []json.RawMessage to AttestationProperties so that the verbatim in-toto statement payloads attached to an image's attestation manifest are returned by GET /images/{name} and GET /images/json when manifests=true.

Previously the API reported that an attestation manifest exists but discarded the statement payloads. This meant tools had to make additional registry round-trips to read what was actually attested.

- How I did it
In multiPlatformSummary, when an attestation manifest is detected, the manifest layers are iterated and any layer annotated with in-toto.io/predicate-type has its blob read and appended verbatim to AttestationData.Statements. Layers without the annotation are skipped. Blob read failures are logged at debug level and skipped.

- How to verify it
Pull an image built with BuildKit attestations and query the API directly. The statements array should contain the raw in-toto JSON objects for the locally available platform.

- Human readable description for the release notes

`GET /images/{name}` and `GET /images/json` now include attestation statement payloads (`Manifests[].AttestationData.Statements`) when manifests are requested, allowing tools to inspect image provenance and make policy decisions based on what the image actually attests to.

@github-actions github-actions Bot added impact/changelog area/images Image Service area/daemon Core Engine containerd-integration Issues and PRs related to containerd integration module/api labels May 15, 2026
describing how the image was built or what software it contains.
Previously the API reported that an attestation manifest exists but
discarded the statement payloads. This meant tools had to make
additional registry round-trips to read what was actually attested.

- Add Statements []json.RawMessage to AttestationProperties,
  populated from in-toto statement blobs in the attestation manifest layers
- Expose via GET /images/{name} and GET /images/json when manifests=true
- Layers without an in-toto.io/predicate-type annotation are skipped;
  blob read failures are logged at debug level and skipped
- Bump MaxAPIVersion to 1.55

This allows tools - audit pipelines, image scanners - to read
attestation content directly from the daemon and make policy
decisions based on what the image actually attests to, making it
also useful for examining attestations of images in airgapped
environments without access to the source registry.

Signed-off-by: Sopho Merkviladze <smerkviladze@mirantis.com>
@smerkviladze smerkviladze force-pushed the add-attestation-statements branch from dce3aca to e394bdd Compare May 15, 2026 18:02
@corhere corhere added this to the 29.6.0 milestone May 15, 2026
@corhere corhere added the kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. label May 15, 2026
// this attestation manifest, in the order they appear in the manifest
// layers. Each element is a complete in-toto Statement JSON object.
// Only populated when manifests are requested.
Statements []json.RawMessage `json:"Statements,omitempty"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably shouldn't expose the full content here. Perhaps only digests of these and then make the client fetch them through the c8d content store via gRPC?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, /var/lib/docker.sock supports gRPC and exposes read-only containerd content store there

@corhere
Copy link
Copy Markdown
Contributor

corhere commented May 21, 2026

Our ultimate goal is to evaluate policies during the container lifecycle with the same information as is available to Buildkit build policies. Buildkit does the heavy lifting of finding all the relevant attestations for the image and sending them to the builder: ResolveSourceImageRequest.ResolveAttestations. We need some functional equivalent of that. Clients could use gRPC to fetch the content blobs directly, sure, but they need to know the digest of the blobs to do so. From discussion with @vvoland in the maintainers call it is looking like we'd need to extend the Engine API to expose the layer descriptors for attestation manifests. That would also push a lot of the complexity of resolving the attestation chain to the Engine API client, in start contrast to Buildkit builders.

Since it's looking like an Engine API change would be needed regardless of which approach we take, I propose we add a new endpoint (strawman: GET /images/{name}/attestations?platform=<platform>&type=<csv>) to afford Engine API clients the same functionality as ResolveAttestations for Buildkit builders.

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

Labels

area/daemon Core Engine area/images Image Service containerd-integration Issues and PRs related to containerd integration impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. module/api module/client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants