Repository navigation
Per-container cosign verification (identity/issuer/key via labels, plus regexp matching) #1555
Replies: 1 comment
|
This is a good call. You're right that one global identity only works on a single-publisher host, which means most people can't turn verification on at all. The shape makes sense to me: per-container labels following the 1.8 is in its final soak, so this would land after it. I've put it on the roadmap. |
Uh oh!
There was an error while loading. Please reload this page.
Problem
Signature verification (
DD_SECURITY_VERIFY_SIGNATURES=true) takes one global trust policy:DD_SECURITY_COSIGN_KEY, a single public key, orDD_SECURITY_COSIGN_IDENTITY+DD_SECURITY_COSIGN_ISSUER, a single exact keyless identity.These map directly to
cosign verify --key/--certificate-identity/--certificate-oidc-issuer(runCosignVerifyCommandinapp/security/scan.ts, v1.8.0-rc.11). Nothing can be set per container, and there's no regexp form.A typical host runs images from many publishers. Some sign keyless from their own GitHub workflows, some sign with a key, and many don't sign at all. With one global identity, every image from any other publisher fails verification. So in practice the feature only works on hosts where every image comes from one publisher.
Proposal
Per-container labels that override the global settings, following the existing
dd.security.gatepattern:dd.security.cosign.identity--certificate-identitydd.security.cosign.identity-regexp--certificate-identity-regexpdd.security.cosign.issuer--certificate-oidc-issuerdd.security.cosign.issuer-regexp--certificate-oidc-issuer-regexpdd.security.cosign.key--key(path inside the drydock container)dd.security.cosign=offRegexp variants of the global settings,
DD_SECURITY_COSIGN_IDENTITY_REGEXPandDD_SECURITY_COSIGN_ISSUER_REGEXP. For example, one global regexp could trust every workflow in a GitHub org.A policy for containers with no trust policy, for example
DD_SECURITY_COSIGN_UNCONFIGURED=skip|warn|verify. That makes opt-in per container possible: verify only the images that have labels, without failing everything else.Example:
Why it matters
dd.security.gate,dd.action.*,dd.hook.*), and cosign already supports the regexp flags, so the change is mostly configuration resolution in front of the existing verify call.All reactions