Ensures that container images used to run Flux controllers in the cluster are signed with valid Cosign signatures. Prevents the deployment of untrusted or potentially compromised Flux images. Protects the integrity and security of the Flux deployment process.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: verify-flux-imagesannotations:policies.kyverno.io/title: Verify Flux Imagespolicies.kyverno.io/category: Fluxpolicies.kyverno.io/severity: mediumkyverno.io/kyverno-version: 1.6.2policies.kyverno.io/minversion: 1.6.0kyverno.io/kubernetes-version: "1.23"policies.kyverno.io/subject: GitRepositorypolicies.kyverno.io/description: Ensures that container images used to run Flux controllers in the cluster are signed with valid Cosign signatures. Prevents the deployment of untrusted or potentially compromised Flux images. Protects the integrity and security of the Flux deployment process.spec:validationFailureAction: Auditbackground: falserules:- name: verify-cosign-signaturematch:any:- resources:kinds:- PodverifyImages:- imageReferences:- ghcr.io/fluxcd/source-controller:*- ghcr.io/fluxcd/kustomize-controller:*- ghcr.io/fluxcd/helm-controller:*- ghcr.io/fluxcd/notification-controller:*- ghcr.io/fluxcd/image-reflector-controller:*- ghcr.io/fluxcd/image-automation-controller:*- docker.io/fluxcd/source-controller:*- docker.io/fluxcd/kustomize-controller:*- docker.io/fluxcd/helm-controller:*- docker.io/fluxcd/notification-controller:*- docker.io/fluxcd/image-reflector-controller:*- docker.io/fluxcd/image-automation-controller:*mutateDigest: falseverifyDigest: falseattestors:- entries:- keyless:subject: https://github.com/fluxcd/*issuer: https://token.actions.githubusercontent.comrekor:url: https://rekor.sigstore.dev
As part of the tenant provisioning process, Flux needs to generate RBAC resources. This policy will create a ServiceAccount and RoleBinding when a new or existing Namespace is labeled with `toolkit.fluxcd.io/tenant`. Use of this rule may require an additional binding for the Kyverno ServiceAccount so it has permissions to properly create the RoleBinding.
Flux source APIs include a number of different sources such as GitRepository, Bucket, HelmRepository, and ImageRepository resources. Each of these by default can be pointed to any location. In a production environment, it may be desired to restrict these to only known sources to prevent accessing outside sources. This policy verifies that each of the Flux sources comes from a trusted location.
Ensures that Git repositories used for Flux deployments in a cluster originate from a specific, trusted organization. Prevents the use of untrusted or potentially risky Git repositories. Protects the integrity and security of Flux deployments.