Skip to content

Policy evaluation fails when checking attestation fields on v2 manifest images #6472

Closed

Description

@dvdksn

Contributing guidelines and issue reporting guide

Well-formed report checklist

  • I have found a bug that the documentation does not mention anything about my problem
  • I have found a bug that there are no open or closed issues that are related to my problem
  • I have provided version/information about my environment and done my best to provide a reproducer

Description of bug

Bug description

When a policy accesses OCI index-specific fields (hasProvenance, signatures) on images using v2 manifest format, BuildKit fails with:

ERROR: expected image index descriptor, got application/vnd.docker.distribution.manifest.v2+json

Expected: These fields should resolve to false/empty for v2 manifest images (which don't support attestations)

Reproduction

cat > Dockerfile << 'EOF'
FROM davidkarlsson416/image-no-provenance
RUN echo "test"
EOF

cat > Dockerfile.rego << 'EOF'
package docker
default allow := false
allow if input.local
allow if input.image.hasProvenance
decision := {"allow": allow}
EOF

docker buildx build .

Version information

docker buildx inspect 
Name:          v0.27.0-rc1
Driver:        docker-container
Last Activity: 2026-01-16 11:02:50 +0000 UTC

Nodes:
Name:                  v0.27.0-rc1
Endpoint:              desktop-linux
Driver Options:        image="moby/buildkit:v0.27.0-rc1"
Status:                running
BuildKit daemon flags: --allow-insecure-entitlement=network.host
BuildKit version:      v0.27.0-rc1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions