Interview Prep/DevSecOps/Supply chain: signing, SBOM and dependencies

Key-based `cosign verify --key cosign.pub` fails after a key rotation for older images

IntermediateTroubleshootingSupply chain: signing, SBOM and dependencies
Answer

Likely causes → Older images were signed with the previous key, and the policy trusts only the new public key.

Diagnose → Verify against both keys; check which signed which digest.

Fix → Trust both public keys during a transition (Kyverno attestors with count: 1 over two key entries), re-sign images still in use with the new key, then remove the old one.

Prevent → Plan rotation with an overlap window, store keys in KMS (cosign sign --key awskms:///alias/cosign), or move to keyless to remove long-lived keys.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Supply chain: signing, SBOM and dependencies