ClusterPolicy declares validation, mutation, and generation behaviors for matching resources.
| Field | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
kyverno.io/v1
|
||||||||||||||||||||||||||||||
kindstring |
ClusterPolicy |
||||||||||||||||||||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||||||||||||||||||||
specSpec |
Spec declares policy behaviors.
|
||||||||||||||||||||||||||||||
statusPolicyStatus |
(Optional)
Status contains policy runtime data. |
Policy declares validation, mutation, and generation behaviors for matching resources. See: https://kyverno.io/docs/writing-policies/ for more information.
| Field | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
kyverno.io/v1
|
||||||||||||||||||||||||||||||
kindstring |
Policy |
||||||||||||||||||||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||||||||||||||||||||
specSpec |
Spec defines policy behaviors and contains one or more rules.
|
||||||||||||||||||||||||||||||
statusPolicyStatus |
(Optional)
Deprecated. Policy metrics are available via the metrics endpoint |
(Appears on: ContextAPICall, ExternalAPICall)
| Field | Description |
|---|---|
urlPathstring |
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 |
methodMethod |
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. |
serviceServiceCall |
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. |
string alias)(Appears on: ResourceDescription, ResourceDescription)
AdmissionOperation can have one of the values CREATE, UPDATE, CONNECT, DELETE, which are used to match a specific action.
(Appears on: Attestation, ForEachGeneration, 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 |
(Optional)
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 |
(Optional)
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 |
string alias)
ApplyRulesType controls whether processing stops after one rule is applied or all rules are applied.
(Appears on: ImageVerification, 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 |
|---|---|
namestring |
Name is the variable name. |
predicateTypestring |
Deprecated in favour of ‘Type’, to be removed soon |
typestring |
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. |
(Appears on: AttestorSet)
| Field | Description |
|---|---|
keysStaticKeyAttestor |
Keys specifies one or more public keys. |
certificatesCertificateAttestor |
Certificates specifies one or more certificates. |
keylessKeylessAttestor |
Keyless is a set of attribute used to verify a Sigstore keyless attestor. See https://github.com/sigstore/cosign/blob/main/KEYLESS.md. |
attestorKubernetes apiextensions/v1.JSON |
Attestor is a nested set of Attestor used to specify a more complex set of match authorities. |
annotationsmap[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. |
repositorystring |
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. |
signatureAlgorithmstring |
Specify signature algorithm for public keys. Supported values are sha224, sha256, sha384 and sha512. |
(Appears on: Attestation, ImageVerification, Manifests, ImageVerification)
| Field | Description |
|---|---|
countint |
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. |
(Appears on: 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 |
(Appears on: Validation, Validation)
CEL allows validation checks using the Common Expression Language (https://kubernetes.io/docs/reference/using-api/cel/).
| Field | Description |
|---|---|
generatebool |
(Optional)
Generate specifies whether to generate a Kubernetes ValidatingAdmissionPolicy from the rule. Optional. Defaults to “false” if not specified. |
expressions[]Kubernetes admissionregistration/v1.Validation |
Expressions is a list of CELExpression types. |
paramKindKubernetes admissionregistration/v1.ParamKind |
(Optional)
ParamKind is a tuple of Group Kind and Version. |
paramRefKubernetes admissionregistration/v1.ParamRef |
(Optional)
ParamRef references a parameter resource. |
auditAnnotations[]Kubernetes admissionregistration/v1.AuditAnnotation |
(Optional)
AuditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. |
variables[]Kubernetes admissionregistration/v1.Variable |
(Optional)
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 |
(Appears on: CertificateAttestor, KeylessAttestor, StaticKeyAttestor)
| Field | Description |
|---|---|
ignoreSCTbool |
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. |
pubkeystring |
PubKey, if set, is used to validate SCTs against a custom source. |
tsaCertChainstring |
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. |
(Appears on: Attestor)
| Field | Description |
|---|---|
certstring |
Cert is an optional PEM-encoded public certificate. |
certChainstring |
CertChain is an optional PEM encoded set of certificates used to verify. |
rekorRekor |
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. |
ctlogCTLog |
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. |
(Appears on: GeneratePattern)
CloneFrom provides the location of the source resource used to generate target resources. The resource kind is derived from the match criteria.
| Field | Description |
|---|---|
namespacestring |
(Optional)
Namespace specifies source resource namespace. |
namestring |
Name specifies name of the resource. |
(Appears on: AnyAllConditions)
Condition defines variable-based conditional criteria for rule execution.
| Field | Description |
|---|---|
keyKubernetes apiextensions/v1.JSON |
Key is the context entry (using JMESPath) for conditional rule evaluation. |
operatorConditionOperator |
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 |
valueKubernetes apiextensions/v1.JSON |
(Optional)
Value is the conditional value, or set of values. The values can be fixed set or can be variables declared using JMESPath. |
messagestring |
Message is an optional display message |
string alias)(Appears on: Condition)
ConditionOperator is the operation performed on condition key and value.
(Appears on: Deny, Rule, TargetResourceSpec)
ConditionsWrapper contains either the deprecated list of Conditions or the new AnyAll Conditions.
| Field | Description |
|---|---|
-any |
(Optional)
Conditions is a list of conditions that must be satisfied for the rule to be applied. |
(Appears on: ContextEntry)
ConfigMapReference refers to a ConfigMap
| Field | Description |
|---|---|
namestring |
Name is the ConfigMap name. |
namespacestring |
Namespace is the ConfigMap namespace. |
(Appears on: ContextEntry)
| Field | Description |
|---|---|
APICallAPICall |
(Members of |
defaultKubernetes apiextensions/v1.JSON |
(Optional)
Default is an optional arbitrary JSON object that the context value is set to, if the apiCall returns error. |
jmesPathstring |
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. |
(Appears on: ForEachGeneration, ForEachMutation, ForEachValidation, Rule, TargetResourceSpec, CleanupPolicySpec, CleanupPolicySpec, Rule)
ContextEntry adds variables and data sources to a rule Context. Either a ConfigMap reference or a APILookup must be provided.
| Field | Description |
|---|---|
namestring |
Name is the variable name. |
configMapConfigMapReference |
ConfigMap is the ConfigMap reference. |
apiCallContextAPICall |
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. |
imageRegistryImageRegistry |
ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image details. |
variableVariable |
Variable defines an arbitrary JMESPath context variable that can be defined inline. |
globalReferenceGlobalContextEntryReference |
GlobalContextEntryReference is a reference to a cached global context entry. |
(Appears on: ForEachValidation, ValidateImageVerification, Validation)
Deny specifies a list of conditions used to pass or fail a validation rule.
| Field | Description |
|---|---|
conditionsConditionsWrapper |
Multiple conditions can be declared under an |
(Appears on: 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 |
|---|---|
enablebool |
|
namespacestring |
string alias)(Appears on: Spec, WebhookConfiguration, Spec)
FailurePolicyType specifies a failure policy that defines how unrecognized errors from the admission endpoint are handled.
(Appears on: Generation)
| Field | Description |
|---|---|
liststring |
List specifies a JMESPath expression that results in one or more elements to which the validation logic is applied. |
context[]ContextEntry |
(Optional)
Context defines variables and data sources that can be used during rule execution. |
preconditionsAnyAllConditions |
(Optional)
AnyAllConditions are used to determine if a policy rule should be applied by evaluating a
set of conditions. The declaration can contain nested |
GeneratePatternGeneratePattern |
(Appears on: ForEachMutationWrapper, 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 |
|---|---|
liststring |
List specifies a JMESPath expression that results in one or more elements to which the validation logic is applied. |
orderForeachOrder |
(Optional)
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 |
(Optional)
Context defines variables and data sources that can be used during rule execution. |
preconditionsAnyAllConditions |
(Optional)
AnyAllConditions are used to determine if a policy rule should be applied by evaluating a
set of conditions. The declaration can contain nested |
patchStrategicMergegithub.com/kyverno/kyverno/api/kyverno.Any |
(Optional)
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/kustomization/patchesstrategicmerge/. |
patchesJson6902string |
(Optional)
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/kustomization/patchesjson6902/. |
foreachForEachMutationWrapper |
(Optional)
Foreach declares a nested foreach iterator |
(Appears on: ForEachMutation)
ForEachMutationWrapper contains a list of ForEach descriptors.
| Field | Description |
|---|---|
-[]ForEachMutation |
(Optional)
Item is a descriptor on how to iterate over the list of items. |
(Appears on: ForEachValidationWrapper, Validation, 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 |
|---|---|
liststring |
List specifies a JMESPath expression that results in one or more elements to which the validation logic is applied. |
elementScopebool |
(Optional)
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 |
(Optional)
Context defines variables and data sources that can be used during rule execution. |
preconditionsAnyAllConditions |
(Optional)
AnyAllConditions are used to determine if a policy rule should be applied by evaluating a
set of conditions. The declaration can contain nested |
patternKubernetes apiextensions/v1.JSON |
(Optional)
Pattern specifies an overlay-style pattern used to check resources. |
anyPatternKubernetes apiextensions/v1.JSON |
(Optional)
AnyPattern specifies list of validation patterns. At least one of the patterns must be satisfied for the validation rule to succeed. |
denyDeny |
(Optional)
Deny defines conditions used to pass or fail a validation rule. |
foreachForEachValidationWrapper |
(Optional)
Foreach declares a nested foreach iterator |
(Appears on: ForEachValidation)
ForEachValidationWrapper contains a list of ForEach descriptors.
| Field | Description |
|---|---|
-[]ForEachValidation |
(Optional)
Item is a descriptor on how to iterate over the list of items. |
string alias)(Appears on: ForEachMutation)
ForeachOrder specifies the iteration order in foreach statements.
(Appears on: ForEachGeneration, Generation)
| Field | Description |
|---|---|
ResourceSpecResourceSpec |
ResourceSpec contains information to select the resource. |
dataKubernetes apiextensions/v1.JSON |
(Optional)
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. |
cloneCloneFrom |
(Optional)
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. |
cloneListCloneList |
(Optional)
CloneList specifies the list of source resource used to populate each generated resource. |
string alias)
Generation defines how new resources should be created and managed.
| Field | Description |
|---|---|
generateExistingbool |
(Optional)
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. |
synchronizebool |
(Optional)
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. |
orphanDownstreamOnPolicyDeletebool |
(Optional)
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. |
GeneratePatternGeneratePattern |
(Optional) |
foreach[]ForEachGeneration |
(Optional)
ForEach applies generate 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. |
(Appears on: ContextEntry)
| Field | Description |
|---|---|
namestring |
Name of the global context entry |
jmesPathstring |
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. |
(Appears on: ServiceCall)
| Field | Description |
|---|---|
keystring |
Key is the header key |
valuestring |
Value is the header value |
| Field | Description |
|---|---|
pathstring |
Path is the path to the object containing the image field in a custom resource. It should be slash-separated. Each slash-separated key must be a valid YAML key or a wildcard ‘*’. Wildcard keys are expanded in case of arrays or objects. |
valuestring |
(Optional)
Value is an optional name of the field within ‘path’ that points to the image URI. This is useful when a custom ‘key’ is also defined. |
namestring |
(Optional)
Name is the entry the image will be available under ‘images. |
keystring |
(Optional)
Key is an optional name of the field within ‘path’ that will be used to uniquely identify an image. Note - this field MUST be unique. |
jmesPathstring |
(Optional)
JMESPath is an optional JMESPath expression to apply to the image value. This is useful when the extracted image begins with a prefix like ‘docker://’. The ‘trim_prefix’ function may be used to trim the prefix: trim_prefix(@, ‘docker://’). Note - Image digest mutation may not be used when applying a JMESPAth to an image. |
map[string][]github.com/kyverno/kyverno/api/kyverno/v1.ImageExtractorConfig alias)
(Appears on: ContextEntry)
ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image details.
| Field | Description |
|---|---|
referencestring |
Reference is image reference to a container image in the registry. Example: ghcr.io/kyverno/kyverno:latest |
jmesPathstring |
(Optional)
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. |
imageRegistryCredentialsImageRegistryCredentials |
ImageRegistryCredentials provides credentials that will be used for authentication with registry |
(Appears on: ImageRegistry, ImageVerification, ImageVerification)
| Field | Description |
|---|---|
allowInsecureRegistrybool |
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. |
string alias)(Appears on: ImageRegistryCredentials)
ImageRegistryCredentialsProvidersType provides the list of credential providers required.
(Appears on: 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 |
|---|---|
failureActionValidationFailureAction |
(Optional)
Allowed values are Audit or Enforce. |
typeImageVerificationType |
Type specifies the method of signature validation. The allowed options are Cosign, Sigstore Bundle and Notary. By default Cosign is used if a type is not specified. |
imagestring |
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. |
keystring |
Deprecated. Use StaticKeyAttestor instead. |
rootsstring |
Deprecated. Use KeylessAttestor instead. |
subjectstring |
Deprecated. Use KeylessAttestor instead. |
issuerstring |
Deprecated. Use KeylessAttestor instead. |
additionalExtensionsmap[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. |
annotationsmap[string]string |
Deprecated. Use annotations per Attestor instead. |
repositorystring |
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. |
cosignOCI11bool |
(Optional)
CosignOCI11 enables the experimental OCI 1.1 behaviour in cosign image verification. Defaults to false. |
mutateDigestbool |
MutateDigest enables replacement of image tags with digests. Defaults to true. |
verifyDigestbool |
VerifyDigest validates that images have a digest. |
validateValidateImageVerification |
Validation checks conditions across multiple image verification attestations or context entries |
requiredbool |
Required validates that images are verified i.e. have matched passed a signature or attestation check. |
imageRegistryCredentialsImageRegistryCredentials |
ImageRegistryCredentials provides credentials that will be used for authentication with registry. |
useCachebool |
UseCache enables caching of image verify responses for this rule. |
string alias)(Appears on: ImageVerification, ImageVerification)
ImageVerificationType selects the type of verification algorithm
(Appears on: Attestor)
| Field | Description |
|---|---|
rekorRekor |
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. |
ctlogCTLog |
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. |
issuerstring |
Issuer is the certificate issuer used for keyless signing. |
issuerRegExpstring |
IssuerRegExp is the regular expression to match certificate issuer used for keyless signing. |
subjectstring |
Subject is the verified identity used for keyless signing, for example the email address. |
subjectRegExpstring |
SubjectRegExp is the regular expression to match identity used for keyless signing, for example the email address. |
rootsstring |
Roots is an optional set of PEM encoded trusted root certificates. If not provided, the system roots are used. |
additionalExtensionsmap[string]string |
AdditionalExtensions are certificate-extensions used for keyless signing. |
(Appears on: Validation, Validation)
| Field | Description |
|---|---|
attestors[]AttestorSet |
Attestors specified the required attestors (i.e. authorities) |
annotationDomainstring |
(Optional)
AnnotationDomain is custom domain of annotation for message and signature. Default is “cosign.sigstore.dev”. |
ignoreFieldsIgnoreFieldList |
(Optional)
Fields which will be ignored while comparing manifests. |
dryRunDryRunOption |
(Optional)
DryRun configuration |
repositorystring |
Repository is an optional alternate OCI repository to use for resource bundle reference. The repository can be overridden per Attestor or Attestation. |
(Appears on: Rule)
MatchResources is used to specify resource and admission review request data for which a policy rule is applicable.
| Field | Description |
|---|---|
anyResourceFilters |
(Optional)
Any allows specifying resources which will be ORed |
allResourceFilters |
(Optional)
All allows specifying resources which will be ANDed |
UserInfoUserInfo |
(Optional)
UserInfo contains information about the user performing the operation. Specifying UserInfo directly under match is being deprecated. Please specify under “any” or “all” instead. |
resourcesResourceDescription |
(Optional)
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. |
string alias)(Appears on: APICall)
Method is a HTTP request type.
Mutation defines how resource are modified.
| Field | Description |
|---|---|
mutateExistingOnPolicyUpdatebool |
(Optional)
MutateExistingOnPolicyUpdate controls if the mutateExisting rule will be applied on policy events. |
targets[]TargetResourceSpec |
(Optional)
Targets defines the target resources to be mutated. |
patchStrategicMergeKubernetes apiextensions/v1.JSON |
(Optional)
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/kustomization/patchesstrategicmerge/. |
patchesJson6902string |
(Optional)
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/kustomization/patchesjson6902/. |
foreach[]ForEachMutation |
(Optional)
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. |
| Field | Description |
|---|---|
fields[]string |
|
objectsgithub.com/sigstore/k8s-manifest-sigstore/pkg/k8smanifest.ObjectReferenceList |
(Appears on: Validation, Validation)
PodSecurity applies exemptions for Kubernetes Pod Security admission by specifying exclusions for Pod Security Standards controls.
| Field | Description |
|---|---|
levelk8s.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. |
versionstring |
(Optional)
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. |
(Appears on: PodSecurity, PolicyExceptionSpec, PolicyExceptionSpec)
PodSecurityStandard specifies the Pod Security Standard controls to be excluded.
| Field | Description |
|---|---|
controlNamestring |
ControlName specifies the name of the Pod Security Standard control. See: https://kubernetes.io/docs/concepts/security/pod-security-standards/ |
images[]string |
(Optional)
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. |
restrictedFieldstring |
(Optional)
RestrictedField selects the field for the given Pod Security Standard control. When not set, all restricted fields for the control are selected. |
values[]string |
(Optional)
Values defines the allowed values that can be excluded. |
PolicyInterface abstracts the concrete policy type (Policy vs ClusterPolicy)
(Appears on: ClusterPolicy, Policy, ClusterPolicy, Policy)
Deprecated. Policy metrics are now available via the “/metrics” endpoint. See: https://kyverno.io/docs/monitoring-kyverno-with-prometheus-metrics/
| Field | Description |
|---|---|
readybool |
Deprecated in favor of Conditions |
conditions[]Kubernetes meta/v1.Condition |
(Optional) |
autogenAutogenStatus |
(Optional) |
rulecountRuleCountStatus |
(Optional) |
validatingadmissionpolicyValidatingAdmissionPolicyStatus |
(Optional)
ValidatingAdmissionPolicy contains status information |
(Appears on: CertificateAttestor, KeylessAttestor, StaticKeyAttestor)
| Field | Description |
|---|---|
urlstring |
URL is the address of the transparency log. Defaults to the public Rekor log instance https://rekor.sigstore.dev. |
pubkeystring |
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. |
ignoreTlogbool |
IgnoreTlog skips transparency log verification. |
(Appears on: APICall)
RequestData contains the HTTP POST data
| Field | Description |
|---|---|
keystring |
Key is a unique identifier for the data value |
valueKubernetes apiextensions/v1.JSON |
Value is the data value |
(Appears on: MatchResources, ResourceFilter)
ResourceDescription contains criteria used to match resources.
| Field | Description |
|---|---|
kinds[]string |
(Optional)
Kinds is a list of resource kinds. |
namestring |
(Optional)
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 |
(Optional)
Names are the names of the resources. Each name supports wildcard characters “*” (matches zero or many characters) and “?” (at least one character). |
namespaces[]string |
(Optional)
Namespaces is a list of namespaces names. Each name supports wildcard characters “*” (matches zero or many characters) and “?” (at least one character). |
annotationsmap[string]string |
(Optional)
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). |
selectorKubernetes meta/v1.LabelSelector |
(Optional)
Selector is a label selector. Label keys and values in |
namespaceSelectorKubernetes meta/v1.LabelSelector |
(Optional)
NamespaceSelector is a label selector for the resource namespace. Label keys and values
in |
operations[]AdmissionOperation |
(Optional)
Operations can contain values [“CREATE, “UPDATE”, “CONNECT”, “DELETE”], which are used to match a specific action. |
ResourceFilter allow users to “AND” or “OR” between resources
| Field | Description |
|---|---|
UserInfoUserInfo |
(Optional)
UserInfo contains information about the user performing the operation. |
resourcesResourceDescription |
ResourceDescription contains information about the resource being created or modified. |
[]github.com/kyverno/kyverno/api/kyverno/v1.ResourceFilter alias)(Appears on: MatchResources, MatchResources)
ResourceFilters is a slice of ResourceFilter
(Appears on: GeneratePattern, TargetSelector, UpdateRequestSpec, UpdateRequestStatus, RuleContext, UpdateRequestSpec, UpdateRequestStatus)
| Field | Description |
|---|---|
apiVersionstring |
(Optional)
APIVersion specifies resource apiVersion. |
kindstring |
Kind specifies resource kind. |
namespacestring |
(Optional)
Namespace specifies resource namespace. |
namestring |
(Optional)
Name specifies the resource name. |
uidk8s.io/apimachinery/pkg/types.UID |
(Optional)
UID specifies the resource uid. |
(Appears on: 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 |
|---|---|
namestring |
Name is a label to identify the rule, It must be unique within the policy. |
context[]ContextEntry |
(Optional)
Context defines variables and data sources that can be used during rule execution. |
reportPropertiesmap[string]string |
(Optional)
ReportProperties are the additional properties from the rule that will be added to the policy report result |
matchMatchResources |
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. |
excludeMatchResources |
(Optional)
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. |
imageExtractorsImageExtractorConfigs |
(Optional)
ImageExtractors defines a mapping from kinds to ImageExtractorConfigs. This config is only valid for verifyImages rules. |
preconditionsConditionsWrapper |
(Optional)
Preconditions are used to determine if a policy rule should be applied by evaluating a
set of conditions. The declaration can contain nested |
celPreconditions[]Kubernetes admissionregistration/v1.MatchCondition |
(Optional)
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 |
mutateMutation |
(Optional)
Mutation is used to modify matching resources. |
validateValidation |
(Optional)
Validation is used to validate matching resources. |
generateGeneration |
(Optional)
Generation is used to create new resources. |
verifyImages[]ImageVerification |
(Optional)
VerifyImages is used to verify image signatures and mutate them to add a digest |
skipBackgroundRequestsbool |
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. |
(Appears on: PolicyStatus)
RuleCountStatus contains four variables which describes counts for validate, generate, mutate and verify images rules
| Field | Description |
|---|---|
validateint |
Count for validate rules in policy |
generateint |
Count for generate rules in policy |
mutateint |
Count for mutate rules in policy |
verifyimagesint |
Count for verify image rules in policy |
(Appears on: StaticKeyAttestor)
| Field | Description |
|---|---|
namestring |
Name of the secret. The provided secret must contain a key named cosign.pub. |
namespacestring |
Namespace name where the Secret exists. |
(Appears on: APICall)
| Field | Description |
|---|---|
urlstring |
URL is the JSON web service URL. A typical form is
|
headers[]HTTPHeader |
Headers is a list of optional HTTP headers to be included in the request. |
caBundlestring |
CABundle is a PEM encoded CA bundle which will be used to validate the server certificate. |
(Appears on: 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. |
applyRulesApplyRulesType |
(Optional)
ApplyRules controls how rules in a policy are applied. Rule are processed in
the order of declaration. When set to |
failurePolicyFailurePolicyType |
Deprecated, use failurePolicy under the webhookConfiguration instead. |
validationFailureActionValidationFailureAction |
Deprecated, use validationFailureAction under the validate rule instead. |
validationFailureActionOverrides[]ValidationFailureActionOverride |
Deprecated, use validationFailureActionOverrides under the validate rule instead. |
emitWarningbool |
(Optional)
EmitWarning enables API response warnings for mutate policy rules or validate policy rules with validationFailureAction set to Audit. Enabling this option will extend admission request processing times. The default value is “false”. |
admissionbool |
(Optional)
Admission controls if rules are applied during admission. Optional. Default value is “true”. |
backgroundbool |
(Optional)
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). |
schemaValidationbool |
Deprecated. |
webhookTimeoutSecondsint32 |
Deprecated, use webhookTimeoutSeconds under webhookConfiguration instead. |
mutateExistingOnPolicyUpdatebool |
(Optional)
Deprecated, use mutateExistingOnPolicyUpdate under the mutate rule instead |
generateExistingOnPolicyUpdatebool |
(Optional)
Deprecated, use generateExisting instead |
generateExistingbool |
(Optional)
Deprecated, use generateExisting under the generate rule instead |
useServerSideApplybool |
(Optional)
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. |
webhookConfigurationWebhookConfiguration |
(Optional)
WebhookConfiguration specifies the custom configuration for Kubernetes admission webhookconfiguration. |
(Appears on: Attestor)
| Field | Description |
|---|---|
publicKeysstring |
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:// |
signatureAlgorithmstring |
Deprecated. Use attestor.signatureAlgorithm instead. |
kmsstring |
KMS provides the URI to the public key stored in a Key Management System. See: https://github.com/sigstore/cosign/blob/main/KMS.md |
secretSecretReference |
Reference to a Secret resource that contains a public key |
rekorRekor |
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. |
ctlogCTLog |
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. |
(Appears on: Mutation)
TargetResourceSpec defines targets for mutating existing resources.
| Field | Description |
|---|---|
TargetSelectorTargetSelector |
TargetSelector contains the ResourceSpec and a label selector to support selecting with labels. |
context[]ContextEntry |
(Optional)
Context defines variables and data sources that can be used during rule execution. |
preconditionsConditionsWrapper |
(Optional)
Preconditions are used to determine if a policy rule should be applied by evaluating a
set of conditions. The declaration can contain nested |
(Appears on: TargetResourceSpec)
| Field | Description |
|---|---|
ResourceSpecResourceSpec |
ResourceSpec contains the target resources to load when mutating existing resources. |
selectorKubernetes meta/v1.LabelSelector |
(Optional)
Selector allows you to select target resources with their labels. |
(Appears on: MatchResources, ResourceFilter, ResourceFilter)
UserInfo contains information about the user performing the operation.
| Field | Description |
|---|---|
roles[]string |
(Optional)
Roles is the list of namespaced role names for the user. |
clusterRoles[]string |
(Optional)
ClusterRoles is the list of cluster-wide role names for the user. |
subjects[]Kubernetes rbac/v1.Subject |
(Optional)
Subjects is the list of subject names like users, user groups, and service accounts. |
(Appears on: ImageVerification, ImageVerification)
ValidateImageVerification checks conditions across multiple image verification attestations or context entries
| Field | Description |
|---|---|
messagestring |
(Optional)
Message specifies a custom message to be displayed on failure. |
denyDeny |
(Optional)
Deny defines conditions used to pass or fail a validation rule. |
(Appears on: PolicyStatus)
ValidatingAdmissionPolicy contains status information
| Field | Description |
|---|---|
generatedbool |
Generated indicates whether a validating admission policy is generated from the policy or not |
messagestring |
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. |
(Appears on: Rule)
Validation defines checks to be performed on matching resources.
| Field | Description |
|---|---|
failureActionValidationFailureAction |
(Optional)
FailureAction 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. |
failureActionOverrides[]ValidationFailureActionOverride |
(Optional)
FailureActionOverrides is a Cluster Policy attribute that specifies FailureAction namespace-wise. It overrides FailureAction for the specified namespaces. |
allowExistingViolationsbool |
AllowExistingViolations allows prexisting violating resources to continue violating a policy. |
messagestring |
(Optional)
Message specifies a custom message to be displayed on failure. |
manifestsManifests |
(Optional)
Manifest specifies conditions for manifest verification |
foreach[]ForEachValidation |
(Optional)
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. |
patternKubernetes apiextensions/v1.JSON |
(Optional)
Pattern specifies an overlay-style pattern used to check resources. |
anyPatternKubernetes apiextensions/v1.JSON |
(Optional)
AnyPattern specifies list of validation patterns. At least one of the patterns must be satisfied for the validation rule to succeed. |
denyDeny |
(Optional)
Deny defines conditions used to pass or fail a validation rule. |
podSecurityPodSecurity |
(Optional)
PodSecurity applies exemptions for Kubernetes Pod Security admission by specifying exclusions for Pod Security Standards controls. |
celCEL |
(Optional)
CEL allows validation checks using the Common Expression Language (https://kubernetes.io/docs/reference/using-api/cel/). |
assertgithub.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any |
(Optional)
Assert defines a kyverno-json assertion tree. |
string alias)(Appears on: ImageVerification, Spec, Validation, ValidationFailureActionOverride, ImageVerification, Spec, Validation)
ValidationFailureAction defines the policy validation failure action
(Appears on: Spec, Validation, Spec, Validation)
| Field | Description |
|---|---|
actionValidationFailureAction |
|
namespaces[]string |
|
namespaceSelectorKubernetes meta/v1.LabelSelector |
(Appears on: ContextEntry)
Variable defines an arbitrary JMESPath context variable that can be defined inline.
| Field | Description |
|---|---|
valuegithub.com/kyverno/kyverno/api/kyverno.Any |
(Optional)
Value is any arbitrary JSON object representable in YAML or JSON form. |
jmesPathstring |
(Optional)
JMESPath is an optional JMESPath Expression that can be used to transform the variable. |
defaultgithub.com/kyverno/kyverno/api/kyverno.Any |
(Optional)
Default is an optional arbitrary JSON object that the variable may take if the JMESPath expression evaluates to nil |
WebhookConfiguration specifies the configuration for Kubernetes admission webhookconfiguration.
| Field | Description |
|---|---|
failurePolicyFailurePolicyType |
(Optional)
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 |
timeoutSecondsint32 |
TimeoutSeconds 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. |
matchConditions[]Kubernetes admissionregistration/v1.MatchCondition |
(Optional)
MatchCondition configures admission webhook matchConditions. Requires Kubernetes 1.27 or later. |
Package v1beta1 contains API Schema definitions for the policy v1beta1 API group
Resource Types:
UpdateRequest is a request to process mutate and generate rules in background.
| Field | Description | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
kyverno.io/v1beta1
|
||||||||||||||
kindstring |
UpdateRequest |
||||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||||
specUpdateRequestSpec |
ResourceSpec is the information to identify the trigger resource.
|
||||||||||||||
statusUpdateRequestStatus |
(Optional)
Status contains statistics related to update request. |
(Appears on: UpdateRequestSpecContext)
AdmissionRequestInfoObject stores the admission request and operation details
| Field | Description |
|---|---|
admissionRequestKubernetes admission/v1.AdmissionRequest |
(Optional) |
operationKubernetes admission/v1.Operation |
(Optional) |
(Appears on: UpdateRequestSpecContext)
RequestInfo contains permission info carried in an admission request.
| Field | Description |
|---|---|
roles[]string |
(Optional)
Roles is a list of possible role send the request. |
clusterRoles[]string |
(Optional)
ClusterRoles is a list of possible clusterRoles send the request. |
userInfoKubernetes authentication/v1.UserInfo |
(Optional)
UserInfo is the userInfo carried in the admission request. |
string alias)(Appears on: UpdateRequestSpec)
(Appears on: UpdateRequest)
UpdateRequestSpec stores the request specification.
| Field | Description |
|---|---|
requestTypeRequestType |
Type represents request type for background processing |
policystring |
Specifies the name of the policy. |
rulestring |
Rule is the associate rule name of the current UR. |
deleteDownstreambool |
DeleteDownstream represents whether the downstream needs to be deleted. |
synchronizebool |
Synchronize represents the sync behavior of the corresponding rule Optional. Defaults to “false” if not specified. |
resourceResourceSpec |
ResourceSpec is the information to identify the trigger resource. |
contextUpdateRequestSpecContext |
Context … |
(Appears on: UpdateRequestSpec)
UpdateRequestSpecContext stores the context to be shared.
| Field | Description |
|---|---|
userInfoRequestInfo |
(Optional) |
admissionRequestInfoAdmissionRequestInfoObject |
(Optional) |
string alias)(Appears on: UpdateRequestStatus)
UpdateRequestState defines the state of request.
(Appears on: UpdateRequest)
UpdateRequestStatus defines the observed state of UpdateRequest
| Field | Description |
|---|---|
handlerstring |
Deprecated |
stateUpdateRequestState |
State represents state of the update request. |
messagestring |
(Optional)
Specifies request status message. |
generatedResources[]ResourceSpec |
This will track the resources that are updated by the generate Policy. Will be used during clean up resources. |
retryCountint |
Resource Types:
CleanupPolicy defines a rule for resource cleanup.
| Field | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
kyverno.io/v2
|
||||||||||||
kindstring |
CleanupPolicy |
||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||
specCleanupPolicySpec |
Spec declares policy behaviors.
|
||||||||||||
statusCleanupPolicyStatus |
(Optional)
Status contains policy runtime data. |
ClusterCleanupPolicy defines rule for resource cleanup.
| Field | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
kyverno.io/v2
|
||||||||||||
kindstring |
ClusterCleanupPolicy |
||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||
specCleanupPolicySpec |
Spec declares policy behaviors.
|
||||||||||||
statusCleanupPolicyStatus |
(Optional)
Status contains policy runtime data. |
PolicyException declares resources to be excluded from specified policies.
| Field | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
kyverno.io/v2
|
||||||||||
kindstring |
PolicyException |
||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||
specPolicyExceptionSpec |
Spec declares policy exception behaviors.
|
UpdateRequest is a request to process mutate and generate rules in background.
| Field | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
kyverno.io/v2
|
||||||||||||||||
kindstring |
UpdateRequest |
||||||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||||||
specUpdateRequestSpec |
ResourceSpec is the information to identify the trigger resource.
|
||||||||||||||||
statusUpdateRequestStatus |
(Optional)
Status contains statistics related to update request. |
(Appears on: UpdateRequestSpecContext)
AdmissionRequestInfoObject stores the admission request and operation details
| Field | Description |
|---|---|
admissionRequestKubernetes admission/v1.AdmissionRequest |
(Optional) |
operationKubernetes admission/v1.Operation |
(Optional) |
(Appears on: CleanupPolicySpec, PolicyExceptionSpec)
| Field | Description |
|---|---|
any[]Condition |
(Optional)
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 |
(Optional)
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. |
CleanupPolicyInterface abstracts the concrete policy type (CleanupPolicy vs ClusterCleanupPolicy)
(Appears on: CleanupPolicy, ClusterCleanupPolicy)
CleanupPolicySpec stores specifications for selecting resources that the user needs to delete and schedule when the matching resources needs deleted.
| Field | Description |
|---|---|
context[]ContextEntry |
(Optional)
Context defines variables and data sources that can be used during rule execution. |
matchMatchResources |
MatchResources defines when cleanuppolicy 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. |
excludeMatchResources |
(Optional)
ExcludeResources defines when cleanuppolicy 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. |
schedulestring |
The schedule in Cron format |
conditionsAnyAllConditions |
(Optional)
Conditions defines the conditions used to select the resources which will be cleaned up. |
deletionPropagationPolicyKubernetes meta/v1.DeletionPropagation |
(Optional)
DeletionPropagationPolicy defines how resources will be deleted (Foreground, Background, Orphan). |
(Appears on: CleanupPolicy, ClusterCleanupPolicy)
CleanupPolicyStatus stores the status of the policy.
| Field | Description |
|---|---|
conditions[]Kubernetes meta/v1.Condition |
|
lastExecutionTimeKubernetes meta/v1.Time |
(Appears on: AnyAllConditions)
| Field | Description |
|---|---|
keygithub.com/kyverno/kyverno/api/kyverno.Any |
Key is the context entry (using JMESPath) for conditional rule evaluation. |
operatorConditionOperator |
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 |
valuegithub.com/kyverno/kyverno/api/kyverno.Any |
Value is the conditional value, or set of values. The values can be fixed set or can be variables declared using JMESPath. |
messagestring |
Message is an optional display message |
string alias)(Appears on: Condition)
ConditionOperator is the operation performed on condition key and value.
(Appears on: PolicyExceptionSpec)
Exception stores infos about a policy and rules
| Field | Description |
|---|---|
policyNamestring |
PolicyName identifies the policy to which the exception is applied.
The policy name uses the format |
ruleNames[]string |
RuleNames identifies the rules to which the exception is applied. |
(Appears on: PolicyException)
PolicyExceptionSpec stores policy exception spec
| Field | Description |
|---|---|
backgroundbool |
Background controls if exceptions are applied to existing policies 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). |
matchMatchResources |
Match defines match clause used to check if a resource applies to the exception |
conditionsAnyAllConditions |
(Optional)
Conditions are used to determine if a resource applies to the exception by evaluating a
set of conditions. The declaration can contain nested |
exceptions[]Exception |
Exceptions is a list policy/rules to be excluded |
podSecurity[]PodSecurityStandard |
(Optional)
PodSecurity specifies the Pod Security Standard controls to be excluded. Applicable only to policies that have validate.podSecurity subrule. |
(Appears on: UpdateRequestSpecContext)
RequestInfo contains permission info carried in an admission request.
| Field | Description |
|---|---|
roles[]string |
(Optional)
Roles is a list of possible role send the request. |
clusterRoles[]string |
(Optional)
ClusterRoles is a list of possible clusterRoles send the request. |
userInfoKubernetes authentication/v1.UserInfo |
(Optional)
UserInfo is the userInfo carried in the admission request. |
synchronizebool |
(Optional)
DryRun indicates that modifications will definitely not be persisted for this request. Defaults to false. |
string alias)(Appears on: UpdateRequestSpec)
(Appears on: UpdateRequestSpec)
| Field | Description |
|---|---|
rulestring |
Rule is the associate rule name of the current UR. |
deleteDownstreambool |
DeleteDownstream represents whether the downstream needs to be deleted. |
synchronizebool |
Synchronize represents the sync behavior of the corresponding rule Optional. Defaults to “false” if not specified. |
triggerResourceSpec |
ResourceSpec is the information to identify the trigger resource. |
cacheRestorebool |
CacheRestore indicates whether the cache should be restored. |
(Appears on: UpdateRequest)
UpdateRequestSpec stores the request specification.
| Field | Description |
|---|---|
requestTypeRequestType |
Type represents request type for background processing |
policystring |
Specifies the name of the policy. |
ruleContext[]RuleContext |
RuleContext is the associate context to apply rules. optional |
rulestring |
Rule is the associate rule name of the current UR. |
deleteDownstreambool |
DeleteDownstream represents whether the downstream needs to be deleted. Deprecated |
synchronizebool |
Synchronize represents the sync behavior of the corresponding rule Optional. Defaults to “false” if not specified. Deprecated, will be removed in 1.14. |
resourceResourceSpec |
ResourceSpec is the information to identify the trigger resource. |
contextUpdateRequestSpecContext |
Context represents admission request context. It is used upon admission review only and is shared across rules within the same UR. |
(Appears on: UpdateRequestSpec)
UpdateRequestSpecContext stores the context to be shared.
| Field | Description |
|---|---|
userInfoRequestInfo |
(Optional) |
admissionRequestInfoAdmissionRequestInfoObject |
(Optional) |
string alias)(Appears on: UpdateRequestStatus)
UpdateRequestState defines the state of request.
(Appears on: UpdateRequest)
UpdateRequestStatus defines the observed state of UpdateRequest
| Field | Description |
|---|---|
stateUpdateRequestState |
State represents state of the update request. |
messagestring |
(Optional)
Specifies request status message. |
generatedResources[]ResourceSpec |
This will track the resources that are updated by the generate Policy. Will be used during clean up resources. |
retryCountint |
Resource Types:
GlobalContextEntry declares resources to be cached.
| Field | Description | ||||||
|---|---|---|---|---|---|---|---|
apiVersionstring |
kyverno.io/v2alpha1
|
||||||
kindstring |
GlobalContextEntry |
||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||
specGlobalContextEntrySpec |
Spec declares policy exception behaviors.
|
||||||
statusGlobalContextEntryStatus |
(Optional)
Status contains globalcontextentry runtime data. |
(Appears on: GlobalContextEntrySpec)
| Field | Description |
|---|---|
APICallAPICall |
(Members of |
refreshIntervalKubernetes meta/v1.Duration |
RefreshInterval defines the interval in duration at which to poll the APICall. The duration is a sequence of decimal numbers, each with optional fraction and a unit suffix, such as “300ms”, “1.5h” or “2h45m”. Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”. |
retryLimitint |
(Optional)
RetryLimit defines the number of times the APICall should be retried in case of failure. |
(Appears on: GlobalContextEntrySpec)
| Field | Description |
|---|---|
namestring |
Name is the name to use for the extracted value in the context. |
jmesPathstring |
JMESPath is the JMESPath expression to extract the value from the cached resource. |
(Appears on: GlobalContextEntry)
GlobalContextEntrySpec stores policy exception spec
| Field | Description |
|---|---|
kubernetesResourceKubernetesResource |
Stores a list of Kubernetes resources which will be cached. Mutually exclusive with APICall. |
apiCallExternalAPICall |
Stores results from an API call which will be cached. Mutually exclusive with KubernetesResource. This can be used to make calls to external (non-Kubernetes API server) services. It can also be used to make calls to the Kubernetes API server in such cases: 1. A POST is needed to create a resource. 2. Finer-grained control is needed. Example: To restrict the number of resources cached. |
projections[]GlobalContextEntryProjection |
Projections defines the list of JMESPath expressions to extract values from the cached resource. |
(Appears on: GlobalContextEntry)
| Field | Description |
|---|---|
readybool |
Deprecated in favor of Conditions |
conditions[]Kubernetes meta/v1.Condition |
(Optional) |
lastRefreshTimeKubernetes meta/v1.Time |
(Optional)
Indicates the time when the globalcontextentry was last refreshed successfully for the API Call |
(Appears on: GlobalContextEntrySpec)
KubernetesResource stores infos about kubernetes resource that should be cached
| Field | Description |
|---|---|
groupstring |
Group defines the group of the resource. |
versionstring |
Version defines the version of the resource. |
resourcestring |
Resource defines the type of the resource. Requires the pluralized form of the resource kind in lowercase. (Ex., “deployments”) |
namespacestring |
(Optional)
Namespace defines the namespace of the resource. Leave empty for cluster scoped resources. If left empty for namespaced resources, all resources from all namespaces will be cached. |
CleanupPolicy defines a rule for resource cleanup.
| Field | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
kyverno.io/v2beta1
|
||||||||||||
kindstring |
CleanupPolicy |
||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||
specCleanupPolicySpec |
Spec declares policy behaviors.
|
||||||||||||
statusCleanupPolicyStatus |
(Optional)
Status contains policy runtime data. |
ClusterCleanupPolicy defines rule for resource cleanup.
| Field | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
kyverno.io/v2beta1
|
||||||||||||
kindstring |
ClusterCleanupPolicy |
||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||
specCleanupPolicySpec |
Spec declares policy behaviors.
|
||||||||||||
statusCleanupPolicyStatus |
(Optional)
Status contains policy runtime data. |
ClusterPolicy declares validation, mutation, and generation behaviors for matching resources.
| Field | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
kyverno.io/v2beta1
|
||||||||||||||||||||||||||||||
kindstring |
ClusterPolicy |
||||||||||||||||||||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||||||||||||||||||||
specSpec |
Spec declares policy behaviors.
|
||||||||||||||||||||||||||||||
statusPolicyStatus |
(Optional)
Status contains policy runtime data. |
Policy declares validation, mutation, and generation behaviors for matching resources. See: https://kyverno.io/docs/writing-policies/ for more information.
| Field | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
kyverno.io/v2beta1
|
||||||||||||||||||||||||||||||
kindstring |
Policy |
||||||||||||||||||||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||||||||||||||||||||
specSpec |
Spec defines policy behaviors and contains one or more rules.
|
||||||||||||||||||||||||||||||
statusPolicyStatus |
(Optional)
Status contains policy runtime data. |
PolicyException declares resources to be excluded from specified policies.
| Field | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
kyverno.io/v2beta1
|
||||||||||
kindstring |
PolicyException |
||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||
specPolicyExceptionSpec |
Spec declares policy exception behaviors.
|
(Appears on: CleanupPolicySpec, Deny, PolicyExceptionSpec, Rule)
| Field | Description |
|---|---|
any[]Condition |
(Optional)
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 |
(Optional)
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. |
(Appears on: CleanupPolicy, ClusterCleanupPolicy)
CleanupPolicySpec stores specifications for selecting resources that the user needs to delete and schedule when the matching resources needs deleted.
| Field | Description |
|---|---|
context[]ContextEntry |
(Optional)
Context defines variables and data sources that can be used during rule execution. |
matchMatchResources |
MatchResources defines when cleanuppolicy 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. |
excludeMatchResources |
(Optional)
ExcludeResources defines when cleanuppolicy 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. |
schedulestring |
The schedule in Cron format |
conditionsAnyAllConditions |
(Optional)
Conditions defines the conditions used to select the resources which will be cleaned up. |
deletionPropagationPolicyKubernetes meta/v1.DeletionPropagation |
(Optional)
DeletionPropagationPolicy defines how resources will be deleted (Foreground, Background, Orphan). |
(Appears on: CleanupPolicy, ClusterCleanupPolicy)
CleanupPolicyStatus stores the status of the policy.
| Field | Description |
|---|---|
conditions[]Kubernetes meta/v1.Condition |
|
lastExecutionTimeKubernetes meta/v1.Time |
(Appears on: AnyAllConditions)
| Field | Description |
|---|---|
keygithub.com/kyverno/kyverno/api/kyverno.Any |
Key is the context entry (using JMESPath) for conditional rule evaluation. |
operatorConditionOperator |
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 |
valuegithub.com/kyverno/kyverno/api/kyverno.Any |
Value is the conditional value, or set of values. The values can be fixed set or can be variables declared using JMESPath. |
messagestring |
Message is an optional display message |
string alias)(Appears on: Condition)
ConditionOperator is the operation performed on condition key and value.
(Appears on: Validation)
Deny specifies a list of conditions used to pass or fail a validation rule.
| Field | Description |
|---|---|
conditionsAnyAllConditions |
Multiple conditions can be declared under an |
(Appears on: PolicyExceptionSpec)
Exception stores infos about a policy and rules
| Field | Description |
|---|---|
policyNamestring |
PolicyName identifies the policy to which the exception is applied.
The policy name uses the format |
ruleNames[]string |
RuleNames identifies the rules to which the exception is applied. |
(Appears on: 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 |
|---|---|
failureActionValidationFailureAction |
(Optional)
Allowed values are Audit or Enforce. |
typeImageVerificationType |
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. |
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. |
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. |
repositorystring |
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. |
mutateDigestbool |
MutateDigest enables replacement of image tags with digests. Defaults to true. |
verifyDigestbool |
VerifyDigest validates that images have a digest. |
validateValidateImageVerification |
Validation checks conditions across multiple image verification attestations or context entries |
requiredbool |
Required validates that images are verified i.e. have matched passed a signature or attestation check. |
imageRegistryCredentialsImageRegistryCredentials |
ImageRegistryCredentials provides credentials that will be used for authentication with registry |
useCachebool |
UseCache enables caching of image verify responses for this rule |
(Appears on: CleanupPolicySpec, PolicyExceptionSpec, CleanupPolicySpec, PolicyExceptionSpec, Rule)
MatchResources is used to specify resource and admission review request data for which a policy rule is applicable.
| Field | Description |
|---|---|
anyResourceFilters |
(Optional)
Any allows specifying resources which will be ORed |
allResourceFilters |
(Optional)
All allows specifying resources which will be ANDed |
(Appears on: PolicyException)
PolicyExceptionSpec stores policy exception spec
| Field | Description |
|---|---|
backgroundbool |
Background controls if exceptions are applied to existing policies 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). |
matchMatchResources |
Match defines match clause used to check if a resource applies to the exception |
conditionsAnyAllConditions |
(Optional)
Conditions are used to determine if a resource applies to the exception by evaluating a
set of conditions. The declaration can contain nested |
exceptions[]Exception |
Exceptions is a list policy/rules to be excluded |
podSecurity[]PodSecurityStandard |
(Optional)
PodSecurity specifies the Pod Security Standard controls to be excluded. Applicable only to policies that have validate.podSecurity subrule. |
(Appears on: ResourceFilter)
ResourceDescription contains criteria used to match resources.
| Field | Description |
|---|---|
kinds[]string |
(Optional)
Kinds is a list of resource kinds. |
names[]string |
(Optional)
Names are the names of the resources. Each name supports wildcard characters “*” (matches zero or many characters) and “?” (at least one character). |
namespaces[]string |
(Optional)
Namespaces is a list of namespaces names. Each name supports wildcard characters “*” (matches zero or many characters) and “?” (at least one character). |
annotationsmap[string]string |
(Optional)
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). |
selectorKubernetes meta/v1.LabelSelector |
(Optional)
Selector is a label selector. Label keys and values in |
namespaceSelectorKubernetes meta/v1.LabelSelector |
(Optional)
NamespaceSelector is a label selector for the resource namespace. Label keys and values
in |
operations[]AdmissionOperation |
(Optional)
Operations can contain values [“CREATE, “UPDATE”, “CONNECT”, “DELETE”], which are used to match a specific action. |
ResourceFilter allow users to “AND” or “OR” between resources
| Field | Description |
|---|---|
UserInfoUserInfo |
(Optional)
UserInfo contains information about the user performing the operation. |
resourcesResourceDescription |
ResourceDescription contains information about the resource being created or modified. |
[]github.com/kyverno/kyverno/api/kyverno/v2beta1.ResourceFilter alias)
ResourceFilters is a slice of ResourceFilter
(Appears on: 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 |
|---|---|
namestring |
Name is a label to identify the rule, It must be unique within the policy. |
context[]ContextEntry |
(Optional)
Context defines variables and data sources that can be used during rule execution. |
matchMatchResources |
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. |
excludeMatchResources |
(Optional)
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. |
imageExtractorsImageExtractorConfigs |
(Optional)
ImageExtractors defines a mapping from kinds to ImageExtractorConfigs. This config is only valid for verifyImages rules. |
preconditionsAnyAllConditions |
(Optional)
Preconditions are used to determine if a policy rule should be applied by evaluating a
set of conditions. The declaration can contain nested |
celPreconditions[]Kubernetes admissionregistration/v1.MatchCondition |
(Optional)
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 |
mutateMutation |
(Optional)
Mutation is used to modify matching resources. |
validateValidation |
(Optional)
Validation is used to validate matching resources. |
generateGeneration |
(Optional)
Generation is used to create new resources. |
verifyImages[]ImageVerification |
(Optional)
VerifyImages is used to verify image signatures and mutate them to add a digest |
skipBackgroundRequestsbool |
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. |
(Appears on: 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. |
applyRulesApplyRulesType |
(Optional)
ApplyRules controls how rules in a policy are applied. Rule are processed in
the order of declaration. When set to |
failurePolicyFailurePolicyType |
Deprecated, use failurePolicy under the webhookConfiguration instead. |
validationFailureActionValidationFailureAction |
Deprecated, use validationFailureAction under the validate rule instead. |
validationFailureActionOverrides[]ValidationFailureActionOverride |
Deprecated, use validationFailureActionOverrides under the validate rule instead. |
emitWarningbool |
(Optional)
EmitWarning enables API response warnings for mutate policy rules or validate policy rules with validationFailureAction set to Audit. Enabling this option will extend admission request processing times. The default value is “false”. |
admissionbool |
(Optional)
Admission controls if rules are applied during admission. Optional. Default value is “true”. |
backgroundbool |
(Optional)
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). |
schemaValidationbool |
Deprecated. |
webhookTimeoutSecondsint32 |
Deprecated, use webhookTimeoutSeconds under webhookConfiguration instead. |
mutateExistingOnPolicyUpdatebool |
(Optional)
Deprecated, use mutateExistingOnPolicyUpdate under the mutate rule instead |
generateExistingOnPolicyUpdatebool |
(Optional)
Deprecated, use generateExisting instead |
generateExistingbool |
Deprecated, use generateExisting under the generate rule instead |
useServerSideApplybool |
(Optional)
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. |
webhookConfigurationWebhookConfiguration |
(Optional)
WebhookConfiguration specifies the custom configuration for Kubernetes admission webhookconfiguration. |
(Appears on: Rule)
Validation defines checks to be performed on matching resources.
| Field | Description |
|---|---|
failureActionValidationFailureAction |
(Optional)
FailureAction 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. |
failureActionOverrides[]ValidationFailureActionOverride |
(Optional)
FailureActionOverrides is a Cluster Policy attribute that specifies FailureAction namespace-wise. It overrides FailureAction for the specified namespaces. |
messagestring |
(Optional)
Message specifies a custom message to be displayed on failure. |
manifestsManifests |
(Optional)
Manifest specifies conditions for manifest verification |
foreach[]ForEachValidation |
(Optional)
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. |
patterngithub.com/kyverno/kyverno/api/kyverno.Any |
Pattern specifies an overlay-style pattern used to check resources. |
anyPatterngithub.com/kyverno/kyverno/api/kyverno.Any |
AnyPattern specifies list of validation patterns. At least one of the patterns must be satisfied for the validation rule to succeed. |
denyDeny |
(Optional)
Deny defines conditions used to pass or fail a validation rule. |
podSecurityPodSecurity |
(Optional)
PodSecurity applies exemptions for Kubernetes Pod Security admission by specifying exclusions for Pod Security Standards controls. |
celCEL |
(Optional)
CEL allows validation checks using the Common Expression Language (https://kubernetes.io/docs/reference/using-api/cel/). |
assertgithub.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any |
(Optional)
Assert defines a kyverno-json assertion tree. |
Resource Types:
| Field | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
policies.kyverno.io/v1alpha1
|
||||||||||
kindstring |
DeletingPolicy |
||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||
specDeletingPolicySpec |
|
||||||||||
statusDeletingPolicyStatus |
(Optional)
Status contains policy runtime data. |
| Field | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
policies.kyverno.io/v1alpha1
|
||||||||||||
kindstring |
GeneratingPolicy |
||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||
specGeneratingPolicySpec |
|
||||||||||||
statusGeneratingPolicyStatus |
(Optional)
Status contains policy runtime data. |
| Field | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
policies.kyverno.io/v1alpha1
|
||||||||||||||||||||||||||||||||
kindstring |
ImageValidatingPolicy |
||||||||||||||||||||||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||||||||||||||||||||||
specImageValidatingPolicySpec |
|
||||||||||||||||||||||||||||||||
statusImageValidatingPolicyStatus |
(Optional)
Status contains policy runtime data. |
| Field | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
policies.kyverno.io/v1alpha1
|
||||||||||||||||||||
kindstring |
MutatingPolicy |
||||||||||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||||||||||
specMutatingPolicySpec |
|
||||||||||||||||||||
statusMutatingPolicyStatus |
(Optional)
Status contains policy runtime data. |
PolicyException declares resources to be excluded from specified policies.
| Field | Description | ||||
|---|---|---|---|---|---|
apiVersionstring |
policies.kyverno.io/v1alpha1
|
||||
kindstring |
PolicyException |
||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||
specPolicyExceptionSpec |
Spec declares policy exception behaviors.
|
| Field | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersionstring |
policies.kyverno.io/v1alpha1
|
||||||||||||||||||||
kindstring |
ValidatingPolicy |
||||||||||||||||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||||||||||
specValidatingPolicySpec |
|
||||||||||||||||||||
statusValidatingPolicyStatus |
(Optional)
Status contains policy runtime data. |
(Appears on: EvaluationConfiguration, GeneratingPolicyEvaluationConfiguration, MutatingPolicyEvaluationConfiguration)
| Field | Description |
|---|---|
enabledbool |
(Optional)
Enabled controls if rules are applied during admission. Optional. Default value is “true”. |
(Appears on: ImageValidatingPolicySpec)
Attestation defines the identification details of the metadata that has to be verified
| Field | Description |
|---|---|
namestring |
Name is the name for this attestation. It is used to refer to the attestation in verification |
intotoInToto |
(Optional)
InToto defines the details of attestation attached using intoto format |
referrerReferrer |
(Optional)
Referrer defines the details of attestation attached using OCI 1.1 format |
(Appears on: ImageValidatingPolicySpec)
Attestor is an identity that confirms or verifies the authenticity of an image or an attestation
| Field | Description |
|---|---|
namestring |
Name is the name for this attestor. It is used to refer to the attestor in verification |
cosignCosign |
(Optional)
Cosign defines attestor configuration for Cosign based signatures |
notaryNotary |
(Optional)
Notary defines attestor configuration for Notary based signatures |
(Appears on: EvaluationConfiguration)
| Field | Description |
|---|---|
enabledbool |
(Optional)
Enabled 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). |
(Appears on: Cosign)
CTLog sets the configuration to verify the authority against a Rekor instance.
| Field | Description |
|---|---|
urlstring |
(Optional)
URL sets the url to the rekor instance (by default the public rekor.sigstore.dev) |
rekorPubKeystring |
(Optional)
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. |
ctLogPubKeystring |
(Optional)
CTLogPubKey, if set, is used to validate SCTs against a custom source. |
tsaCertChainstring |
(Optional)
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. |
insecureIgnoreTlogbool |
(Optional)
InsecureIgnoreTlog skips transparency log verification. |
insecureIgnoreSCTbool |
(Optional)
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. |
(Appears on: Cosign)
Certificate defines the configuration for local signature verification
| Field | Description |
|---|---|
certStringOrExpression |
(Optional)
Certificate is the to the public certificate for local signature verification. |
certChainStringOrExpression |
(Optional)
CertificateChain is the list of CA certificates in PEM format which will be needed when building the certificate chain for the signing certificate. Must start with the parent intermediate CA certificate of the signing certificate and end with the root certificate |
(Appears on: DeletingPolicyStatus, GeneratingPolicyStatus, ImageValidatingPolicyStatus, MutatingPolicyStatus, ValidatingPolicyStatus)
ConditionStatus is the shared status across all policy types
| Field | Description |
|---|---|
readybool |
(Optional)
The ready of a policy is a high-level summary of where the policy is in its lifecycle. The conditions array, the reason and message fields contain more detail about the policy’s status. |
conditions[]Kubernetes meta/v1.Condition |
(Optional) |
messagestring |
(Optional)
Message is a human readable message indicating details about the generation of ValidatingAdmissionPolicy/MutatingAdmissionPolicy It is an empty string when ValidatingAdmissionPolicy/MutatingAdmissionPolicy is successfully generated. |
(Appears on: Attestor)
Cosign defines attestor configuration for Cosign based signatures
| Field | Description |
|---|---|
keyKey |
(Optional)
Key defines the type of key to validate the image. |
keylessKeyless |
(Optional)
Keyless sets the configuration to verify the authority against a Fulcio instance. |
certificateCertificate |
(Optional)
Certificate defines the configuration for local signature verification |
sourceSource |
(Optional)
Sources sets the configuration to specify the sources from where to consume the signature and attestations. |
ctlogCTLog |
(Optional)
CTLog sets the configuration to verify the authority against a Rekor instance. |
tufTUF |
(Optional)
TUF defines the configuration to fetch sigstore root |
annotationsmap[string]string |
(Optional)
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. |
(Appears on: ImageValidatingPolicySpec)
| Field | Description |
|---|---|
allowInsecureRegistrybool |
(Optional)
AllowInsecureRegistry allows insecure access to a registry. |
providers[]CredentialsProvidersType |
(Optional)
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 |
(Optional)
Secrets specifies a list of secrets that are provided for credentials. Secrets must live in the Kyverno namespace. |
string alias)(Appears on: Credentials)
CredentialsProvidersType provides the list of credential providers required.
(Appears on: DeletingPolicy)
DeletingPolicySpec is the specification of the desired behavior of the DeletingPolicy.
| Field | Description |
|---|---|
matchConstraintsKubernetes admissionregistration/v1.MatchResources |
MatchConstraints specifies what resources this policy is designed to validate. The AdmissionPolicy cares about a request if it matches all Constraints. Required. |
conditions[]Kubernetes admissionregistration/v1.MatchCondition |
(Optional)
Conditions is a list of conditions that must be met for a resource to be deleted. Conditions filter resources that have already been matched by the match constraints, namespaceSelector, and objectSelector. An empty list of conditions matches all resources. There are a maximum of 64 conditions allowed. The exact matching logic is (in order): 1. If ANY condition evaluates to FALSE, the policy is skipped. 2. If ALL conditions evaluate to TRUE, the policy is executed. |
variables[]Kubernetes admissionregistration/v1.Variable |
(Optional)
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 The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic. |
schedulestring |
The schedule in Cron format Required. |
deletionPropagationPolicyKubernetes meta/v1.DeletionPropagation |
(Optional)
DeletionPropagationPolicy defines how resources will be deleted (Foreground, Background, Orphan). |
(Appears on: DeletingPolicy)
| Field | Description |
|---|---|
conditionStatusConditionStatus |
(Optional) |
lastExecutionTimeKubernetes meta/v1.Time |
(Appears on: ImageValidatingPolicySpec, ValidatingPolicySpec)
| Field | Description |
|---|---|
modeEvaluationMode |
(Optional)
Mode is the mode of policy evaluation. Allowed values are “Kubernetes” or “JSON”. Optional. Default value is “Kubernetes”. |
admissionAdmissionConfiguration |
(Optional)
Admission controls policy evaluation during admission. |
backgroundBackgroundConfiguration |
(Optional)
Background controls policy evaluation during background scan. |
string alias)(Appears on: EvaluationConfiguration)
(Appears on: GeneratingPolicyEvaluationConfiguration)
GenerateExistingConfiguration defines the configuration for generating resources for existing triggers.
| Field | Description |
|---|---|
enabledbool |
(Optional)
Enabled controls whether to trigger the policy for existing resources If is set to “true” the policy will be triggered and applied to existing matched resources. Optional. Defaults to “false” if not specified. |
(Appears on: GeneratingPolicySpec)
| Field | Description |
|---|---|
admissionAdmissionConfiguration |
(Optional)
Admission controls policy evaluation during admission. |
generateExistingGenerateExistingConfiguration |
(Optional)
GenerateExisting defines the configuration for generating resources for existing triggeres. |
synchronizeSynchronizationConfiguration |
(Optional)
Synchronization defines the configuration for the synchronization of generated resources. |
orphanDownstreamOnPolicyDeleteOrphanDownstreamOnPolicyDeleteConfiguration |
OrphanDownstreamOnPolicyDelete defines the configuration for orphaning downstream resources on policy delete. |
(Appears on: GeneratingPolicy)
GeneratingPolicySpec is the specification of the desired behavior of the GeneratingPolicy.
| Field | Description |
|---|---|
matchConstraintsKubernetes admissionregistration/v1.MatchResources |
MatchConstraints specifies what resources will trigger this policy. The AdmissionPolicy cares about a request if it matches all Constraints. Required. |
matchConditions[]Kubernetes admissionregistration/v1.MatchCondition |
(Optional)
MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed. If a parameter object is provided, it can be accessed via the The exact matching logic is (in order): 1. If ANY matchCondition evaluates to FALSE, the policy is skipped. 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated. 3. If any matchCondition evaluates to an error (but none are FALSE): - If failurePolicy=Fail, reject the request - If failurePolicy=Ignore, the policy is skipped |
variables[]Kubernetes admissionregistration/v1.Variable |
(Optional)
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 The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic. |
evaluationGeneratingPolicyEvaluationConfiguration |
(Optional)
EvaluationConfiguration defines the configuration for the policy evaluation. |
webhookConfigurationWebhookConfiguration |
(Optional)
WebhookConfiguration defines the configuration for the webhook. |
generate[]Generation |
Generation defines a set of CEL expressions that will be evaluated to generate resources. Required. |
(Appears on: GeneratingPolicy)
| Field | Description |
|---|---|
conditionStatusConditionStatus |
(Optional) |
(Appears on: GeneratingPolicySpec)
Generation defines the configuration for the generation of resources.
| Field | Description |
|---|---|
expressionstring |
Expression is a CEL expression that takes a list of resources to be generated. |
(Appears on: Keyless)
Identity may contain the issuer and/or the subject found in the transparency log. Issuer/Subject uses a strict match, while IssuerRegExp and SubjectRegExp apply a regexp for matching.
| Field | Description |
|---|---|
issuerstring |
(Optional)
Issuer defines the issuer for this identity. |
subjectstring |
(Optional)
Subject defines the subject for this identity. |
issuerRegExpstring |
(Optional)
IssuerRegExp specifies a regular expression to match the issuer for this identity. |
subjectRegExpstring |
(Optional)
SubjectRegExp specifies a regular expression to match the subject for this identity. |
(Appears on: ImageValidatingPolicySpec)
| Field | Description |
|---|---|
namestring |
Name is the name for this imageList. It is used to refer to the images in verification block as images. |
expressionstring |
Expression defines CEL expression to extract images from the resource. |
(Appears on: ImageValidatingPolicyAutogenStatus)
| Field | Description |
|---|---|
targets[]Target |
|
specImageValidatingPolicySpec |
|
(Appears on: ImageValidatingPolicySpec)
| Field | Description |
|---|---|
podControllersPodControllersGenerationConfiguration |
PodControllers specifies whether to generate a pod controllers rules. |
(Appears on: ImageValidatingPolicyStatus)
| Field | Description |
|---|---|
configsmap[string]github.com/kyverno/kyverno/api/policies.kyverno.io/v1alpha1.ImageValidatingPolicyAutogen |
(Appears on: ImageValidatingPolicy, ImageValidatingPolicyAutogen)
ImageValidatingPolicySpec is the specification of the desired behavior of the ImageValidatingPolicy.
| Field | Description |
|---|---|
matchConstraintsKubernetes admissionregistration/v1.MatchResources |
(Optional)
MatchConstraints specifies what resources this policy is designed to validate. |
failurePolicyKubernetes admissionregistration/v1.FailurePolicyType |
(Optional)
FailurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings. |
auditAnnotations[]Kubernetes admissionregistration/v1.AuditAnnotation |
(Optional)
auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required. |
validationActions[]Kubernetes admissionregistration/v1.ValidationAction |
ValidationAction specifies the action to be taken when the matched resource violates the policy. Required. |
matchConditions[]Kubernetes admissionregistration/v1.MatchCondition |
(Optional)
MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed. |
variables[]Kubernetes admissionregistration/v1.Variable |
(Optional)
Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. |
validationConfigurationsValidationConfiguration |
(Optional)
ValidationConfigurations defines settings for mutating and verifying image digests, and enforcing image verification through signatures. |
matchImageReferences[]MatchImageReference |
(Optional)
MatchImageReferences is a list of Glob and CELExpressions to match images. Any image that matches one of the rules is considered for validation Any image that does not match a rule is skipped, even when they are passed as arguments to image verification functions |
credentialsCredentials |
Credentials provides credentials that will be used for authentication with registry. |
images[]ImageExtractor |
(Optional)
ImageExtractors is a list of CEL expression to extract images from the resource |
attestors[]Attestor |
Attestors provides a list of trusted authorities. |
attestations[]Attestation |
(Optional)
Attestations provides a list of image metadata to verify |
validations[]Kubernetes admissionregistration/v1.Validation |
Validations contain CEL expressions which is used to apply the image validation checks. |
webhookConfigurationWebhookConfiguration |
(Optional)
WebhookConfiguration defines the configuration for the webhook. |
evaluationEvaluationConfiguration |
(Optional)
EvaluationConfiguration defines the configuration for the policy evaluation. |
autogenImageValidatingPolicyAutogenConfiguration |
(Optional)
AutogenConfiguration defines the configuration for the generation controller. |
(Appears on: ImageValidatingPolicy)
| Field | Description |
|---|---|
conditionStatusConditionStatus |
(Optional) |
autogenImageValidatingPolicyAutogenStatus |
(Optional) |
(Appears on: Attestation)
| Field | Description |
|---|---|
typestring |
Type defines the type of attestation contained within the statement. |
(Appears on: Cosign)
A Key must specify only one of CEL, Data or KMS
| Field | Description |
|---|---|
datastring |
(Optional)
Data contains the inline public key |
kmsstring |
(Optional)
KMS contains the KMS url of the public key Supported formats differ based on the KMS system used. |
hashAlgorithmstring |
(Optional)
HashAlgorithm specifues signature algorithm for public keys. Supported values are sha224, sha256, sha384 and sha512. Defaults to sha256. |
expressionstring |
(Optional)
Expression is a Expression expression that returns the public key. |
(Appears on: Cosign)
Keyless contains location of the validating certificate and the identities against which to verify.
| Field | Description |
|---|---|
identities[]Identity |
Identities sets a list of identities. |
rootsstring |
Roots is an optional set of PEM encoded trusted root certificates. If not provided, the system roots are used. |
(Appears on: MutatingPolicyAutogenConfiguration)
| Field | Description |
|---|---|
enabledbool |
Enabled specifies whether to generate a Kubernetes MutatingAdmissionPolicy. Optional. Defaults to “false” if not specified. |
(Appears on: ImageValidatingPolicySpec)
MatchImageReference defines a Glob or a CEL expression for matching images
| Field | Description |
|---|---|
globstring |
(Optional)
Glob defines a globbing pattern for matching images |
expressionstring |
(Optional)
Expression defines CEL Expressions for matching images |
(Appears on: MutatingPolicyEvaluationConfiguration)
| Field | Description |
|---|---|
enabledbool |
(Optional)
Enabled enables mutation of existing resources. Default is false. When spec.targetMatchConstraints is not defined, Kyverno mutates existing resources matched in spec.matchConstraints. |
(Appears on: MutatingPolicyAutogenStatus)
| Field | Description |
|---|---|
targets[]Target |
|
specMutatingPolicySpec |
|
(Appears on: MutatingPolicySpec)
| Field | Description |
|---|---|
podControllersPodControllersGenerationConfiguration |
PodControllers specifies whether to generate a pod controllers rules. |
mutatingAdmissionPolicyMAPGenerationConfiguration |
MutatingAdmissionPolicy specifies whether to generate a Kubernetes MutatingAdmissionPolicy. |
(Appears on: MutatingPolicyStatus)
| Field | Description |
|---|---|
configsmap[string]github.com/kyverno/kyverno/api/policies.kyverno.io/v1alpha1.MutatingPolicyAutogen |
(Appears on: MutatingPolicySpec)
| Field | Description |
|---|---|
admissionAdmissionConfiguration |
(Optional)
Admission controls policy evaluation during admission. |
mutateExistingMutateExistingConfiguration |
(Optional)
MutateExisting controls whether existing resources are mutated. |
(Appears on: MutatingPolicy, MutatingPolicyAutogen)
MutatingPolicySpec is the specification of the desired behavior of the MutatingPolicy.
| Field | Description |
|---|---|
matchConstraintsKubernetes admissionregistration/v1alpha1.MatchResources |
MatchConstraints specifies what resources this policy is designed to evaluate. The AdmissionPolicy cares about a request if it matches all Constraints. Required. |
failurePolicyKubernetes admissionregistration/v1alpha1.FailurePolicyType |
(Optional)
failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings. failurePolicy does not define how validations that evaluate to false are handled. When failurePolicy is set to Fail, the validationActions field define how failures are enforced. Allowed values are Ignore or Fail. Defaults to Fail. |
matchConditions[]Kubernetes admissionregistration/v1alpha1.MatchCondition |
(Optional)
MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed. If a parameter object is provided, it can be accessed via the The exact matching logic is (in order): 1. If ANY matchCondition evaluates to FALSE, the policy is skipped. 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated. 3. If any matchCondition evaluates to an error (but none are FALSE): - If failurePolicy=Fail, reject the request - If failurePolicy=Ignore, the policy is skipped |
variables[]Kubernetes admissionregistration/v1alpha1.Variable |
(Optional)
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 The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic. |
autogenMutatingPolicyAutogenConfiguration |
(Optional)
AutogenConfiguration defines the configuration for the generation controller. |
targetMatchConstraintsKubernetes admissionregistration/v1alpha1.MatchResources |
(Optional)
TargetMatchConstraints specifies what target mutation resources this policy is designed to evaluate. |
mutations[]Kubernetes admissionregistration/v1alpha1.Mutation |
(Optional)
mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis. |
webhookConfigurationWebhookConfiguration |
(Optional)
WebhookConfiguration defines the configuration for the webhook. |
evaluationMutatingPolicyEvaluationConfiguration |
(Optional)
EvaluationConfiguration defines the configuration for mutating policy evaluation. |
reinvocationPolicyKubernetes admissionregistration/v1.ReinvocationPolicyType |
reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are “Never” and “IfNeeded”. Never: These mutations will not be called more than once per binding in a single admission evaluation. IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required. |
(Appears on: MutatingPolicy)
| Field | Description |
|---|---|
conditionStatusConditionStatus |
(Optional) |
autogenMutatingPolicyAutogenStatus |
(Optional) |
generatedbool |
(Optional)
Generated indicates whether a MutatingAdmissionPolicy is generated from the policy or not |
(Appears on: Attestor)
Notary defines attestor configuration for Notary based signatures
| Field | Description |
|---|---|
certsStringOrExpression |
(Optional)
Certs define the cert chain for Notary signature verification |
tsaCertsStringOrExpression |
(Optional)
TSACerts define the cert chain for verifying timestamps of notary signature |
(Appears on: GeneratingPolicyEvaluationConfiguration)
OrphanDownstreamOnPolicyDeleteConfiguration defines the configuration for orphaning downstream resources on policy delete.
| Field | Description |
|---|---|
enabledbool |
(Optional)
Enabled controls whether generated resources should be deleted when the policy that generated them is deleted with synchronization enabled. This option is only applicable to generate rules of the data type. Optional. Defaults to “false” if not specified. |
(Appears on: ImageValidatingPolicyAutogenConfiguration, MutatingPolicyAutogenConfiguration, ValidatingPolicyAutogenConfiguration)
| Field | Description |
|---|---|
controllers[]string |
string alias)
(Appears on: PolicyException)
PolicyExceptionSpec stores policy exception spec
| Field | Description |
|---|---|
policyRefs[]PolicyRef |
PolicyRefs identifies the policies to which the exception is applied. |
matchConditions[]Kubernetes admissionregistration/v1.MatchCondition |
(Optional)
MatchConditions is a list of CEL expressions that must be met for a resource to be excluded. |
(Appears on: PolicyExceptionSpec)
| Field | Description |
|---|---|
namestring |
Name is the name of the policy |
kindstring |
Kind is the kind of the policy |
(Appears on: Attestation)
| Field | Description |
|---|---|
typestring |
Type defines the type of attestation attached to the image. |
(Appears on: Cosign)
Source specifies the location of the signature / attestations.
| Field | Description |
|---|---|
repositorystring |
(Optional)
Repository defines the location from where to pull the signature / attestations. |
PullSecrets[]Kubernetes core/v1.LocalObjectReference |
(Optional)
SignaturePullSecrets is an optional list of references to secrets in the same namespace as the deploying resource for pulling any of the signatures used by this Source. |
tagPrefixstring |
(Optional)
TagPrefix is an optional prefix that signature and attestations have. This is the ‘tag based discovery’ and in the future once references are fully supported that should likely be the preferred way to handle these. |
(Appears on: Certificate, Notary)
StringOrExpression contains either a raw string input or a CEL expression
| Field | Description |
|---|---|
valuestring |
(Optional)
Value defines the raw string input. |
expressionstring |
(Optional)
Expression defines the a CEL expression input. |
(Appears on: GeneratingPolicyEvaluationConfiguration)
SynchronizationConfiguration defines the configuration for the synchronization of generated resources.
| Field | Description |
|---|---|
enabledbool |
(Optional)
Enabled 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. |
(Appears on: Cosign)
TUF defines the configuration to fetch sigstore root
| Field | Description |
|---|---|
rootTUFRoot |
(Optional)
Root defines the path or data of the trusted root |
mirrorstring |
(Optional)
Mirror is the base URL of Sigstore TUF repository |
(Appears on: TUF)
TUFRoot defines the path or data of the trusted root
| Field | Description |
|---|---|
pathstring |
(Optional)
Path is the URL or File location of the TUF root |
datastring |
(Optional)
Data is the base64 encoded TUF root |
(Appears on: ImageValidatingPolicyAutogen, MutatingPolicyAutogen, ValidatingPolicyAutogen)
| Field | Description |
|---|---|
groupstring |
|
versionstring |
|
resourcestring |
|
kindstring |
(Appears on: ValidatingPolicyAutogenStatus)
| Field | Description |
|---|---|
targets[]Target |
|
specValidatingPolicySpec |
|
(Appears on: ValidatingPolicySpec)
| Field | Description |
|---|---|
podControllersPodControllersGenerationConfiguration |
PodControllers specifies whether to generate a pod controllers rules. |
validatingAdmissionPolicyVapGenerationConfiguration |
ValidatingAdmissionPolicy specifies whether to generate a Kubernetes ValidatingAdmissionPolicy. |
(Appears on: ValidatingPolicyStatus)
| Field | Description |
|---|---|
configsmap[string]github.com/kyverno/kyverno/api/policies.kyverno.io/v1alpha1.ValidatingPolicyAutogen |
(Appears on: ValidatingPolicy, ValidatingPolicyAutogen)
ValidatingPolicySpec is the specification of the desired behavior of the ValidatingPolicy.
| Field | Description |
|---|---|
matchConstraintsKubernetes admissionregistration/v1.MatchResources |
MatchConstraints specifies what resources this policy is designed to validate. The AdmissionPolicy cares about a request if it matches all Constraints. Required. |
validations[]Kubernetes admissionregistration/v1.Validation |
(Optional)
Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required. |
failurePolicyKubernetes admissionregistration/v1.FailurePolicyType |
(Optional)
failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings. failurePolicy does not define how validations that evaluate to false are handled. When failurePolicy is set to Fail, the validationActions field define how failures are enforced. Allowed values are Ignore or Fail. Defaults to Fail. |
auditAnnotations[]Kubernetes admissionregistration/v1.AuditAnnotation |
(Optional)
auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required. |
matchConditions[]Kubernetes admissionregistration/v1.MatchCondition |
(Optional)
MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed. If a parameter object is provided, it can be accessed via the The exact matching logic is (in order): 1. If ANY matchCondition evaluates to FALSE, the policy is skipped. 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated. 3. If any matchCondition evaluates to an error (but none are FALSE): - If failurePolicy=Fail, reject the request - If failurePolicy=Ignore, the policy is skipped |
variables[]Kubernetes admissionregistration/v1.Variable |
(Optional)
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 The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic. |
autogenValidatingPolicyAutogenConfiguration |
(Optional)
AutogenConfiguration defines the configuration for the generation controller. |
validationActions[]Kubernetes admissionregistration/v1.ValidationAction |
ValidationAction specifies the action to be taken when the matched resource violates the policy. Required. |
webhookConfigurationWebhookConfiguration |
(Optional)
WebhookConfiguration defines the configuration for the webhook. |
evaluationEvaluationConfiguration |
(Optional)
EvaluationConfiguration defines the configuration for the policy evaluation. |
(Appears on: ValidatingPolicy)
| Field | Description |
|---|---|
conditionStatusConditionStatus |
(Optional) |
autogenValidatingPolicyAutogenStatus |
(Optional) |
generatedbool |
(Optional)
Generated indicates whether a ValidatingAdmissionPolicy/MutatingAdmissionPolicy is generated from the policy or not |
(Appears on: ImageValidatingPolicySpec)
| Field | Description |
|---|---|
mutateDigestbool |
(Optional)
MutateDigest enables replacement of image tags with digests. Defaults to true. |
verifyDigestbool |
(Optional)
VerifyDigest validates that images have a digest. |
requiredbool |
(Optional)
Required validates that images are verified, i.e., have passed a signature or attestation check. |
(Appears on: ValidatingPolicyAutogenConfiguration)
| Field | Description |
|---|---|
enabledbool |
Enabled specifies whether to generate a Kubernetes ValidatingAdmissionPolicy. Optional. Defaults to “false” if not specified. |
(Appears on: GeneratingPolicySpec, ImageValidatingPolicySpec, MutatingPolicySpec, ValidatingPolicySpec)
| Field | Description |
|---|---|
timeoutSecondsint32 |
TimeoutSeconds 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. |
Resource Types:
ClusterEphemeralReport is the Schema for the ClusterEphemeralReports API
| Field | Description | ||||||
|---|---|---|---|---|---|---|---|
apiVersionstring |
reports.kyverno.io/v1
|
||||||
kindstring |
ClusterEphemeralReport |
||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||
specEphemeralReportSpec |
|
EphemeralReport is the Schema for the EphemeralReports API
| Field | Description | ||||||
|---|---|---|---|---|---|---|---|
apiVersionstring |
reports.kyverno.io/v1
|
||||||
kindstring |
EphemeralReport |
||||||
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||
specEphemeralReportSpec |
|
(Appears on: ClusterEphemeralReport, EphemeralReport)
| Field | Description |
|---|---|
ownerKubernetes meta/v1.OwnerReference |
Owner is a reference to the report owner (e.g. a Deployment, Namespace, or Node) |
summaryopenreports.io/apis/openreports.io/v1alpha1.ReportSummary |
(Optional)
PolicyReportSummary provides a summary of results |
results[]openreports.io/apis/openreports.io/v1alpha1.ReportResult |
(Optional)
PolicyReportResult provides result details |
ReportInterface abstracts the concrete report change request type
ClusterPolicyReport is the Schema for the clusterpolicyreports API
| Field | Description |
|---|---|
apiVersionstring |
wgpolicyk8s.io/v1alpha2
|
kindstring |
ClusterPolicyReport |
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
scopeKubernetes core/v1.ObjectReference |
(Optional)
Scope is an optional reference to the report scope (e.g. a Deployment, Namespace, or Node) |
scopeSelectorKubernetes meta/v1.LabelSelector |
(Optional)
ScopeSelector is an optional selector for multiple scopes (e.g. Pods). Either one of, or none of, but not both of, Scope or ScopeSelector should be specified. |
summaryPolicyReportSummary |
(Optional)
PolicyReportSummary provides a summary of results |
results[]PolicyReportResult |
(Optional)
PolicyReportResult provides result details |
PolicyReport is the Schema for the policyreports API
| Field | Description |
|---|---|
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
scopeKubernetes core/v1.ObjectReference |
(Optional)
Scope is an optional reference to the report scope (e.g. a Deployment, Namespace, or Node) |
scopeSelectorKubernetes meta/v1.LabelSelector |
(Optional)
ScopeSelector is an optional selector for multiple scopes (e.g. Pods). Either one of, or none of, but not both of, Scope or ScopeSelector should be specified. |
summaryPolicyReportSummary |
(Optional)
PolicyReportSummary provides a summary of results |
results[]PolicyReportResult |
(Optional)
PolicyReportResult provides result details |
(Appears on: ClusterPolicyReport, PolicyReport)
PolicyReportResult provides the result for an individual policy
| Field | Description |
|---|---|
sourcestring |
(Optional)
Source is an identifier for the policy engine that manages this report |
policystring |
Policy is the name or identifier of the policy |
rulestring |
(Optional)
Rule is the name or identifier of the rule within the policy |
resources[]Kubernetes core/v1.ObjectReference |
(Optional)
Subjects is an optional reference to the checked Kubernetes resources |
resourceSelectorKubernetes meta/v1.LabelSelector |
(Optional)
SubjectSelector is an optional label selector for checked Kubernetes resources. For example, a policy result may apply to all pods that match a label. Either a Subject or a SubjectSelector can be specified. If neither are provided, the result is assumed to be for the policy report scope. |
messagestring |
Description is a short user friendly message for the policy rule |
resultPolicyResult |
Result indicates the outcome of the policy rule execution |
scoredbool |
Scored indicates if this result is scored |
propertiesmap[string]string |
Properties provides additional information for the policy rule |
timestampKubernetes meta/v1.Timestamp |
Timestamp indicates the time the result was found |
categorystring |
(Optional)
Category indicates policy category |
severityPolicySeverity |
(Optional)
Severity indicates policy check result criticality |
(Appears on: ClusterPolicyReport, PolicyReport)
PolicyReportSummary provides a status count summary
| Field | Description |
|---|---|
passint |
(Optional)
Pass provides the count of policies whose requirements were met |
failint |
(Optional)
Fail provides the count of policies whose requirements were not met |
warnint |
(Optional)
Warn provides the count of non-scored policies whose requirements were not met |
errorint |
(Optional)
Error provides the count of policies that could not be evaluated |
skipint |
(Optional)
Skip indicates the count of policies that were not selected for evaluation |
string alias)(Appears on: PolicyReportResult)
PolicyResult has one of the following values: - pass: indicates that the policy requirements are met - fail: indicates that the policy requirements are not met - warn: indicates that the policy requirements and not met, and the policy is not scored - error: indicates that the policy could not be evaluated - skip: indicates that the policy was not selected based on user inputs or applicability
string alias)(Appears on: PolicyReportResult)
PolicySeverity has one of the following values: - critical - high - low - medium - info