k8wiz
Kyverno
Medium
Security

A GeneratingPolicy that clones a Secret into new namespaces fails with a forbidden error. Which label on a ClusterRole merges its rules into the Kyverno background controller's permissions?

Select your answer:

Show answer and explanation

Answer: rbac.kyverno.io/aggregate-to-background-controller: "true"

Explanation

The background controller creates generated resources, and its ClusterRole has an aggregation rule that selects ClusterRoles labeled rbac.kyverno.io/aggregate-to-background-controller: "true". The default Helm install lets it write NetworkPolicies, ConfigMaps, quotas, LimitRanges, Roles and RoleBindings, but not Secrets in other namespaces, so cloning Secrets needs this extra ClusterRole.

Read more about Kyverno