I am new to kubernetes. I am trying to sign the Docker image with Cosign and verify the image using Kyverno Admission controller. But in my setup, Kyverno admission controller allows unsigned images into cluster.
Kyverno policy file,
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: kyverno
namespace: kyverno
spec:
validationFailureAction: Enforce
background: false
webhookTimeoutSeconds: 30
failurePolicy: Fail
rules:
- name: kyverno
match:
any:
- resources:
kinds:
- Pod
verifyImages:
- imageReferences:
- "localhost:5000/nginx_signed"
attestors:
- entries:
- keyless:
subject: "xxx@gmail.com"
issuer: "https://accounts.google.com"
rekor:
url: "https://rekor.sigstore.dev"
I am following this tutorial for verifying image using Kyverno,
https://kyverno.io/docs/writing-policies/verify-images/sigstore/
In my setup, the first example mentioned in the above tutorial works for me as expected. But when I am using my policy file and keyless signing method, the Kyverno admission controller is not working and pod is created with unsigned image.