apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
  name: "keyless-cosign-check"
  annotations:
    cert-manager.io/inject-ca-from: cosign-keyless-admission-webhook/cosign-keyless-admission-webhook
webhooks:
- name: "keyless.cosign.sigstore"
  namespaceSelector:
    matchExpressions:
    - key: kubernetes.io/metadata.name
      operator: NotIn
      values:
      - kube-system
      - kube-public
      - hnc-system
      - kube-node-lease
      - cosign-keyless-admission-webhook
      - cert-manager
  rules:
  - apiGroups:   [""]
    apiVersions: ["v1"]
    operations:  ["CREATE"]
    resources:   ["pods"]
    scope:       "Namespaced"
  clientConfig:
    service:
      namespace: "cosign-keyless-admission-webhook"
      name: "cosign-keyless-admission-webhook"
  admissionReviewVersions: ["v1", "v1beta1"]
  sideEffects: None
  timeoutSeconds: 30
