Package: kyverno.io/v1

Resource Types:

ClusterPolicy

ClusterPolicy declares validation, mutation, and generation behaviors for matching resources.

Field Description
apiVersion
string
kyverno.io/v1
kind
string
ClusterPolicy
metadata *
meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
spec *
Spec

Spec declares policy behaviors.



rules *
[]Rule

Rules is a list of Rule instances. A Policy contains multiple rules and each rule can validate, mutate, or generate resources.

applyRules
ApplyRulesType

ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to One processing stops after a rule has been applied i.e. the rule matches and results in a pass, fail, or error. When set to All all rules in the policy are processed. The default is All.

failurePolicy
FailurePolicyType

FailurePolicy defines how unexpected policy errors and webhook response timeout errors are handled. Rules within the same policy share the same failure behavior. This field should not be accessed directly, instead GetFailurePolicy() should be used. Allowed values are Ignore or Fail. Defaults to Fail.

validationFailureAction
ValidationFailureAction

ValidationFailureAction defines if a validation policy rule violation should block the admission review request (enforce), or allow (audit) the admission review request and report an error in a policy report. Optional. Allowed values are audit or enforce. The default value is "Audit".

validationFailureActionOverrides
[]ValidationFailureActionOverride

ValidationFailureActionOverrides is a Cluster Policy attribute that specifies ValidationFailureAction namespace-wise. It overrides ValidationFailureAction for the specified namespaces.

admission
bool

Admission controls if rules are applied during admission. Optional. Default value is "true".

background
bool

Background controls if rules are applied to existing resources during a background scan. Optional. Default value is "true". The value must be set to "false" if the policy rule uses variables that are only available in the admission review request (e.g. user name).

schemaValidation *
bool

Deprecated.

webhookTimeoutSeconds *
int32

WebhookTimeoutSeconds specifies the maximum time in seconds allowed to apply this policy. After the configured time expires, the admission request may fail, or may simply ignore the policy results, based on the failure policy. The default timeout is 10s, the value must be between 1 and 30 seconds.

mutateExistingOnPolicyUpdate
bool

Deprecated, use mutateExistingOnPolicyUpdate under the mutate rule instead

generateExistingOnPolicyUpdate
bool

Deprecated, use generateExisting instead

generateExisting
bool

Deprecated, use generateExisting under the generate rule instead

useServerSideApply
bool

UseServerSideApply controls whether to use server-side apply for generate rules If is set to "true" create & update for generate rules will use apply instead of create/update. Defaults to "false" if not specified.

webhookConfiguration
WebhookConfiguration

WebhookConfiguration specifies the custom configuration for Kubernetes admission webhookconfiguration. Requires Kubernetes 1.27 or later.

status
PolicyStatus

Status contains policy runtime data.

Policy

Policy declares validation, mutation, and generation behaviors for matching resources. See: https://kyverno.io/docs/writing-policies/ for more information.

Field Description
apiVersion
string
kyverno.io/v1
kind
string
Policy
metadata *
meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
spec *
Spec

Spec defines policy behaviors and contains one or more rules.



rules *
[]Rule

Rules is a list of Rule instances. A Policy contains multiple rules and each rule can validate, mutate, or generate resources.

applyRules
ApplyRulesType

ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to One processing stops after a rule has been applied i.e. the rule matches and results in a pass, fail, or error. When set to All all rules in the policy are processed. The default is All.

failurePolicy
FailurePolicyType

FailurePolicy defines how unexpected policy errors and webhook response timeout errors are handled. Rules within the same policy share the same failure behavior. This field should not be accessed directly, instead GetFailurePolicy() should be used. Allowed values are Ignore or Fail. Defaults to Fail.

validationFailureAction
ValidationFailureAction

ValidationFailureAction defines if a validation policy rule violation should block the admission review request (enforce), or allow (audit) the admission review request and report an error in a policy report. Optional. Allowed values are audit or enforce. The default value is "Audit".

validationFailureActionOverrides
[]ValidationFailureActionOverride

ValidationFailureActionOverrides is a Cluster Policy attribute that specifies ValidationFailureAction namespace-wise. It overrides ValidationFailureAction for the specified namespaces.

admission
bool

Admission controls if rules are applied during admission. Optional. Default value is "true".

background
bool

Background controls if rules are applied to existing resources during a background scan. Optional. Default value is "true". The value must be set to "false" if the policy rule uses variables that are only available in the admission review request (e.g. user name).

schemaValidation *
bool

Deprecated.

webhookTimeoutSeconds *
int32

WebhookTimeoutSeconds specifies the maximum time in seconds allowed to apply this policy. After the configured time expires, the admission request may fail, or may simply ignore the policy results, based on the failure policy. The default timeout is 10s, the value must be between 1 and 30 seconds.

mutateExistingOnPolicyUpdate
bool

Deprecated, use mutateExistingOnPolicyUpdate under the mutate rule instead

generateExistingOnPolicyUpdate
bool

Deprecated, use generateExisting instead

generateExisting
bool

Deprecated, use generateExisting under the generate rule instead

useServerSideApply
bool

UseServerSideApply controls whether to use server-side apply for generate rules If is set to "true" create & update for generate rules will use apply instead of create/update. Defaults to "false" if not specified.

webhookConfiguration
WebhookConfiguration

WebhookConfiguration specifies the custom configuration for Kubernetes admission webhookconfiguration. Requires Kubernetes 1.27 or later.

status
PolicyStatus

Deprecated. Policy metrics are available via the metrics endpoint

APICall

(Appears in: ContextAPICall)

Field Description
urlPath *
string

URLPath is the URL path to be used in the HTTP GET or POST request to the Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments"). The format required is the same format used by the kubectl get --raw command. See https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls for details. It's mutually exclusive with the Service field.

method *
Method

Method is the HTTP request type (GET or POST). Defaults to GET.

data *
[]RequestData

The data object specifies the POST data sent to the server. Only applicable when the method field is set to POST.

service *
ServiceCall

Service is an API call to a JSON web service. This is used for non-Kubernetes API server calls. It's mutually exclusive with the URLPath field.

AdmissionOperation (string alias)

(Appears in: ResourceDescription)

AdmissionOperation can have one of the values CREATE, UPDATE, CONNECT, DELETE, which are used to match a specific action.

AnyAllConditions

(Appears in: Attestation, ForEachMutation, ForEachValidation)

AnyAllConditions consists of conditions wrapped denoting a logical criteria to be fulfilled. AnyConditions get fulfilled when at least one of its sub-conditions passes. AllConditions get fulfilled only when all of its sub-conditions pass.

Field Description
any
[]Condition

AnyConditions enable variable-based conditional rule execution. This is useful for finer control of when an rule is applied. A condition can reference object data using JMESPath notation. Here, at least one of the conditions need to pass

all
[]Condition

AllConditions enable variable-based conditional rule execution. This is useful for finer control of when an rule is applied. A condition can reference object data using JMESPath notation. Here, all of the conditions need to pass

ApplyRulesType (string alias)

(Appears in: Spec)

ApplyRulesType controls whether processing stops after one rule is applied or all rules are applied.

Attestation

(Appears in: ImageVerification)

Attestation are checks for signed in-toto Statements that are used to verify the image. See https://github.com/in-toto/attestation. Kyverno fetches signed attestations from the OCI registry and decodes them into a list of Statements.

Field Description
predicateType *
string

Deprecated in favour of 'Type', to be removed soon

type *
string

Type defines the type of attestation contained within the Statement.

attestors *
[]AttestorSet

Attestors specify the required attestors (i.e. authorities).

conditions *
[]AnyAllConditions

Conditions are used to verify attributes within a Predicate. If no Conditions are specified the attestation check is satisfied as long there are predicates that match the predicate type.

Attestor

(Appears in: AttestorSet)

Field Description
keys *
StaticKeyAttestor

Keys specifies one or more public keys.

certificates *
CertificateAttestor

Certificates specifies one or more certificates.

keyless *
KeylessAttestor

Keyless is a set of attribute used to verify a Sigstore keyless attestor. See https://github.com/sigstore/cosign/blob/main/KEYLESS.md.

attestor *
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Attestor is a nested set of Attestor used to specify a more complex set of match authorities.

annotations *
map[string]string

Annotations are used for image verification. Every specified key-value pair must exist and match in the verified payload. The payload may contain other key-value pairs.

repository *
string

Repository is an optional alternate OCI repository to use for signatures and attestations that match this rule. If specified Repository will override other OCI image repository locations for this Attestor.

AttestorSet

(Appears in: Attestation, ImageVerification, Manifests)

Field Description
count *
int

Count specifies the required number of entries that must match. If the count is null, all entries must match (a logical AND). If the count is 1, at least one entry must match (a logical OR). If the count contains a value N, then N must be less than or equal to the size of entries, and at least N entries must match.

entries *
[]Attestor

Entries contains the available attestors. An attestor can be a static key, attributes for keyless verification, or a nested attestor declaration.

AutogenStatus

(Appears in: PolicyStatus)

AutogenStatus contains autogen status information.

Field Description
rules *
[]Rule

Rules is a list of Rule instances. It contains auto generated rules added for pod controllers

CEL

(Appears in: Validation)

CEL allows validation checks using the Common Expression Language (https://kubernetes.io/docs/reference/using-api/cel/).

Field Description
expressions *
[]admissionregistration/v1alpha1.Validation

Expressions is a list of CELExpression types.

paramKind
admissionregistration/v1alpha1.ParamKind

ParamKind is a tuple of Group Kind and Version.

paramRef
admissionregistration/v1alpha1.ParamRef

ParamRef references a parameter resource.

auditAnnotations
[]admissionregistration/v1alpha1.AuditAnnotation

AuditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request.

variables
[]admissionregistration/v1alpha1.Variable

Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under variables in other expressions of the policy.

CTLog

(Appears in: CertificateAttestor, KeylessAttestor, StaticKeyAttestor)

Field Description
ignoreSCT *
bool

IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log to check for a certificate timestamp. Default is false. Set to true if this was opted out during signing.

pubkey *
string

PubKey, if set, is used to validate SCTs against a custom source.

tsaCertChain *
string

TSACertChain, if set, is the PEM-encoded certificate chain file for the RFC3161 timestamp authority. Must contain the root CA certificate. Optionally may contain intermediate CA certificates, and may contain the leaf TSA certificate if not present in the timestamurce.

CertificateAttestor

(Appears in: Attestor)

Field Description
cert *
string

Cert is an optional PEM-encoded public certificate.

certChain *
string

CertChain is an optional PEM encoded set of certificates used to verify.

rekor *
Rekor

Rekor provides configuration for the Rekor transparency log service. If an empty object is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.

ctlog *
CTLog

CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.

CloneFrom

(Appears in: Generation)

CloneFrom provides the location of the source resource used to generate target resources. The resource kind is derived from the match criteria.

Field Description
namespace
string

Namespace specifies source resource namespace.

name *
string

Name specifies name of the resource.

Condition

(Appears in: AnyAllConditions)

Condition defines variable-based conditional criteria for rule execution.

Field Description
key *
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Key is the context entry (using JMESPath) for conditional rule evaluation.

operator *
ConditionOperator

Operator is the conditional operation to perform. Valid operators are: Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals, GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan, DurationLessThanOrEquals, DurationLessThan

value
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Value is the conditional value, or set of values. The values can be fixed set or can be variables declared using JMESPath.

message *
string

Message is an optional display message

ConditionOperator (string alias)

(Appears in: Condition)

ConditionOperator is the operation performed on condition key and value.

ConfigMapReference

(Appears in: ContextEntry)

ConfigMapReference refers to a ConfigMap

Field Description
name *
string

Name is the ConfigMap name.

namespace *
string

Namespace is the ConfigMap namespace.

ContextAPICall

(Appears in: ContextEntry)

Field Description
APICall *
APICall

(Members of APICall are embedded into this type.)

jmesPath *
string

JMESPath is an optional JSON Match Expression that can be used to transform the JSON response returned from the server. For example a JMESPath of "items | length(@)" applied to the API server response for the URLPath "/apis/apps/v1/deployments" will return the total count of deployments across all namespaces.

ContextEntry

(Appears in: ForEachMutation, ForEachValidation, Rule, TargetResourceSpec)

ContextEntry adds variables and data sources to a rule Context. Either a ConfigMap reference or a APILookup must be provided.

Field Description
name *
string

Name is the variable name.

configMap *
ConfigMapReference

ConfigMap is the ConfigMap reference.

apiCall *
ContextAPICall

APICall is an HTTP request to the Kubernetes API server, or other JSON web service. The data returned is stored in the context with the name for the context entry.

imageRegistry *
ImageRegistry

ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image details.

variable *
Variable

Variable defines an arbitrary JMESPath context variable that can be defined inline.

globalReference *
GlobalContextEntryReference

GlobalContextEntryReference is a reference to a cached global context entry.

Deny

(Appears in: ForEachValidation, Validation)

Deny specifies a list of conditions used to pass or fail a validation rule.

Field Description
conditions *
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Multiple conditions can be declared under an any or all statement. A direct list of conditions (without any or all statements) is also supported for backwards compatibility but will be deprecated in the next major release. See: https://kyverno.io/docs/writing-policies/validate/#deny-rules

DryRunOption

(Appears in: Manifests)

DryRunOption is a configuration for dryrun. If enable is set to "true", manifest verification performs "dryrun & compare" which provides robust matching against changes by defaults and other admission controllers. Dryrun requires additional permissions. See config/dryrun/dryrun_rbac.yaml

Field Description
enable *
bool
namespace *
string

FailurePolicyType (string alias)

(Appears in: Spec)

FailurePolicyType specifies a failure policy that defines how unrecognized errors from the admission endpoint are handled.

ForEachMutation

(Appears in: Mutation)

ForEachMutation applies mutation rules to a list of sub-elements by creating a context for each entry in the list and looping over it to apply the specified logic.

Field Description
list *
string

List specifies a JMESPath expression that results in one or more elements to which the validation logic is applied.

order
ForeachOrder

Order defines the iteration order on the list. Can be Ascending to iterate from first to last element or Descending to iterate in from last to first element.

context
[]ContextEntry

Context defines variables and data sources that can be used during rule execution.

preconditions
AnyAllConditions

AnyAllConditions are used to determine if a policy rule should be applied by evaluating a set of conditions. The declaration can contain nested any or all statements. See: https://kyverno.io/docs/writing-policies/preconditions/

patchStrategicMerge
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

PatchStrategicMerge is a strategic merge patch used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/ and https://kubectl.docs.kubernetes.io/references/kustomize/patchesstrategicmerge/.

patchesJson6902
string

PatchesJSON6902 is a list of RFC 6902 JSON Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902 and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.

foreach
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Foreach declares a nested foreach iterator

ForEachValidation

(Appears in: Validation)

ForEachValidation applies validate rules to a list of sub-elements by creating a context for each entry in the list and looping over it to apply the specified logic.

Field Description
list *
string

List specifies a JMESPath expression that results in one or more elements to which the validation logic is applied.

elementScope
bool

ElementScope specifies whether to use the current list element as the scope for validation. Defaults to "true" if not specified. When set to "false", "request.object" is used as the validation scope within the foreach block to allow referencing other elements in the subtree.

context
[]ContextEntry

Context defines variables and data sources that can be used during rule execution.

preconditions
AnyAllConditions

AnyAllConditions are used to determine if a policy rule should be applied by evaluating a set of conditions. The declaration can contain nested any or all statements. See: https://kyverno.io/docs/writing-policies/preconditions/

pattern
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Pattern specifies an overlay-style pattern used to check resources.

anyPattern
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

AnyPattern specifies list of validation patterns. At least one of the patterns must be satisfied for the validation rule to succeed.

deny
Deny

Deny defines conditions used to pass or fail a validation rule.

foreach
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Foreach declares a nested foreach iterator

ForeachOrder (string alias)

(Appears in: ForEachMutation)

ForeachOrder specifies the iteration order in foreach statements.

Generation

(Appears in: Rule)

Generation defines how new resources should be created and managed.

Field Description
generateExisting
bool

GenerateExisting controls whether to trigger the rule in existing resources If is set to "true" the rule will be triggered and applied to existing matched resources.

ResourceSpec *
ResourceSpec

ResourceSpec contains information to select the resource.

synchronize
bool

Synchronize controls if generated resources should be kept in-sync with their source resource. If Synchronize is set to "true" changes to generated resources will be overwritten with resource data from Data or the resource specified in the Clone declaration. Optional. Defaults to "false" if not specified.

orphanDownstreamOnPolicyDelete
bool

OrphanDownstreamOnPolicyDelete controls whether generated resources should be deleted when the rule that generated them is deleted with synchronization enabled. This option is only applicable to generate rules of the data type. See https://kyverno.io/docs/writing-policies/generate/#data-examples. Defaults to "false" if not specified.

data
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Data provides the resource declaration used to populate each generated resource. At most one of Data or Clone must be specified. If neither are provided, the generated resource will be created with default data only.

clone
CloneFrom

Clone specifies the source resource used to populate each generated resource. At most one of Data or Clone can be specified. If neither are provided, the generated resource will be created with default data only.

cloneList
CloneList

CloneList specifies the list of source resource used to populate each generated resource.

GlobalContextEntryReference

(Appears in: ContextEntry)

Field Description
name *
string

Name of the global context entry

jmesPath *
string

JMESPath is an optional JSON Match Expression that can be used to transform the JSON response returned from the server. For example a JMESPath of "items | length(@)" applied to the API server response for the URLPath "/apis/apps/v1/deployments" will return the total count of deployments across all namespaces.

ImageExtractorConfigs (map[string][]github.com/kyverno/kyverno/api/kyverno/v1.ImageExtractorConfig alias)

(Appears in: Rule)

ImageRegistry

(Appears in: ContextEntry)

ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image details.

Field Description
reference *
string

Reference is image reference to a container image in the registry. Example: ghcr.io/kyverno/kyverno:latest

jmesPath
string

JMESPath is an optional JSON Match Expression that can be used to transform the ImageData struct returned as a result of processing the image reference.

imageRegistryCredentials *
ImageRegistryCredentials

ImageRegistryCredentials provides credentials that will be used for authentication with registry

ImageRegistryCredentials

(Appears in: ImageRegistry, ImageVerification)

Field Description
allowInsecureRegistry *
bool

AllowInsecureRegistry allows insecure access to a registry.

providers *
[]ImageRegistryCredentialsProvidersType

Providers specifies a list of OCI Registry names, whose authentication providers are provided. It can be of one of these values: default,google,azure,amazon,github.

secrets *
[]string

Secrets specifies a list of secrets that are provided for credentials. Secrets must live in the Kyverno namespace.

ImageRegistryCredentialsProvidersType (string alias)

(Appears in: ImageRegistryCredentials)

ImageRegistryCredentialsProvidersType provides the list of credential providers required.

ImageVerification

(Appears in: Rule)

ImageVerification validates that images that match the specified pattern are signed with the supplied public key. Once the image is verified it is mutated to include the SHA digest retrieved during the registration.

Field Description
type *
ImageVerificationType

Type specifies the method of signature validation. The allowed options are Cosign and Notary. By default Cosign is used if a type is not specified.

image *
string

Deprecated. Use ImageReferences instead.

imageReferences *
[]string

ImageReferences is a list of matching image reference patterns. At least one pattern in the list must match the image for the rule to apply. Each image reference consists of a registry address (defaults to docker.io), repository, image, and tag (defaults to latest). Wildcards ('*' and '?') are allowed. See: https://kubernetes.io/docs/concepts/containers/images.

skipImageReferences *
[]string

SkipImageReferences is a list of matching image reference patterns that should be skipped. At least one pattern in the list must match the image for the rule to be skipped. Each image reference consists of a registry address (defaults to docker.io), repository, image, and tag (defaults to latest). Wildcards ('*' and '?') are allowed. See: https://kubernetes.io/docs/concepts/containers/images.

key *
string

Deprecated. Use StaticKeyAttestor instead.

roots *
string

Deprecated. Use KeylessAttestor instead.

subject *
string

Deprecated. Use KeylessAttestor instead.

issuer *
string

Deprecated. Use KeylessAttestor instead.

additionalExtensions *
map[string]string

Deprecated.

attestors *
[]AttestorSet

Attestors specified the required attestors (i.e. authorities)

attestations *
[]Attestation

Attestations are optional checks for signed in-toto Statements used to verify the image. See https://github.com/in-toto/attestation. Kyverno fetches signed attestations from the OCI registry and decodes them into a list of Statement declarations.

annotations *
map[string]string

Deprecated. Use annotations per Attestor instead.

repository *
string

Repository is an optional alternate OCI repository to use for image signatures and attestations that match this rule. If specified Repository will override the default OCI image repository configured for the installation. The repository can also be overridden per Attestor or Attestation.

cosignOCI11
bool

CosignOCI11 enables the experimental OCI 1.1 behaviour in cosign image verification. Defaults to false.

mutateDigest *
bool

MutateDigest enables replacement of image tags with digests. Defaults to true.

verifyDigest *
bool

VerifyDigest validates that images have a digest.

required *
bool

Required validates that images are verified i.e. have matched passed a signature or attestation check.

imageRegistryCredentials *
ImageRegistryCredentials

ImageRegistryCredentials provides credentials that will be used for authentication with registry.

useCache *
bool

UseCache enables caching of image verify responses for this rule.

ImageVerificationType (string alias)

(Appears in: ImageVerification)

ImageVerificationType selects the type of verification algorithm

KeylessAttestor

(Appears in: Attestor)

Field Description
rekor *
Rekor

Rekor provides configuration for the Rekor transparency log service. If an empty object is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.

ctlog *
CTLog

CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.

issuer *
string

Issuer is the certificate issuer used for keyless signing.

subject *
string

Subject is the verified identity used for keyless signing, for example the email address.

roots *
string

Roots is an optional set of PEM encoded trusted root certificates. If not provided, the system roots are used.

additionalExtensions *
map[string]string

AdditionalExtensions are certificate-extensions used for keyless signing.

Manifests

(Appears in: Validation)

Field Description
attestors *
[]AttestorSet

Attestors specified the required attestors (i.e. authorities)

annotationDomain
string

AnnotationDomain is custom domain of annotation for message and signature. Default is "cosign.sigstore.dev".

ignoreFields
IgnoreFieldList

Fields which will be ignored while comparing manifests.

dryRun
DryRunOption

DryRun configuration

repository *
string

Repository is an optional alternate OCI repository to use for resource bundle reference. The repository can be overridden per Attestor or Attestation.

MatchResources

(Appears in: Rule)

MatchResources is used to specify resource and admission review request data for which a policy rule is applicable.

Field Description
any
ResourceFilters

Any allows specifying resources which will be ORed

all
ResourceFilters

All allows specifying resources which will be ANDed

UserInfo
UserInfo

UserInfo contains information about the user performing the operation. Specifying UserInfo directly under match is being deprecated. Please specify under "any" or "all" instead.

resources
ResourceDescription

ResourceDescription contains information about the resource being created or modified. Requires at least one tag to be specified when under MatchResources. Specifying ResourceDescription directly under match is being deprecated. Please specify under "any" or "all" instead.

Method (string alias)

(Appears in: APICall)

Method is a HTTP request type.

Mutation

(Appears in: Rule)

Mutation defines how resource are modified.

Field Description
mutateExistingOnPolicyUpdate
bool

MutateExistingOnPolicyUpdate controls if the mutateExisting rule will be applied on policy events.

targets
[]TargetResourceSpec

Targets defines the target resources to be mutated.

patchStrategicMerge
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

PatchStrategicMerge is a strategic merge patch used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/ and https://kubectl.docs.kubernetes.io/references/kustomize/patchesstrategicmerge/.

patchesJson6902
string

PatchesJSON6902 is a list of RFC 6902 JSON Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902 and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.

foreach
[]ForEachMutation

ForEach applies mutation rules to a list of sub-elements by creating a context for each entry in the list and looping over it to apply the specified logic.

PodSecurity

(Appears in: Validation)

PodSecurity applies exemptions for Kubernetes Pod Security admission by specifying exclusions for Pod Security Standards controls.

Field Description
level *
k8s.io/pod-security-admission/api.Level

Level defines the Pod Security Standard level to be applied to workloads. Allowed values are privileged, baseline, and restricted.

version
string

Version defines the Pod Security Standard versions that Kubernetes supports. Allowed values are v1.19, v1.20, v1.21, v1.22, v1.23, v1.24, v1.25, v1.26, v1.27, v1.28, v1.29, latest. Defaults to latest.

exclude *
[]PodSecurityStandard

Exclude specifies the Pod Security Standard controls to be excluded.

PodSecurityStandard

(Appears in: PodSecurity)

PodSecurityStandard specifies the Pod Security Standard controls to be excluded.

Field Description
controlName *
string

ControlName specifies the name of the Pod Security Standard control. See: https://kubernetes.io/docs/concepts/security/pod-security-standards/

images
[]string

Images selects matching containers and applies the container level PSS. Each image is the image name consisting of the registry address, repository, image, and tag. Empty list matches no containers, PSS checks are applied at the pod level only. Wildcards ('*' and '?') are allowed. See: https://kubernetes.io/docs/concepts/containers/images.

restrictedField
string

RestrictedField selects the field for the given Pod Security Standard control. When not set, all restricted fields for the control are selected.

values
[]string

Values defines the allowed values that can be excluded.

PolicyStatus

(Appears in: ClusterPolicy, Policy)

Deprecated. Policy metrics are now available via the "/metrics" endpoint. See: https://kyverno.io/docs/monitoring-kyverno-with-prometheus-metrics/

Field Description
ready *
bool

Deprecated in favor of Conditions

conditions
[]meta/v1.Condition
autogen
AutogenStatus
rulecount
RuleCountStatus
validatingadmissionpolicy
ValidatingAdmissionPolicyStatus

ValidatingAdmissionPolicy contains status information

Rekor

(Appears in: CertificateAttestor, KeylessAttestor, StaticKeyAttestor)

Field Description
url *
string

URL is the address of the transparency log. Defaults to the public Rekor log instance https://rekor.sigstore.dev.

pubkey *
string

RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor. If set, this will be used to validate transparency log signatures from a custom Rekor.

ignoreTlog *
bool

IgnoreTlog skips transparency log verification.

RequestData

(Appears in: APICall)

RequestData contains the HTTP POST data

Field Description
key *
string

Key is a unique identifier for the data value

value *
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Value is the data value

ResourceDescription

(Appears in: MatchResources)

ResourceDescription contains criteria used to match resources.

Field Description
kinds
[]string

Kinds is a list of resource kinds.

name
string

Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".

names
[]string

Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).

namespaces
[]string

Namespaces is a list of namespaces names. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).

annotations
map[string]string

Annotations is a map of annotations (key-value pairs of type string). Annotation keys and values support the wildcard characters "*" (matches zero or many characters) and "?" (matches at least one character).

selector
meta/v1.LabelSelector

Selector is a label selector. Label keys and values in matchLabels support the wildcard characters * (matches zero or many characters) and ? (matches one character). Wildcards allows writing label selectors like ["storage.k8s.io/": ""]. Note that using ["" : ""] matches any key and value but does not match an empty label set.

namespaceSelector
meta/v1.LabelSelector

NamespaceSelector is a label selector for the resource namespace. Label keys and values in matchLabels support the wildcard characters * (matches zero or many characters) and ? (matches one character).Wildcards allows writing label selectors like ["storage.k8s.io/": ""]. Note that using ["" : ""] matches any key and value but does not match an empty label set.

operations
[]AdmissionOperation

Operations can contain values ["CREATE, "UPDATE", "CONNECT", "DELETE"], which are used to match a specific action.

ResourceFilters ([]github.com/kyverno/kyverno/api/kyverno/v1.ResourceFilter alias)

(Appears in: MatchResources)

ResourceFilters is a slice of ResourceFilter

ResourceSpec

(Appears in: Generation, TargetResourceSpec)

Field Description
apiVersion
string

APIVersion specifies resource apiVersion.

kind *
string

Kind specifies resource kind.

namespace
string

Namespace specifies resource namespace.

name
string

Name specifies the resource name.

uid
k8s.io/apimachinery/pkg/types.UID

UID specifies the resource uid.

Rule

(Appears in: AutogenStatus, Spec)

Rule defines a validation, mutation, or generation control for matching resources. Each rules contains a match declaration to select resources, and an optional exclude declaration to specify which resources to exclude.

Field Description
name *
string

Name is a label to identify the rule, It must be unique within the policy.

context
[]ContextEntry

Context defines variables and data sources that can be used during rule execution.

match *
MatchResources

MatchResources defines when this policy rule should be applied. The match criteria can include resource information (e.g. kind, name, namespace, labels) and admission review request information like the user name or role. At least one kind is required.

exclude
MatchResources

ExcludeResources defines when this policy rule should not be applied. The exclude criteria can include resource information (e.g. kind, name, namespace, labels) and admission review request information like the name or role.

imageExtractors
ImageExtractorConfigs

ImageExtractors defines a mapping from kinds to ImageExtractorConfigs. This config is only valid for verifyImages rules.

preconditions
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Preconditions are used to determine if a policy rule should be applied by evaluating a set of conditions. The declaration can contain nested any or all statements. A direct list of conditions (without any or all statements is supported for backwards compatibility but will be deprecated in the next major release. See: https://kyverno.io/docs/writing-policies/preconditions/

celPreconditions
[]admissionregistration/v1alpha1.MatchCondition

CELPreconditions are used to determine if a policy rule should be applied by evaluating a set of CEL conditions. It can only be used with the validate.cel subrule

mutate
Mutation

Mutation is used to modify matching resources.

validate
Validation

Validation is used to validate matching resources.

generate
Generation

Generation is used to create new resources.

verifyImages
[]ImageVerification

VerifyImages is used to verify image signatures and mutate them to add a digest

skipBackgroundRequests *
bool

SkipBackgroundRequests bypasses admission requests that are sent by the background controller. The default value is set to "true", it must be set to "false" to apply generate and mutateExisting rules to those requests.

RuleCountStatus

(Appears in: PolicyStatus)

RuleCountStatus contains four variables which describes counts for validate, generate, mutate and verify images rules

Field Description
validate *
int

Count for validate rules in policy

generate *
int

Count for generate rules in policy

mutate *
int

Count for mutate rules in policy

verifyimages *
int

Count for verify image rules in policy

SecretReference

(Appears in: StaticKeyAttestor)

Field Description
name *
string

Name of the secret. The provided secret must contain a key named cosign.pub.

namespace *
string

Namespace name where the Secret exists.

ServiceCall

(Appears in: APICall)

Field Description
url *
string

URL is the JSON web service URL. A typical form is https://{service}.{namespace}:{port}/{path}.

caBundle *
string

CABundle is a PEM encoded CA bundle which will be used to validate the server certificate.

Spec

(Appears in: ClusterPolicy, Policy)

Spec contains a list of Rule instances and other policy controls.

Field Description
rules *
[]Rule

Rules is a list of Rule instances. A Policy contains multiple rules and each rule can validate, mutate, or generate resources.

applyRules
ApplyRulesType

ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to One processing stops after a rule has been applied i.e. the rule matches and results in a pass, fail, or error. When set to All all rules in the policy are processed. The default is All.

failurePolicy
FailurePolicyType

FailurePolicy defines how unexpected policy errors and webhook response timeout errors are handled. Rules within the same policy share the same failure behavior. This field should not be accessed directly, instead GetFailurePolicy() should be used. Allowed values are Ignore or Fail. Defaults to Fail.

validationFailureAction
ValidationFailureAction

ValidationFailureAction defines if a validation policy rule violation should block the admission review request (enforce), or allow (audit) the admission review request and report an error in a policy report. Optional. Allowed values are audit or enforce. The default value is "Audit".

validationFailureActionOverrides
[]ValidationFailureActionOverride

ValidationFailureActionOverrides is a Cluster Policy attribute that specifies ValidationFailureAction namespace-wise. It overrides ValidationFailureAction for the specified namespaces.

admission
bool

Admission controls if rules are applied during admission. Optional. Default value is "true".

background
bool

Background controls if rules are applied to existing resources during a background scan. Optional. Default value is "true". The value must be set to "false" if the policy rule uses variables that are only available in the admission review request (e.g. user name).

schemaValidation *
bool

Deprecated.

webhookTimeoutSeconds *
int32

WebhookTimeoutSeconds specifies the maximum time in seconds allowed to apply this policy. After the configured time expires, the admission request may fail, or may simply ignore the policy results, based on the failure policy. The default timeout is 10s, the value must be between 1 and 30 seconds.

mutateExistingOnPolicyUpdate
bool

Deprecated, use mutateExistingOnPolicyUpdate under the mutate rule instead

generateExistingOnPolicyUpdate
bool

Deprecated, use generateExisting instead

generateExisting
bool

Deprecated, use generateExisting under the generate rule instead

useServerSideApply
bool

UseServerSideApply controls whether to use server-side apply for generate rules If is set to "true" create & update for generate rules will use apply instead of create/update. Defaults to "false" if not specified.

webhookConfiguration
WebhookConfiguration

WebhookConfiguration specifies the custom configuration for Kubernetes admission webhookconfiguration. Requires Kubernetes 1.27 or later.

StaticKeyAttestor

(Appears in: Attestor)

Field Description
publicKeys *
string

Keys is a set of X.509 public keys used to verify image signatures. The keys can be directly specified or can be a variable reference to a key specified in a ConfigMap (see https://kyverno.io/docs/writing-policies/variables/), or reference a standard Kubernetes Secret elsewhere in the cluster by specifying it in the format "k8s:///<secret_name>". The named Secret must specify a key cosign.pub containing the public key used for verification, (see https://github.com/sigstore/cosign/blob/main/KMS.md#kubernetes-secret). When multiple keys are specified each key is processed as a separate staticKey entry (.attestors[*].entries.keys) within the set of attestors and the count is applied across the keys.

signatureAlgorithm *
string

Specify signature algorithm for public keys. Supported values are sha224, sha256, sha384 and sha512.

kms *
string

KMS provides the URI to the public key stored in a Key Management System. See: https://github.com/sigstore/cosign/blob/main/KMS.md

secret *
SecretReference

Reference to a Secret resource that contains a public key

rekor *
Rekor

Rekor provides configuration for the Rekor transparency log service. If an empty object is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.

ctlog *
CTLog

CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.

TargetResourceSpec

(Appears in: Mutation)

TargetResourceSpec defines targets for mutating existing resources.

Field Description
ResourceSpec *
ResourceSpec

ResourceSpec contains the target resources to load when mutating existing resources.

context
[]ContextEntry

Context defines variables and data sources that can be used during rule execution.

preconditions
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Preconditions are used to determine if a policy rule should be applied by evaluating a set of conditions. The declaration can contain nested any or all statements. A direct list of conditions (without any or all statements is supported for backwards compatibility but will be deprecated in the next major release. See: https://kyverno.io/docs/writing-policies/preconditions/

UserInfo

(Appears in: MatchResources)

UserInfo contains information about the user performing the operation.

Field Description
roles
[]string

Roles is the list of namespaced role names for the user.

clusterRoles
[]string

ClusterRoles is the list of cluster-wide role names for the user.

subjects
[]rbac/v1.Subject

Subjects is the list of subject names like users, user groups, and service accounts.

ValidatingAdmissionPolicyStatus

(Appears in: PolicyStatus)

ValidatingAdmissionPolicy contains status information

Field Description
generated *
bool

Generated indicates whether a validating admission policy is generated from the policy or not

message *
string

Message is a human readable message indicating details about the generation of validating admission policy It is an empty string when validating admission policy is successfully generated.

Validation

(Appears in: Rule)

Validation defines checks to be performed on matching resources.

Field Description
message
string

Message specifies a custom message to be displayed on failure.

manifests
Manifests

Manifest specifies conditions for manifest verification

foreach
[]ForEachValidation

ForEach applies validate rules to a list of sub-elements by creating a context for each entry in the list and looping over it to apply the specified logic.

pattern
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Pattern specifies an overlay-style pattern used to check resources.

anyPattern
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

AnyPattern specifies list of validation patterns. At least one of the patterns must be satisfied for the validation rule to succeed.

deny
Deny

Deny defines conditions used to pass or fail a validation rule.

podSecurity
PodSecurity

PodSecurity applies exemptions for Kubernetes Pod Security admission by specifying exclusions for Pod Security Standards controls.

cel
CEL

CEL allows validation checks using the Common Expression Language (https://kubernetes.io/docs/reference/using-api/cel/).

ValidationFailureAction (string alias)

(Appears in: Spec, ValidationFailureActionOverride)

ValidationFailureAction defines the policy validation failure action

ValidationFailureActionOverride

(Appears in: Spec)

Field Description
action *
ValidationFailureAction
namespaces *
[]string
namespaceSelector *
meta/v1.LabelSelector

Variable

(Appears in: ContextEntry)

Variable defines an arbitrary JMESPath context variable that can be defined inline.

Field Description
value
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Value is any arbitrary JSON object representable in YAML or JSON form.

jmesPath
string

JMESPath is an optional JMESPath Expression that can be used to transform the variable.

default
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

Default is an optional arbitrary JSON object that the variable may take if the JMESPath expression evaluates to nil

WebhookConfiguration

(Appears in: Spec)

WebhookConfiguration specifies the configuration for Kubernetes admission webhookconfiguration.

Field Description
matchConditions
[]admissionregistration/v1.MatchCondition

MatchCondition configures admission webhook matchConditions.