sigstore / policy-controller

Sigstore Policy Controller - an admission controller that can be used to enforce policy on a Kubernetes cluster based on verifiable supply-chain metadata from cosign

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Signature IDs aren't unique for the same image

wlynch opened this issue · comments

Description

PolicyResult.ID is intended to be unique:

// A unique identifier describing this signature.
// This is typically the hash of this signature's OCI layer for images.
ID string `json:"id,omitempty"`

Currently, when a PolicySignature is created, we try to create a unique identifier by getting the digest of the signature -

id, err := ociSig.Digest()

But non-intuitively, this doesn't give you the digest of the signature itself, this gives you the digest of the content that was signed (the signature / cert are included in layer annotations). This means that any signatures for the same image will have the same PolicySignature.ID

We should modify this to generate a digest of the signature itself.

Version

bb9d59b (HEAD)