1package v1
2
3import (
4 "strings"
5 "time"
6)
7
8// Policy declares validation, mutation, and generation behaviors for matching resources.
9// See: https://kyverno.io/docs/writing-policies/ for more information.
10#Policy: {
11 _embeddedResource
12
13 // APIVersion defines the versioned schema of this representation of an object.
14 // Servers should convert recognized schemas to the latest internal value, and
15 // may reject unrecognized values.
16 // More info:
17 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
18 apiVersion?: string
19
20 // Kind is a string value representing the REST resource this object represents.
21 // Servers may infer this from the endpoint the client submits requests to.
22 // Cannot be updated.
23 // In CamelCase.
24 // More info:
25 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
26 kind?: string
27 metadata?: {}
28
29 // Spec defines policy behaviors and contains one or more rules.
30 spec!: {
31 // Admission controls if rules are applied during admission.
32 // Optional. Default value is "true".
33 admission?: bool
34
35 // ApplyRules controls how rules in a policy are applied. Rule are processed in
36 // the order of declaration. When set to `One` processing stops after a rule has
37 // been applied i.e. the rule matches and results in a pass, fail, or error. When
38 // set to `All` all rules in the policy are processed. The default is `All`.
39 applyRules?: "All" | "One"
40
41 // Background controls if rules are applied to existing resources during a background scan.
42 // Optional. Default value is "true". The value must be set to "false" if the policy rule
43 // uses variables that are only available in the admission review request (e.g. user name).
44 background?: bool
45
46 // EmitWarning enables API response warnings for mutate policy rules or validate
47 // policy rules with validationFailureAction set to Audit.
48 // Enabling this option will extend admission request processing times. The
49 // default value is "false".
50 emitWarning?: bool
51
52 // Deprecated, use failurePolicy under the webhookConfiguration instead.
53 failurePolicy?: "Ignore" | "Fail"
54
55 // Deprecated, use generateExisting under the generate rule instead
56 generateExisting?: bool
57
58 // Deprecated, use generateExisting instead
59 generateExistingOnPolicyUpdate?: bool
60
61 // Deprecated, use mutateExistingOnPolicyUpdate under the mutate rule instead
62 mutateExistingOnPolicyUpdate?: bool
63
64 // Rules is a list of Rule instances. A Policy contains multiple rules and
65 // each rule can validate, mutate, or generate resources.
66 rules?: [...{
67 // CELPreconditions are used to determine if a policy rule should be applied by evaluating a
68 // set of CEL conditions. It can only be used with the validate.cel subrule
69 celPreconditions?: [...{
70 // Expression represents the expression which will be evaluated by CEL. Must evaluate to bool.
71 // CEL expressions have access to the contents of the AdmissionRequest and
72 // Authorizer, organized into CEL variables:
73 //
74 // 'object' - The object from the incoming request. The value is null for DELETE requests.
75 // 'oldObject' - The existing object. The value is null for CREATE requests.
76 // 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest).
77 // 'authorizer' - A CEL Authorizer. May be used to perform authorization checks
78 // for the principal (user or service account) of the request.
79 // See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
80 // 'authorizer.requestResource' - A CEL ResourceCheck constructed from the
81 // 'authorizer' and configured with the
82 // request resource.
83 // Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
84 //
85 // Required.
86 expression!: string
87
88 // Name is an identifier for this match condition, used for strategic merging of MatchConditions,
89 // as well as providing an identifier for logging purposes. A good name should be descriptive of
90 // the associated expression.
91 // Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and
92 // must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or
93 // '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an
94 // optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
95 //
96 // Required.
97 name!: string
98 }]
99
100 // Context defines variables and data sources that can be used during rule execution.
101 context?: [...matchN(1, [
102 {configMap!: _}, {apiCall!: _}, {imageRegistry!: _}, {variable!: _}, {globalReference!: _},
103 ]) & {
104 // APICall is an HTTP request to the Kubernetes API server, or other JSON web service.
105 // The data returned is stored in the context with the name for the context entry.
106 apiCall?: {
107 // The data object specifies the POST data sent to the server.
108 // Only applicable when the method field is set to POST.
109 data?: [...{
110 // Key is a unique identifier for the data value
111 key!: string
112
113 // Value is the data value
114 value!: null | bool | number | string | [...] | {...}
115 }]
116
117 // Default is an optional arbitrary JSON object that the context
118 // value is set to, if the apiCall returns error.
119 default?: null | bool | number | string | [...] | {...}
120
121 // JMESPath is an optional JSON Match Expression that can be used to
122 // transform the JSON response returned from the server. For example
123 // a JMESPath of "items | length(@)" applied to the API server response
124 // for the URLPath "/apis/apps/v1/deployments" will return the total count
125 // of deployments across all namespaces.
126 jmesPath?: string
127
128 // Method is the HTTP request type (GET or POST). Defaults to GET.
129 method?: "GET" | "POST"
130
131 // Service is an API call to a JSON web service.
132 // This is used for non-Kubernetes API server calls.
133 // It's mutually exclusive with the URLPath field.
134 service?: {
135 // CABundle is a PEM encoded CA bundle which will be used to validate
136 // the server certificate.
137 caBundle?: string
138
139 // Headers is a list of optional HTTP headers to be included in the request.
140 headers?: [...{
141 // Key is the header key
142 key!: string
143
144 // Value is the header value
145 value!: string
146 }]
147
148 // URL is the JSON web service URL. A typical form is
149 // `https://{service}.{namespace}:{port}/{path}`.
150 url!: string
151 }
152
153 // URLPath is the URL path to be used in the HTTP GET or POST request to the
154 // Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
155 // The format required is the same format used by the `kubectl get --raw` command.
156 // See
157 // https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls
158 // for details.
159 // It's mutually exclusive with the Service field.
160 urlPath?: string
161 }
162
163 // ConfigMap is the ConfigMap reference.
164 configMap?: {
165 // Name is the ConfigMap name.
166 name!: string
167
168 // Namespace is the ConfigMap namespace.
169 namespace?: string
170 }
171
172 // GlobalContextEntryReference is a reference to a cached global context entry.
173 globalReference?: {
174 // JMESPath is an optional JSON Match Expression that can be used to
175 // transform the JSON response returned from the server. For example
176 // a JMESPath of "items | length(@)" applied to the API server response
177 // for the URLPath "/apis/apps/v1/deployments" will return the total count
178 // of deployments across all namespaces.
179 jmesPath?: string
180
181 // Name of the global context entry
182 name!: string
183 }
184
185 // ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image
186 // details.
187 imageRegistry?: {
188 // ImageRegistryCredentials provides credentials that will be used for authentication with registry
189 imageRegistryCredentials?: {
190 // AllowInsecureRegistry allows insecure access to a registry.
191 allowInsecureRegistry?: bool
192
193 // Providers specifies a list of OCI Registry names, whose authentication providers are provided.
194 // It can be of one of these values: default,google,azure,amazon,github.
195 providers?: [..."default" | "amazon" | "azure" | "google" | "github"]
196
197 // Secrets specifies a list of secrets that are provided for credentials.
198 // Secrets can be specified as a name (Kyverno namespace) or namespace/name.
199 // imagePullSecrets from the resource namespace are also used.
200 secrets?: [...string]
201 }
202
203 // JMESPath is an optional JSON Match Expression that can be used to
204 // transform the ImageData struct returned as a result of processing
205 // the image reference.
206 jmesPath?: string
207
208 // Reference is image reference to a container image in the registry.
209 // Example: ghcr.io/kyverno/kyverno:latest
210 reference!: string
211 }
212
213 // Name is the variable name.
214 name!: string
215
216 // Variable defines an arbitrary JMESPath context variable that can be defined inline.
217 variable?: {
218 // Default is an optional arbitrary JSON object that the variable may take if the JMESPath
219 // expression evaluates to nil
220 default?: null | bool | number | string | [...] | {...}
221
222 // JMESPath is an optional JMESPath Expression that can be used to
223 // transform the variable.
224 jmesPath?: string
225
226 // Value is any arbitrary JSON object representable in YAML or JSON form.
227 value?: null | bool | number | string | [...] | {...}
228 }
229 }]
230
231 // ExcludeResources defines when this policy rule should not be applied. The exclude
232 // criteria can include resource information (e.g. kind, name, namespace, labels)
233 // and admission review request information like the name or role.
234 exclude?: matchN(0, [null | bool | number | string | [...] | {
235 any!: _
236 all!: _
237 }]) & {
238 // All allows specifying resources which will be ANDed
239 all?: [...{
240 // ClusterRoles is the list of cluster-wide role names for the user.
241 clusterRoles?: [...string]
242
243 // ResourceDescription contains information about the resource being created or modified.
244 resources?: matchN(0, [null | bool | number | string | [...] | {
245 name!: _
246 names!: _
247 }]) & {
248 // Annotations is a map of annotations (key-value pairs of type string). Annotation keys
249 // and values support the wildcard characters "*" (matches zero or many characters) and
250 // "?" (matches at least one character).
251 annotations?: [string]: string
252
253 // Kinds is a list of resource kinds.
254 kinds?: [...string]
255
256 // Name is the name of the resource. The name supports wildcard characters
257 // "*" (matches zero or many characters) and "?" (at least one character).
258 // NOTE: "Name" is being deprecated in favor of "Names".
259 name?: string
260
261 // Names are the names of the resources. Each name supports wildcard characters
262 // "*" (matches zero or many characters) and "?" (at least one character).
263 names?: [...string]
264
265 // NamespaceSelector is a label selector for the resource namespace. Label keys and values
266 // in `matchLabels` support the wildcard characters `*` (matches zero or many characters)
267 // and `?` (matches one character).Wildcards allows writing label selectors like
268 // ["storage.k8s.io/*": "*"]. Note that using ["*" : "*"] matches any key and value but
269 // does not match an empty label set.
270 namespaceSelector?: {
271 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
272 matchExpressions?: [...{
273 // key is the label key that the selector applies to.
274 key!: string
275
276 // operator represents a key's relationship to a set of values.
277 // Valid operators are In, NotIn, Exists and DoesNotExist.
278 operator!: string
279
280 // values is an array of string values. If the operator is In or NotIn,
281 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
282 // the values array must be empty. This array is replaced during a strategic
283 // merge patch.
284 values?: [...string]
285 }]
286
287 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
288 // map is equivalent to an element of matchExpressions, whose key field is "key", the
289 // operator is "In", and the values array contains only "value". The requirements are ANDed.
290 matchLabels?: [string]: string
291 }
292
293 // Namespaces is a list of namespaces names. Each name supports wildcard characters
294 // "*" (matches zero or many characters) and "?" (at least one character).
295 namespaces?: [...string]
296
297 // Operations can contain values ["CREATE, "UPDATE", "CONNECT", "DELETE"], which
298 // are used to match a specific action.
299 operations?: [..."CREATE" | "CONNECT" | "UPDATE" | "DELETE"]
300
301 // Selector is a label selector. Label keys and values in `matchLabels` support the wildcard
302 // characters `*` (matches zero or many characters) and `?` (matches one character).
303 // Wildcards allows writing label selectors like ["storage.k8s.io/*": "*"]. Note that
304 // using ["*" : "*"] matches any key and value but does not match an empty label set.
305 selector?: {
306 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
307 matchExpressions?: [...{
308 // key is the label key that the selector applies to.
309 key!: string
310
311 // operator represents a key's relationship to a set of values.
312 // Valid operators are In, NotIn, Exists and DoesNotExist.
313 operator!: string
314
315 // values is an array of string values. If the operator is In or NotIn,
316 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
317 // the values array must be empty. This array is replaced during a strategic
318 // merge patch.
319 values?: [...string]
320 }]
321
322 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
323 // map is equivalent to an element of matchExpressions, whose key field is "key", the
324 // operator is "In", and the values array contains only "value". The requirements are ANDed.
325 matchLabels?: [string]: string
326 }
327 }
328
329 // Roles is the list of namespaced role names for the user.
330 roles?: [...string]
331
332 // Subjects is the list of subject names like users, user groups, and service accounts.
333 subjects?: [...{
334 // APIGroup holds the API group of the referenced subject.
335 // Defaults to "" for ServiceAccount subjects.
336 // Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
337 apiGroup?: string
338
339 // Kind of object being referenced. Values defined by this API group are "User",
340 // "Group", and "ServiceAccount".
341 // If the Authorizer does not recognized the kind value, the Authorizer should report an error.
342 kind!: string
343
344 // Name of the object being referenced.
345 name!: string
346
347 // Namespace of the referenced object. If the object kind is non-namespace, such
348 // as "User" or "Group", and this value is not empty
349 // the Authorizer should report an error.
350 namespace?: string
351 }]
352 }]
353
354 // Any allows specifying resources which will be ORed
355 any?: [...{
356 // ClusterRoles is the list of cluster-wide role names for the user.
357 clusterRoles?: [...string]
358
359 // ResourceDescription contains information about the resource being created or modified.
360 resources?: matchN(0, [null | bool | number | string | [...] | {
361 name!: _
362 names!: _
363 }]) & {
364 // Annotations is a map of annotations (key-value pairs of type string). Annotation keys
365 // and values support the wildcard characters "*" (matches zero or many characters) and
366 // "?" (matches at least one character).
367 annotations?: [string]: string
368
369 // Kinds is a list of resource kinds.
370 kinds?: [...string]
371
372 // Name is the name of the resource. The name supports wildcard characters
373 // "*" (matches zero or many characters) and "?" (at least one character).
374 // NOTE: "Name" is being deprecated in favor of "Names".
375 name?: string
376
377 // Names are the names of the resources. Each name supports wildcard characters
378 // "*" (matches zero or many characters) and "?" (at least one character).
379 names?: [...string]
380
381 // NamespaceSelector is a label selector for the resource namespace. Label keys and values
382 // in `matchLabels` support the wildcard characters `*` (matches zero or many characters)
383 // and `?` (matches one character).Wildcards allows writing label selectors like
384 // ["storage.k8s.io/*": "*"]. Note that using ["*" : "*"] matches any key and value but
385 // does not match an empty label set.
386 namespaceSelector?: {
387 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
388 matchExpressions?: [...{
389 // key is the label key that the selector applies to.
390 key!: string
391
392 // operator represents a key's relationship to a set of values.
393 // Valid operators are In, NotIn, Exists and DoesNotExist.
394 operator!: string
395
396 // values is an array of string values. If the operator is In or NotIn,
397 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
398 // the values array must be empty. This array is replaced during a strategic
399 // merge patch.
400 values?: [...string]
401 }]
402
403 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
404 // map is equivalent to an element of matchExpressions, whose key field is "key", the
405 // operator is "In", and the values array contains only "value". The requirements are ANDed.
406 matchLabels?: [string]: string
407 }
408
409 // Namespaces is a list of namespaces names. Each name supports wildcard characters
410 // "*" (matches zero or many characters) and "?" (at least one character).
411 namespaces?: [...string]
412
413 // Operations can contain values ["CREATE, "UPDATE", "CONNECT", "DELETE"], which
414 // are used to match a specific action.
415 operations?: [..."CREATE" | "CONNECT" | "UPDATE" | "DELETE"]
416
417 // Selector is a label selector. Label keys and values in `matchLabels` support the wildcard
418 // characters `*` (matches zero or many characters) and `?` (matches one character).
419 // Wildcards allows writing label selectors like ["storage.k8s.io/*": "*"]. Note that
420 // using ["*" : "*"] matches any key and value but does not match an empty label set.
421 selector?: {
422 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
423 matchExpressions?: [...{
424 // key is the label key that the selector applies to.
425 key!: string
426
427 // operator represents a key's relationship to a set of values.
428 // Valid operators are In, NotIn, Exists and DoesNotExist.
429 operator!: string
430
431 // values is an array of string values. If the operator is In or NotIn,
432 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
433 // the values array must be empty. This array is replaced during a strategic
434 // merge patch.
435 values?: [...string]
436 }]
437
438 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
439 // map is equivalent to an element of matchExpressions, whose key field is "key", the
440 // operator is "In", and the values array contains only "value". The requirements are ANDed.
441 matchLabels?: [string]: string
442 }
443 }
444
445 // Roles is the list of namespaced role names for the user.
446 roles?: [...string]
447
448 // Subjects is the list of subject names like users, user groups, and service accounts.
449 subjects?: [...{
450 // APIGroup holds the API group of the referenced subject.
451 // Defaults to "" for ServiceAccount subjects.
452 // Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
453 apiGroup?: string
454
455 // Kind of object being referenced. Values defined by this API group are "User",
456 // "Group", and "ServiceAccount".
457 // If the Authorizer does not recognized the kind value, the Authorizer should report an error.
458 kind!: string
459
460 // Name of the object being referenced.
461 name!: string
462
463 // Namespace of the referenced object. If the object kind is non-namespace, such
464 // as "User" or "Group", and this value is not empty
465 // the Authorizer should report an error.
466 namespace?: string
467 }]
468 }]
469
470 // ClusterRoles is the list of cluster-wide role names for the user.
471 clusterRoles?: [...string]
472
473 // ResourceDescription contains information about the resource being created or modified.
474 // Requires at least one tag to be specified when under MatchResources.
475 // Specifying ResourceDescription directly under match is being deprecated.
476 // Please specify under "any" or "all" instead.
477 resources?: matchN(0, [null | bool | number | string | [...] | {
478 name!: _
479 names!: _
480 }]) & {
481 // Annotations is a map of annotations (key-value pairs of type string). Annotation keys
482 // and values support the wildcard characters "*" (matches zero or many characters) and
483 // "?" (matches at least one character).
484 annotations?: [string]: string
485
486 // Kinds is a list of resource kinds.
487 kinds?: [...string]
488
489 // Name is the name of the resource. The name supports wildcard characters
490 // "*" (matches zero or many characters) and "?" (at least one character).
491 // NOTE: "Name" is being deprecated in favor of "Names".
492 name?: string
493
494 // Names are the names of the resources. Each name supports wildcard characters
495 // "*" (matches zero or many characters) and "?" (at least one character).
496 names?: [...string]
497
498 // NamespaceSelector is a label selector for the resource namespace. Label keys and values
499 // in `matchLabels` support the wildcard characters `*` (matches zero or many characters)
500 // and `?` (matches one character).Wildcards allows writing label selectors like
501 // ["storage.k8s.io/*": "*"]. Note that using ["*" : "*"] matches any key and value but
502 // does not match an empty label set.
503 namespaceSelector?: {
504 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
505 matchExpressions?: [...{
506 // key is the label key that the selector applies to.
507 key!: string
508
509 // operator represents a key's relationship to a set of values.
510 // Valid operators are In, NotIn, Exists and DoesNotExist.
511 operator!: string
512
513 // values is an array of string values. If the operator is In or NotIn,
514 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
515 // the values array must be empty. This array is replaced during a strategic
516 // merge patch.
517 values?: [...string]
518 }]
519
520 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
521 // map is equivalent to an element of matchExpressions, whose key field is "key", the
522 // operator is "In", and the values array contains only "value". The requirements are ANDed.
523 matchLabels?: [string]: string
524 }
525
526 // Namespaces is a list of namespaces names. Each name supports wildcard characters
527 // "*" (matches zero or many characters) and "?" (at least one character).
528 namespaces?: [...string]
529
530 // Operations can contain values ["CREATE, "UPDATE", "CONNECT", "DELETE"], which
531 // are used to match a specific action.
532 operations?: [..."CREATE" | "CONNECT" | "UPDATE" | "DELETE"]
533
534 // Selector is a label selector. Label keys and values in `matchLabels` support the wildcard
535 // characters `*` (matches zero or many characters) and `?` (matches one character).
536 // Wildcards allows writing label selectors like ["storage.k8s.io/*": "*"]. Note that
537 // using ["*" : "*"] matches any key and value but does not match an empty label set.
538 selector?: {
539 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
540 matchExpressions?: [...{
541 // key is the label key that the selector applies to.
542 key!: string
543
544 // operator represents a key's relationship to a set of values.
545 // Valid operators are In, NotIn, Exists and DoesNotExist.
546 operator!: string
547
548 // values is an array of string values. If the operator is In or NotIn,
549 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
550 // the values array must be empty. This array is replaced during a strategic
551 // merge patch.
552 values?: [...string]
553 }]
554
555 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
556 // map is equivalent to an element of matchExpressions, whose key field is "key", the
557 // operator is "In", and the values array contains only "value". The requirements are ANDed.
558 matchLabels?: [string]: string
559 }
560 }
561
562 // Roles is the list of namespaced role names for the user.
563 roles?: [...string]
564
565 // Subjects is the list of subject names like users, user groups, and service accounts.
566 subjects?: [...{
567 // APIGroup holds the API group of the referenced subject.
568 // Defaults to "" for ServiceAccount subjects.
569 // Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
570 apiGroup?: string
571
572 // Kind of object being referenced. Values defined by this API group are "User",
573 // "Group", and "ServiceAccount".
574 // If the Authorizer does not recognized the kind value, the Authorizer should report an error.
575 kind!: string
576
577 // Name of the object being referenced.
578 name!: string
579
580 // Namespace of the referenced object. If the object kind is non-namespace, such
581 // as "User" or "Group", and this value is not empty
582 // the Authorizer should report an error.
583 namespace?: string
584 }]
585 }
586
587 // Generation is used to create new resources.
588 generate?: {
589 // APIVersion specifies resource apiVersion.
590 apiVersion?: string
591
592 // Clone specifies the source resource used to populate each generated resource.
593 // At most one of Data or Clone can be specified. If neither are provided, the generated
594 // resource will be created with default data only.
595 clone?: {
596 // Name specifies name of the resource.
597 name?: string
598
599 // Namespace specifies source resource namespace.
600 namespace?: string
601 }
602
603 // CloneList specifies the list of source resource used to populate each generated resource.
604 cloneList?: {
605 // Kinds is a list of resource kinds.
606 kinds?: [...string]
607
608 // Namespace specifies source resource namespace.
609 namespace?: string
610
611 // Selector is a label selector. Label keys and values in `matchLabels`.
612 // wildcard characters are not supported.
613 selector?: {
614 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
615 matchExpressions?: [...{
616 // key is the label key that the selector applies to.
617 key!: string
618
619 // operator represents a key's relationship to a set of values.
620 // Valid operators are In, NotIn, Exists and DoesNotExist.
621 operator!: string
622
623 // values is an array of string values. If the operator is In or NotIn,
624 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
625 // the values array must be empty. This array is replaced during a strategic
626 // merge patch.
627 values?: [...string]
628 }]
629
630 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
631 // map is equivalent to an element of matchExpressions, whose key field is "key", the
632 // operator is "In", and the values array contains only "value". The requirements are ANDed.
633 matchLabels?: [string]: string
634 }
635 }
636
637 // Data provides the resource declaration used to populate each generated resource.
638 // At most one of Data or Clone must be specified. If neither are provided, the generated
639 // resource will be created with default data only.
640 data?: null | bool | number | string | [...] | {...}
641
642 // ForEach applies generate rules to a list of sub-elements by creating a
643 // context for each entry in the list and looping over it to apply the
644 // specified logic.
645 foreach?: [...{
646 // APIVersion specifies resource apiVersion.
647 apiVersion?: string
648
649 // Clone specifies the source resource used to populate each generated resource.
650 // At most one of Data or Clone can be specified. If neither are provided, the generated
651 // resource will be created with default data only.
652 clone?: {
653 // Name specifies name of the resource.
654 name?: string
655
656 // Namespace specifies source resource namespace.
657 namespace?: string
658 }
659
660 // CloneList specifies the list of source resource used to populate each generated resource.
661 cloneList?: {
662 // Kinds is a list of resource kinds.
663 kinds?: [...string]
664
665 // Namespace specifies source resource namespace.
666 namespace?: string
667
668 // Selector is a label selector. Label keys and values in `matchLabels`.
669 // wildcard characters are not supported.
670 selector?: {
671 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
672 matchExpressions?: [...{
673 // key is the label key that the selector applies to.
674 key!: string
675
676 // operator represents a key's relationship to a set of values.
677 // Valid operators are In, NotIn, Exists and DoesNotExist.
678 operator!: string
679
680 // values is an array of string values. If the operator is In or NotIn,
681 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
682 // the values array must be empty. This array is replaced during a strategic
683 // merge patch.
684 values?: [...string]
685 }]
686
687 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
688 // map is equivalent to an element of matchExpressions, whose key field is "key", the
689 // operator is "In", and the values array contains only "value". The requirements are ANDed.
690 matchLabels?: [string]: string
691 }
692 }
693
694 // Context defines variables and data sources that can be used during rule execution.
695 context?: [...matchN(1, [
696 {configMap!: _}, {apiCall!: _}, {imageRegistry!: _}, {variable!: _}, {globalReference!: _},
697 ]) & {
698 // APICall is an HTTP request to the Kubernetes API server, or other JSON web service.
699 // The data returned is stored in the context with the name for the context entry.
700 apiCall?: {
701 // The data object specifies the POST data sent to the server.
702 // Only applicable when the method field is set to POST.
703 data?: [...{
704 // Key is a unique identifier for the data value
705 key!: string
706
707 // Value is the data value
708 value!: null | bool | number | string | [...] | {...}
709 }]
710
711 // Default is an optional arbitrary JSON object that the context
712 // value is set to, if the apiCall returns error.
713 default?: null | bool | number | string | [...] | {...}
714
715 // JMESPath is an optional JSON Match Expression that can be used to
716 // transform the JSON response returned from the server. For example
717 // a JMESPath of "items | length(@)" applied to the API server response
718 // for the URLPath "/apis/apps/v1/deployments" will return the total count
719 // of deployments across all namespaces.
720 jmesPath?: string
721
722 // Method is the HTTP request type (GET or POST). Defaults to GET.
723 method?: "GET" | "POST"
724
725 // Service is an API call to a JSON web service.
726 // This is used for non-Kubernetes API server calls.
727 // It's mutually exclusive with the URLPath field.
728 service?: {
729 // CABundle is a PEM encoded CA bundle which will be used to validate
730 // the server certificate.
731 caBundle?: string
732
733 // Headers is a list of optional HTTP headers to be included in the request.
734 headers?: [...{
735 // Key is the header key
736 key!: string
737
738 // Value is the header value
739 value!: string
740 }]
741
742 // URL is the JSON web service URL. A typical form is
743 // `https://{service}.{namespace}:{port}/{path}`.
744 url!: string
745 }
746
747 // URLPath is the URL path to be used in the HTTP GET or POST request to the
748 // Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
749 // The format required is the same format used by the `kubectl get --raw` command.
750 // See
751 // https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls
752 // for details.
753 // It's mutually exclusive with the Service field.
754 urlPath?: string
755 }
756
757 // ConfigMap is the ConfigMap reference.
758 configMap?: {
759 // Name is the ConfigMap name.
760 name!: string
761
762 // Namespace is the ConfigMap namespace.
763 namespace?: string
764 }
765
766 // GlobalContextEntryReference is a reference to a cached global context entry.
767 globalReference?: {
768 // JMESPath is an optional JSON Match Expression that can be used to
769 // transform the JSON response returned from the server. For example
770 // a JMESPath of "items | length(@)" applied to the API server response
771 // for the URLPath "/apis/apps/v1/deployments" will return the total count
772 // of deployments across all namespaces.
773 jmesPath?: string
774
775 // Name of the global context entry
776 name!: string
777 }
778
779 // ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image
780 // details.
781 imageRegistry?: {
782 // ImageRegistryCredentials provides credentials that will be used for authentication with registry
783 imageRegistryCredentials?: {
784 // AllowInsecureRegistry allows insecure access to a registry.
785 allowInsecureRegistry?: bool
786
787 // Providers specifies a list of OCI Registry names, whose authentication providers are provided.
788 // It can be of one of these values: default,google,azure,amazon,github.
789 providers?: [..."default" | "amazon" | "azure" | "google" | "github"]
790
791 // Secrets specifies a list of secrets that are provided for credentials.
792 // Secrets can be specified as a name (Kyverno namespace) or namespace/name.
793 // imagePullSecrets from the resource namespace are also used.
794 secrets?: [...string]
795 }
796
797 // JMESPath is an optional JSON Match Expression that can be used to
798 // transform the ImageData struct returned as a result of processing
799 // the image reference.
800 jmesPath?: string
801
802 // Reference is image reference to a container image in the registry.
803 // Example: ghcr.io/kyverno/kyverno:latest
804 reference!: string
805 }
806
807 // Name is the variable name.
808 name!: string
809
810 // Variable defines an arbitrary JMESPath context variable that can be defined inline.
811 variable?: {
812 // Default is an optional arbitrary JSON object that the variable may take if the JMESPath
813 // expression evaluates to nil
814 default?: null | bool | number | string | [...] | {...}
815
816 // JMESPath is an optional JMESPath Expression that can be used to
817 // transform the variable.
818 jmesPath?: string
819
820 // Value is any arbitrary JSON object representable in YAML or JSON form.
821 value?: null | bool | number | string | [...] | {...}
822 }
823 }]
824
825 // Data provides the resource declaration used to populate each generated resource.
826 // At most one of Data or Clone must be specified. If neither are provided, the generated
827 // resource will be created with default data only.
828 data?: null | bool | number | string | [...] | {...}
829
830 // Kind specifies resource kind.
831 kind?: string
832
833 // List specifies a JMESPath expression that results in one or more elements
834 // to which the validation logic is applied.
835 list?: string
836
837 // Name specifies the resource name.
838 name?: string
839
840 // Namespace specifies resource namespace.
841 namespace?: string
842
843 // AnyAllConditions are used to determine if a policy rule should be applied by evaluating a
844 // set of conditions. The declaration can contain nested `any` or `all` statements.
845 // See: https://kyverno.io/docs/writing-policies/preconditions/
846 preconditions?: {
847 // AllConditions enable variable-based conditional rule execution. This is useful for
848 // finer control of when an rule is applied. A condition can reference object data
849 // using JMESPath notation.
850 // Here, all of the conditions need to pass
851 all?: [...{
852 // Key is the context entry (using JMESPath) for conditional rule evaluation.
853 key?: null | bool | number | string | [...] | {...}
854
855 // Message is an optional display message
856 message?: string
857
858 // Operator is the conditional operation to perform. Valid operators are:
859 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
860 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
861 // DurationLessThanOrEquals, DurationLessThan
862 operator?: "Equals" |
863 "NotEquals" |
864 "In" |
865 "AnyIn" |
866 "AllIn" |
867 "NotIn" |
868 "AnyNotIn" |
869 "AllNotIn" |
870 "GreaterThanOrEquals" |
871 "GreaterThan" |
872 "LessThanOrEquals" |
873 "LessThan" |
874 "DurationGreaterThanOrEquals" |
875 "DurationGreaterThan" |
876 "DurationLessThanOrEquals" |
877 "DurationLessThan"
878
879 // Value is the conditional value, or set of values. The values can be fixed set
880 // or can be variables declared using JMESPath.
881 value?: null | bool | number | string | [...] | {...}
882 }]
883
884 // AnyConditions enable variable-based conditional rule execution. This is useful for
885 // finer control of when an rule is applied. A condition can reference object data
886 // using JMESPath notation.
887 // Here, at least one of the conditions need to pass
888 any?: [...{
889 // Key is the context entry (using JMESPath) for conditional rule evaluation.
890 key?: null | bool | number | string | [...] | {...}
891
892 // Message is an optional display message
893 message?: string
894
895 // Operator is the conditional operation to perform. Valid operators are:
896 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
897 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
898 // DurationLessThanOrEquals, DurationLessThan
899 operator?: "Equals" |
900 "NotEquals" |
901 "In" |
902 "AnyIn" |
903 "AllIn" |
904 "NotIn" |
905 "AnyNotIn" |
906 "AllNotIn" |
907 "GreaterThanOrEquals" |
908 "GreaterThan" |
909 "LessThanOrEquals" |
910 "LessThan" |
911 "DurationGreaterThanOrEquals" |
912 "DurationGreaterThan" |
913 "DurationLessThanOrEquals" |
914 "DurationLessThan"
915
916 // Value is the conditional value, or set of values. The values can be fixed set
917 // or can be variables declared using JMESPath.
918 value?: null | bool | number | string | [...] | {...}
919 }]
920 ...
921 }
922
923 // UID specifies the resource uid.
924 uid?: string
925 }]
926
927 // GenerateExisting controls whether to trigger the rule in existing resources
928 // If is set to "true" the rule will be triggered and applied to existing matched resources.
929 generateExisting?: bool
930
931 // Kind specifies resource kind.
932 kind?: string
933
934 // Name specifies the resource name.
935 name?: string
936
937 // Namespace specifies resource namespace.
938 namespace?: string
939
940 // OrphanDownstreamOnPolicyDelete controls whether generated resources should be
941 // deleted when the rule that generated
942 // them is deleted with synchronization enabled. This option is only applicable
943 // to generate rules of the data type.
944 // See https://kyverno.io/docs/writing-policies/generate/#data-examples.
945 // Defaults to "false" if not specified.
946 orphanDownstreamOnPolicyDelete?: bool
947
948 // Synchronize controls if generated resources should be kept in-sync with their source resource.
949 // If Synchronize is set to "true" changes to generated resources will be overwritten with resource
950 // data from Data or the resource specified in the Clone declaration.
951 // Optional. Defaults to "false" if not specified.
952 synchronize?: bool
953
954 // UID specifies the resource uid.
955 uid?: string
956 }
957
958 // ImageExtractors defines a mapping from kinds to ImageExtractorConfigs.
959 // This config is only valid for verifyImages rules.
960 imageExtractors?: [string]: [...{
961 // JMESPath is an optional JMESPath expression to apply to the image value.
962 // This is useful when the extracted image begins with a prefix like 'docker://'.
963 // The 'trim_prefix' function may be used to trim the prefix: trim_prefix(@, 'docker://').
964 // Note - Image digest mutation may not be used when applying a JMESPAth to an image.
965 jmesPath?: string
966
967 // Key is an optional name of the field within 'path' that will be used to
968 // uniquely identify an image.
969 // Note - this field MUST be unique.
970 key?: string
971
972 // Name is the entry the image will be available under 'images.<name>' in the context.
973 // If this field is not defined, image entries will appear under 'images.custom'.
974 name?: string
975
976 // Path is the path to the object containing the image field in a custom resource.
977 // It should be slash-separated. Each slash-separated key must be a valid YAML
978 // key or a wildcard '*'.
979 // Wildcard keys are expanded in case of arrays or objects.
980 path!: string
981
982 // Value is an optional name of the field within 'path' that points to the image URI.
983 // This is useful when a custom 'key' is also defined.
984 value?: string
985 }]
986
987 // MatchResources defines when this policy rule should be applied. The match
988 // criteria can include resource information (e.g. kind, name, namespace, labels)
989 // and admission review request information like the user name or role.
990 // At least one kind is required.
991 match!: matchN(0, [null | bool | number | string | [...] | {
992 any!: _
993 all!: _
994 }]) & {
995 // All allows specifying resources which will be ANDed
996 all?: [...{
997 // ClusterRoles is the list of cluster-wide role names for the user.
998 clusterRoles?: [...string]
999
1000 // ResourceDescription contains information about the resource being created or modified.
1001 resources?: matchN(0, [null | bool | number | string | [...] | {
1002 name!: _
1003 names!: _
1004 }]) & {
1005 // Annotations is a map of annotations (key-value pairs of type string). Annotation keys
1006 // and values support the wildcard characters "*" (matches zero or many characters) and
1007 // "?" (matches at least one character).
1008 annotations?: [string]: string
1009
1010 // Kinds is a list of resource kinds.
1011 kinds?: [...string]
1012
1013 // Name is the name of the resource. The name supports wildcard characters
1014 // "*" (matches zero or many characters) and "?" (at least one character).
1015 // NOTE: "Name" is being deprecated in favor of "Names".
1016 name?: string
1017
1018 // Names are the names of the resources. Each name supports wildcard characters
1019 // "*" (matches zero or many characters) and "?" (at least one character).
1020 names?: [...string]
1021
1022 // NamespaceSelector is a label selector for the resource namespace. Label keys and values
1023 // in `matchLabels` support the wildcard characters `*` (matches zero or many characters)
1024 // and `?` (matches one character).Wildcards allows writing label selectors like
1025 // ["storage.k8s.io/*": "*"]. Note that using ["*" : "*"] matches any key and value but
1026 // does not match an empty label set.
1027 namespaceSelector?: {
1028 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
1029 matchExpressions?: [...{
1030 // key is the label key that the selector applies to.
1031 key!: string
1032
1033 // operator represents a key's relationship to a set of values.
1034 // Valid operators are In, NotIn, Exists and DoesNotExist.
1035 operator!: string
1036
1037 // values is an array of string values. If the operator is In or NotIn,
1038 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
1039 // the values array must be empty. This array is replaced during a strategic
1040 // merge patch.
1041 values?: [...string]
1042 }]
1043
1044 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
1045 // map is equivalent to an element of matchExpressions, whose key field is "key", the
1046 // operator is "In", and the values array contains only "value". The requirements are ANDed.
1047 matchLabels?: [string]: string
1048 }
1049
1050 // Namespaces is a list of namespaces names. Each name supports wildcard characters
1051 // "*" (matches zero or many characters) and "?" (at least one character).
1052 namespaces?: [...string]
1053
1054 // Operations can contain values ["CREATE, "UPDATE", "CONNECT", "DELETE"], which
1055 // are used to match a specific action.
1056 operations?: [..."CREATE" | "CONNECT" | "UPDATE" | "DELETE"]
1057
1058 // Selector is a label selector. Label keys and values in `matchLabels` support the wildcard
1059 // characters `*` (matches zero or many characters) and `?` (matches one character).
1060 // Wildcards allows writing label selectors like ["storage.k8s.io/*": "*"]. Note that
1061 // using ["*" : "*"] matches any key and value but does not match an empty label set.
1062 selector?: {
1063 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
1064 matchExpressions?: [...{
1065 // key is the label key that the selector applies to.
1066 key!: string
1067
1068 // operator represents a key's relationship to a set of values.
1069 // Valid operators are In, NotIn, Exists and DoesNotExist.
1070 operator!: string
1071
1072 // values is an array of string values. If the operator is In or NotIn,
1073 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
1074 // the values array must be empty. This array is replaced during a strategic
1075 // merge patch.
1076 values?: [...string]
1077 }]
1078
1079 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
1080 // map is equivalent to an element of matchExpressions, whose key field is "key", the
1081 // operator is "In", and the values array contains only "value". The requirements are ANDed.
1082 matchLabels?: [string]: string
1083 }
1084 }
1085
1086 // Roles is the list of namespaced role names for the user.
1087 roles?: [...string]
1088
1089 // Subjects is the list of subject names like users, user groups, and service accounts.
1090 subjects?: [...{
1091 // APIGroup holds the API group of the referenced subject.
1092 // Defaults to "" for ServiceAccount subjects.
1093 // Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
1094 apiGroup?: string
1095
1096 // Kind of object being referenced. Values defined by this API group are "User",
1097 // "Group", and "ServiceAccount".
1098 // If the Authorizer does not recognized the kind value, the Authorizer should report an error.
1099 kind!: string
1100
1101 // Name of the object being referenced.
1102 name!: string
1103
1104 // Namespace of the referenced object. If the object kind is non-namespace, such
1105 // as "User" or "Group", and this value is not empty
1106 // the Authorizer should report an error.
1107 namespace?: string
1108 }]
1109 }]
1110
1111 // Any allows specifying resources which will be ORed
1112 any?: [...{
1113 // ClusterRoles is the list of cluster-wide role names for the user.
1114 clusterRoles?: [...string]
1115
1116 // ResourceDescription contains information about the resource being created or modified.
1117 resources?: matchN(0, [null | bool | number | string | [...] | {
1118 name!: _
1119 names!: _
1120 }]) & {
1121 // Annotations is a map of annotations (key-value pairs of type string). Annotation keys
1122 // and values support the wildcard characters "*" (matches zero or many characters) and
1123 // "?" (matches at least one character).
1124 annotations?: [string]: string
1125
1126 // Kinds is a list of resource kinds.
1127 kinds?: [...string]
1128
1129 // Name is the name of the resource. The name supports wildcard characters
1130 // "*" (matches zero or many characters) and "?" (at least one character).
1131 // NOTE: "Name" is being deprecated in favor of "Names".
1132 name?: string
1133
1134 // Names are the names of the resources. Each name supports wildcard characters
1135 // "*" (matches zero or many characters) and "?" (at least one character).
1136 names?: [...string]
1137
1138 // NamespaceSelector is a label selector for the resource namespace. Label keys and values
1139 // in `matchLabels` support the wildcard characters `*` (matches zero or many characters)
1140 // and `?` (matches one character).Wildcards allows writing label selectors like
1141 // ["storage.k8s.io/*": "*"]. Note that using ["*" : "*"] matches any key and value but
1142 // does not match an empty label set.
1143 namespaceSelector?: {
1144 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
1145 matchExpressions?: [...{
1146 // key is the label key that the selector applies to.
1147 key!: string
1148
1149 // operator represents a key's relationship to a set of values.
1150 // Valid operators are In, NotIn, Exists and DoesNotExist.
1151 operator!: string
1152
1153 // values is an array of string values. If the operator is In or NotIn,
1154 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
1155 // the values array must be empty. This array is replaced during a strategic
1156 // merge patch.
1157 values?: [...string]
1158 }]
1159
1160 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
1161 // map is equivalent to an element of matchExpressions, whose key field is "key", the
1162 // operator is "In", and the values array contains only "value". The requirements are ANDed.
1163 matchLabels?: [string]: string
1164 }
1165
1166 // Namespaces is a list of namespaces names. Each name supports wildcard characters
1167 // "*" (matches zero or many characters) and "?" (at least one character).
1168 namespaces?: [...string]
1169
1170 // Operations can contain values ["CREATE, "UPDATE", "CONNECT", "DELETE"], which
1171 // are used to match a specific action.
1172 operations?: [..."CREATE" | "CONNECT" | "UPDATE" | "DELETE"]
1173
1174 // Selector is a label selector. Label keys and values in `matchLabels` support the wildcard
1175 // characters `*` (matches zero or many characters) and `?` (matches one character).
1176 // Wildcards allows writing label selectors like ["storage.k8s.io/*": "*"]. Note that
1177 // using ["*" : "*"] matches any key and value but does not match an empty label set.
1178 selector?: {
1179 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
1180 matchExpressions?: [...{
1181 // key is the label key that the selector applies to.
1182 key!: string
1183
1184 // operator represents a key's relationship to a set of values.
1185 // Valid operators are In, NotIn, Exists and DoesNotExist.
1186 operator!: string
1187
1188 // values is an array of string values. If the operator is In or NotIn,
1189 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
1190 // the values array must be empty. This array is replaced during a strategic
1191 // merge patch.
1192 values?: [...string]
1193 }]
1194
1195 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
1196 // map is equivalent to an element of matchExpressions, whose key field is "key", the
1197 // operator is "In", and the values array contains only "value". The requirements are ANDed.
1198 matchLabels?: [string]: string
1199 }
1200 }
1201
1202 // Roles is the list of namespaced role names for the user.
1203 roles?: [...string]
1204
1205 // Subjects is the list of subject names like users, user groups, and service accounts.
1206 subjects?: [...{
1207 // APIGroup holds the API group of the referenced subject.
1208 // Defaults to "" for ServiceAccount subjects.
1209 // Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
1210 apiGroup?: string
1211
1212 // Kind of object being referenced. Values defined by this API group are "User",
1213 // "Group", and "ServiceAccount".
1214 // If the Authorizer does not recognized the kind value, the Authorizer should report an error.
1215 kind!: string
1216
1217 // Name of the object being referenced.
1218 name!: string
1219
1220 // Namespace of the referenced object. If the object kind is non-namespace, such
1221 // as "User" or "Group", and this value is not empty
1222 // the Authorizer should report an error.
1223 namespace?: string
1224 }]
1225 }]
1226
1227 // ClusterRoles is the list of cluster-wide role names for the user.
1228 clusterRoles?: [...string]
1229
1230 // ResourceDescription contains information about the resource being created or modified.
1231 // Requires at least one tag to be specified when under MatchResources.
1232 // Specifying ResourceDescription directly under match is being deprecated.
1233 // Please specify under "any" or "all" instead.
1234 resources?: matchN(0, [null | bool | number | string | [...] | {
1235 name!: _
1236 names!: _
1237 }]) & {
1238 // Annotations is a map of annotations (key-value pairs of type string). Annotation keys
1239 // and values support the wildcard characters "*" (matches zero or many characters) and
1240 // "?" (matches at least one character).
1241 annotations?: [string]: string
1242
1243 // Kinds is a list of resource kinds.
1244 kinds?: [...string]
1245
1246 // Name is the name of the resource. The name supports wildcard characters
1247 // "*" (matches zero or many characters) and "?" (at least one character).
1248 // NOTE: "Name" is being deprecated in favor of "Names".
1249 name?: string
1250
1251 // Names are the names of the resources. Each name supports wildcard characters
1252 // "*" (matches zero or many characters) and "?" (at least one character).
1253 names?: [...string]
1254
1255 // NamespaceSelector is a label selector for the resource namespace. Label keys and values
1256 // in `matchLabels` support the wildcard characters `*` (matches zero or many characters)
1257 // and `?` (matches one character).Wildcards allows writing label selectors like
1258 // ["storage.k8s.io/*": "*"]. Note that using ["*" : "*"] matches any key and value but
1259 // does not match an empty label set.
1260 namespaceSelector?: {
1261 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
1262 matchExpressions?: [...{
1263 // key is the label key that the selector applies to.
1264 key!: string
1265
1266 // operator represents a key's relationship to a set of values.
1267 // Valid operators are In, NotIn, Exists and DoesNotExist.
1268 operator!: string
1269
1270 // values is an array of string values. If the operator is In or NotIn,
1271 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
1272 // the values array must be empty. This array is replaced during a strategic
1273 // merge patch.
1274 values?: [...string]
1275 }]
1276
1277 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
1278 // map is equivalent to an element of matchExpressions, whose key field is "key", the
1279 // operator is "In", and the values array contains only "value". The requirements are ANDed.
1280 matchLabels?: [string]: string
1281 }
1282
1283 // Namespaces is a list of namespaces names. Each name supports wildcard characters
1284 // "*" (matches zero or many characters) and "?" (at least one character).
1285 namespaces?: [...string]
1286
1287 // Operations can contain values ["CREATE, "UPDATE", "CONNECT", "DELETE"], which
1288 // are used to match a specific action.
1289 operations?: [..."CREATE" | "CONNECT" | "UPDATE" | "DELETE"]
1290
1291 // Selector is a label selector. Label keys and values in `matchLabels` support the wildcard
1292 // characters `*` (matches zero or many characters) and `?` (matches one character).
1293 // Wildcards allows writing label selectors like ["storage.k8s.io/*": "*"]. Note that
1294 // using ["*" : "*"] matches any key and value but does not match an empty label set.
1295 selector?: {
1296 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
1297 matchExpressions?: [...{
1298 // key is the label key that the selector applies to.
1299 key!: string
1300
1301 // operator represents a key's relationship to a set of values.
1302 // Valid operators are In, NotIn, Exists and DoesNotExist.
1303 operator!: string
1304
1305 // values is an array of string values. If the operator is In or NotIn,
1306 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
1307 // the values array must be empty. This array is replaced during a strategic
1308 // merge patch.
1309 values?: [...string]
1310 }]
1311
1312 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
1313 // map is equivalent to an element of matchExpressions, whose key field is "key", the
1314 // operator is "In", and the values array contains only "value". The requirements are ANDed.
1315 matchLabels?: [string]: string
1316 }
1317 }
1318
1319 // Roles is the list of namespaced role names for the user.
1320 roles?: [...string]
1321
1322 // Subjects is the list of subject names like users, user groups, and service accounts.
1323 subjects?: [...{
1324 // APIGroup holds the API group of the referenced subject.
1325 // Defaults to "" for ServiceAccount subjects.
1326 // Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
1327 apiGroup?: string
1328
1329 // Kind of object being referenced. Values defined by this API group are "User",
1330 // "Group", and "ServiceAccount".
1331 // If the Authorizer does not recognized the kind value, the Authorizer should report an error.
1332 kind!: string
1333
1334 // Name of the object being referenced.
1335 name!: string
1336
1337 // Namespace of the referenced object. If the object kind is non-namespace, such
1338 // as "User" or "Group", and this value is not empty
1339 // the Authorizer should report an error.
1340 namespace?: string
1341 }]
1342 }
1343
1344 // Mutation is used to modify matching resources.
1345 mutate?: {
1346 // ForEach applies mutation rules to a list of sub-elements by creating a
1347 // context for each entry in the list and looping over it to apply the
1348 // specified logic.
1349 foreach?: [...{
1350 // Context defines variables and data sources that can be used during rule execution.
1351 context?: [...matchN(1, [
1352 {configMap!: _}, {apiCall!: _}, {imageRegistry!: _}, {variable!: _}, {globalReference!: _},
1353 ]) & {
1354 // APICall is an HTTP request to the Kubernetes API server, or other JSON web service.
1355 // The data returned is stored in the context with the name for the context entry.
1356 apiCall?: {
1357 // The data object specifies the POST data sent to the server.
1358 // Only applicable when the method field is set to POST.
1359 data?: [...{
1360 // Key is a unique identifier for the data value
1361 key!: string
1362
1363 // Value is the data value
1364 value!: null | bool | number | string | [...] | {...}
1365 }]
1366
1367 // Default is an optional arbitrary JSON object that the context
1368 // value is set to, if the apiCall returns error.
1369 default?: null | bool | number | string | [...] | {...}
1370
1371 // JMESPath is an optional JSON Match Expression that can be used to
1372 // transform the JSON response returned from the server. For example
1373 // a JMESPath of "items | length(@)" applied to the API server response
1374 // for the URLPath "/apis/apps/v1/deployments" will return the total count
1375 // of deployments across all namespaces.
1376 jmesPath?: string
1377
1378 // Method is the HTTP request type (GET or POST). Defaults to GET.
1379 method?: "GET" | "POST"
1380
1381 // Service is an API call to a JSON web service.
1382 // This is used for non-Kubernetes API server calls.
1383 // It's mutually exclusive with the URLPath field.
1384 service?: {
1385 // CABundle is a PEM encoded CA bundle which will be used to validate
1386 // the server certificate.
1387 caBundle?: string
1388
1389 // Headers is a list of optional HTTP headers to be included in the request.
1390 headers?: [...{
1391 // Key is the header key
1392 key!: string
1393
1394 // Value is the header value
1395 value!: string
1396 }]
1397
1398 // URL is the JSON web service URL. A typical form is
1399 // `https://{service}.{namespace}:{port}/{path}`.
1400 url!: string
1401 }
1402
1403 // URLPath is the URL path to be used in the HTTP GET or POST request to the
1404 // Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
1405 // The format required is the same format used by the `kubectl get --raw` command.
1406 // See
1407 // https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls
1408 // for details.
1409 // It's mutually exclusive with the Service field.
1410 urlPath?: string
1411 }
1412
1413 // ConfigMap is the ConfigMap reference.
1414 configMap?: {
1415 // Name is the ConfigMap name.
1416 name!: string
1417
1418 // Namespace is the ConfigMap namespace.
1419 namespace?: string
1420 }
1421
1422 // GlobalContextEntryReference is a reference to a cached global context entry.
1423 globalReference?: {
1424 // JMESPath is an optional JSON Match Expression that can be used to
1425 // transform the JSON response returned from the server. For example
1426 // a JMESPath of "items | length(@)" applied to the API server response
1427 // for the URLPath "/apis/apps/v1/deployments" will return the total count
1428 // of deployments across all namespaces.
1429 jmesPath?: string
1430
1431 // Name of the global context entry
1432 name!: string
1433 }
1434
1435 // ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image
1436 // details.
1437 imageRegistry?: {
1438 // ImageRegistryCredentials provides credentials that will be used for authentication with registry
1439 imageRegistryCredentials?: {
1440 // AllowInsecureRegistry allows insecure access to a registry.
1441 allowInsecureRegistry?: bool
1442
1443 // Providers specifies a list of OCI Registry names, whose authentication providers are provided.
1444 // It can be of one of these values: default,google,azure,amazon,github.
1445 providers?: [..."default" | "amazon" | "azure" | "google" | "github"]
1446
1447 // Secrets specifies a list of secrets that are provided for credentials.
1448 // Secrets can be specified as a name (Kyverno namespace) or namespace/name.
1449 // imagePullSecrets from the resource namespace are also used.
1450 secrets?: [...string]
1451 }
1452
1453 // JMESPath is an optional JSON Match Expression that can be used to
1454 // transform the ImageData struct returned as a result of processing
1455 // the image reference.
1456 jmesPath?: string
1457
1458 // Reference is image reference to a container image in the registry.
1459 // Example: ghcr.io/kyverno/kyverno:latest
1460 reference!: string
1461 }
1462
1463 // Name is the variable name.
1464 name!: string
1465
1466 // Variable defines an arbitrary JMESPath context variable that can be defined inline.
1467 variable?: {
1468 // Default is an optional arbitrary JSON object that the variable may take if the JMESPath
1469 // expression evaluates to nil
1470 default?: null | bool | number | string | [...] | {...}
1471
1472 // JMESPath is an optional JMESPath Expression that can be used to
1473 // transform the variable.
1474 jmesPath?: string
1475
1476 // Value is any arbitrary JSON object representable in YAML or JSON form.
1477 value?: null | bool | number | string | [...] | {...}
1478 }
1479 }]
1480
1481 // Foreach declares a nested foreach iterator
1482 foreach?: null | bool | number | string | [...] | {...}
1483
1484 // List specifies a JMESPath expression that results in one or more elements
1485 // to which the validation logic is applied.
1486 list?: string
1487
1488 // Order defines the iteration order on the list.
1489 // Can be Ascending to iterate from first to last element or Descending to
1490 // iterate in from last to first element.
1491 order?: "Ascending" | "Descending"
1492
1493 // PatchStrategicMerge is a strategic merge patch used to modify resources.
1494 // See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
1495 // and https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patchesstrategicmerge/.
1496 patchStrategicMerge?: null | bool | number | string | [...] | {...}
1497
1498 // PatchesJSON6902 is a list of RFC 6902 JSON Patch declarations used to modify resources.
1499 // See https://tools.ietf.org/html/rfc6902 and
1500 // https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patchesjson6902/.
1501 patchesJson6902?: string
1502
1503 // AnyAllConditions are used to determine if a policy rule should be applied by evaluating a
1504 // set of conditions. The declaration can contain nested `any` or `all` statements.
1505 // See: https://kyverno.io/docs/writing-policies/preconditions/
1506 preconditions?: {
1507 // AllConditions enable variable-based conditional rule execution. This is useful for
1508 // finer control of when an rule is applied. A condition can reference object data
1509 // using JMESPath notation.
1510 // Here, all of the conditions need to pass
1511 all?: [...{
1512 // Key is the context entry (using JMESPath) for conditional rule evaluation.
1513 key?: null | bool | number | string | [...] | {...}
1514
1515 // Message is an optional display message
1516 message?: string
1517
1518 // Operator is the conditional operation to perform. Valid operators are:
1519 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
1520 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
1521 // DurationLessThanOrEquals, DurationLessThan
1522 operator?: "Equals" |
1523 "NotEquals" |
1524 "In" |
1525 "AnyIn" |
1526 "AllIn" |
1527 "NotIn" |
1528 "AnyNotIn" |
1529 "AllNotIn" |
1530 "GreaterThanOrEquals" |
1531 "GreaterThan" |
1532 "LessThanOrEquals" |
1533 "LessThan" |
1534 "DurationGreaterThanOrEquals" |
1535 "DurationGreaterThan" |
1536 "DurationLessThanOrEquals" |
1537 "DurationLessThan"
1538
1539 // Value is the conditional value, or set of values. The values can be fixed set
1540 // or can be variables declared using JMESPath.
1541 value?: null | bool | number | string | [...] | {...}
1542 }]
1543
1544 // AnyConditions enable variable-based conditional rule execution. This is useful for
1545 // finer control of when an rule is applied. A condition can reference object data
1546 // using JMESPath notation.
1547 // Here, at least one of the conditions need to pass
1548 any?: [...{
1549 // Key is the context entry (using JMESPath) for conditional rule evaluation.
1550 key?: null | bool | number | string | [...] | {...}
1551
1552 // Message is an optional display message
1553 message?: string
1554
1555 // Operator is the conditional operation to perform. Valid operators are:
1556 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
1557 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
1558 // DurationLessThanOrEquals, DurationLessThan
1559 operator?: "Equals" |
1560 "NotEquals" |
1561 "In" |
1562 "AnyIn" |
1563 "AllIn" |
1564 "NotIn" |
1565 "AnyNotIn" |
1566 "AllNotIn" |
1567 "GreaterThanOrEquals" |
1568 "GreaterThan" |
1569 "LessThanOrEquals" |
1570 "LessThan" |
1571 "DurationGreaterThanOrEquals" |
1572 "DurationGreaterThan" |
1573 "DurationLessThanOrEquals" |
1574 "DurationLessThan"
1575
1576 // Value is the conditional value, or set of values. The values can be fixed set
1577 // or can be variables declared using JMESPath.
1578 value?: null | bool | number | string | [...] | {...}
1579 }]
1580 ...
1581 }
1582 }]
1583
1584 // MutateExistingOnPolicyUpdate controls if the mutateExisting rule will be
1585 // applied on policy events.
1586 mutateExistingOnPolicyUpdate?: bool
1587
1588 // PatchStrategicMerge is a strategic merge patch used to modify resources.
1589 // See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
1590 // and https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patchesstrategicmerge/.
1591 patchStrategicMerge?: null | bool | number | string | [...] | {...}
1592
1593 // PatchesJSON6902 is a list of RFC 6902 JSON Patch declarations used to modify resources.
1594 // See https://tools.ietf.org/html/rfc6902 and
1595 // https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patchesjson6902/.
1596 patchesJson6902?: string
1597
1598 // Targets defines the target resources to be mutated.
1599 targets?: [...{
1600 // APIVersion specifies resource apiVersion.
1601 apiVersion?: string
1602
1603 // Context defines variables and data sources that can be used during rule execution.
1604 context?: [...matchN(1, [
1605 {configMap!: _}, {apiCall!: _}, {imageRegistry!: _}, {variable!: _}, {globalReference!: _},
1606 ]) & {
1607 // APICall is an HTTP request to the Kubernetes API server, or other JSON web service.
1608 // The data returned is stored in the context with the name for the context entry.
1609 apiCall?: {
1610 // The data object specifies the POST data sent to the server.
1611 // Only applicable when the method field is set to POST.
1612 data?: [...{
1613 // Key is a unique identifier for the data value
1614 key!: string
1615
1616 // Value is the data value
1617 value!: null | bool | number | string | [...] | {...}
1618 }]
1619
1620 // Default is an optional arbitrary JSON object that the context
1621 // value is set to, if the apiCall returns error.
1622 default?: null | bool | number | string | [...] | {...}
1623
1624 // JMESPath is an optional JSON Match Expression that can be used to
1625 // transform the JSON response returned from the server. For example
1626 // a JMESPath of "items | length(@)" applied to the API server response
1627 // for the URLPath "/apis/apps/v1/deployments" will return the total count
1628 // of deployments across all namespaces.
1629 jmesPath?: string
1630
1631 // Method is the HTTP request type (GET or POST). Defaults to GET.
1632 method?: "GET" | "POST"
1633
1634 // Service is an API call to a JSON web service.
1635 // This is used for non-Kubernetes API server calls.
1636 // It's mutually exclusive with the URLPath field.
1637 service?: {
1638 // CABundle is a PEM encoded CA bundle which will be used to validate
1639 // the server certificate.
1640 caBundle?: string
1641
1642 // Headers is a list of optional HTTP headers to be included in the request.
1643 headers?: [...{
1644 // Key is the header key
1645 key!: string
1646
1647 // Value is the header value
1648 value!: string
1649 }]
1650
1651 // URL is the JSON web service URL. A typical form is
1652 // `https://{service}.{namespace}:{port}/{path}`.
1653 url!: string
1654 }
1655
1656 // URLPath is the URL path to be used in the HTTP GET or POST request to the
1657 // Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
1658 // The format required is the same format used by the `kubectl get --raw` command.
1659 // See
1660 // https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls
1661 // for details.
1662 // It's mutually exclusive with the Service field.
1663 urlPath?: string
1664 }
1665
1666 // ConfigMap is the ConfigMap reference.
1667 configMap?: {
1668 // Name is the ConfigMap name.
1669 name!: string
1670
1671 // Namespace is the ConfigMap namespace.
1672 namespace?: string
1673 }
1674
1675 // GlobalContextEntryReference is a reference to a cached global context entry.
1676 globalReference?: {
1677 // JMESPath is an optional JSON Match Expression that can be used to
1678 // transform the JSON response returned from the server. For example
1679 // a JMESPath of "items | length(@)" applied to the API server response
1680 // for the URLPath "/apis/apps/v1/deployments" will return the total count
1681 // of deployments across all namespaces.
1682 jmesPath?: string
1683
1684 // Name of the global context entry
1685 name!: string
1686 }
1687
1688 // ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image
1689 // details.
1690 imageRegistry?: {
1691 // ImageRegistryCredentials provides credentials that will be used for authentication with registry
1692 imageRegistryCredentials?: {
1693 // AllowInsecureRegistry allows insecure access to a registry.
1694 allowInsecureRegistry?: bool
1695
1696 // Providers specifies a list of OCI Registry names, whose authentication providers are provided.
1697 // It can be of one of these values: default,google,azure,amazon,github.
1698 providers?: [..."default" | "amazon" | "azure" | "google" | "github"]
1699
1700 // Secrets specifies a list of secrets that are provided for credentials.
1701 // Secrets can be specified as a name (Kyverno namespace) or namespace/name.
1702 // imagePullSecrets from the resource namespace are also used.
1703 secrets?: [...string]
1704 }
1705
1706 // JMESPath is an optional JSON Match Expression that can be used to
1707 // transform the ImageData struct returned as a result of processing
1708 // the image reference.
1709 jmesPath?: string
1710
1711 // Reference is image reference to a container image in the registry.
1712 // Example: ghcr.io/kyverno/kyverno:latest
1713 reference!: string
1714 }
1715
1716 // Name is the variable name.
1717 name!: string
1718
1719 // Variable defines an arbitrary JMESPath context variable that can be defined inline.
1720 variable?: {
1721 // Default is an optional arbitrary JSON object that the variable may take if the JMESPath
1722 // expression evaluates to nil
1723 default?: null | bool | number | string | [...] | {...}
1724
1725 // JMESPath is an optional JMESPath Expression that can be used to
1726 // transform the variable.
1727 jmesPath?: string
1728
1729 // Value is any arbitrary JSON object representable in YAML or JSON form.
1730 value?: null | bool | number | string | [...] | {...}
1731 }
1732 }]
1733
1734 // Kind specifies resource kind.
1735 kind?: string
1736
1737 // Name specifies the resource name.
1738 name?: string
1739
1740 // Namespace specifies resource namespace.
1741 namespace?: string
1742
1743 // Preconditions are used to determine if a policy rule should be applied by evaluating a
1744 // set of conditions. The declaration can contain nested `any` or `all` statements. A direct list
1745 // of conditions (without `any` or `all` statements is supported for backwards compatibility but
1746 // will be deprecated in the next major release.
1747 // See: https://kyverno.io/docs/writing-policies/preconditions/
1748 preconditions?: null | bool | number | string | [...] | {...}
1749
1750 // Selector allows you to select target resources with their labels.
1751 selector?: {
1752 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
1753 matchExpressions?: [...{
1754 // key is the label key that the selector applies to.
1755 key!: string
1756
1757 // operator represents a key's relationship to a set of values.
1758 // Valid operators are In, NotIn, Exists and DoesNotExist.
1759 operator!: string
1760
1761 // values is an array of string values. If the operator is In or NotIn,
1762 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
1763 // the values array must be empty. This array is replaced during a strategic
1764 // merge patch.
1765 values?: [...string]
1766 }]
1767
1768 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
1769 // map is equivalent to an element of matchExpressions, whose key field is "key", the
1770 // operator is "In", and the values array contains only "value". The requirements are ANDed.
1771 matchLabels?: [string]: string
1772 }
1773
1774 // UID specifies the resource uid.
1775 uid?: string
1776 }]
1777 }
1778
1779 // Name is a label to identify the rule, It must be unique within the policy.
1780 name!: strings.MaxRunes(
1781 63,
1782 )
1783
1784 // Preconditions are used to determine if a policy rule should be applied by evaluating a
1785 // set of conditions. The declaration can contain nested `any` or `all` statements. A direct list
1786 // of conditions (without `any` or `all` statements is supported for backwards compatibility but
1787 // will be deprecated in the next major release.
1788 // See: https://kyverno.io/docs/writing-policies/preconditions/
1789 preconditions?: null | bool | number | string | [...] | {...}
1790
1791 // ReportProperties are the additional properties from the rule that will be
1792 // added to the policy report result
1793 reportProperties?: [string]: string
1794
1795 // SkipBackgroundRequests bypasses admission requests that are sent by the background controller.
1796 // The default value is set to "true", it must be set to "false" to apply
1797 // generate and mutateExisting rules to those requests.
1798 skipBackgroundRequests?: bool
1799
1800 // Validation is used to validate matching resources.
1801 validate?: {
1802 // AllowExistingViolations allows prexisting violating resources to continue violating a policy.
1803 allowExistingViolations?: bool
1804
1805 // AnyPattern specifies list of validation patterns. At least one of the patterns
1806 // must be satisfied for the validation rule to succeed.
1807 anyPattern?: null | bool | number | string | [...] | {...}
1808
1809 // Assert defines a kyverno-json assertion tree.
1810 assert?: {...}
1811
1812 // CEL allows validation checks using the Common Expression Language
1813 // (https://kubernetes.io/docs/reference/using-api/cel/).
1814 cel?: {
1815 // AuditAnnotations contains CEL expressions which are used to produce audit
1816 // annotations for the audit event of the API request.
1817 auditAnnotations?: [...{
1818 // key specifies the audit annotation key. The audit annotation keys of
1819 // a ValidatingAdmissionPolicy must be unique. The key must be a qualified
1820 // name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length.
1821 //
1822 // The key is combined with the resource name of the
1823 // ValidatingAdmissionPolicy to construct an audit annotation key:
1824 // "{ValidatingAdmissionPolicy name}/{key}".
1825 //
1826 // If an admission webhook uses the same resource name as this ValidatingAdmissionPolicy
1827 // and the same audit annotation key, the annotation key will be identical.
1828 // In this case, the first annotation written with the key will be included
1829 // in the audit event and all subsequent annotations with the same key
1830 // will be discarded.
1831 //
1832 // Required.
1833 key!: string
1834
1835 // valueExpression represents the expression which is evaluated by CEL to
1836 // produce an audit annotation value. The expression must evaluate to either
1837 // a string or null value. If the expression evaluates to a string, the
1838 // audit annotation is included with the string value. If the expression
1839 // evaluates to null or empty string the audit annotation will be omitted.
1840 // The valueExpression may be no longer than 5kb in length.
1841 // If the result of the valueExpression is more than 10kb in length, it
1842 // will be truncated to 10kb.
1843 //
1844 // If multiple ValidatingAdmissionPolicyBinding resources match an
1845 // API request, then the valueExpression will be evaluated for
1846 // each binding. All unique values produced by the valueExpressions
1847 // will be joined together in a comma-separated list.
1848 //
1849 // Required.
1850 valueExpression!: string
1851 }]
1852
1853 // Expressions is a list of CELExpression types.
1854 expressions?: [...{
1855 // Expression represents the expression which will be evaluated by CEL.
1856 // ref: https://github.com/google/cel-spec
1857 // CEL expressions have access to the contents of the API request/response,
1858 // organized into CEL variables as well as some other useful variables:
1859 //
1860 // - 'object' - The object from the incoming request. The value is null for DELETE requests.
1861 // - 'oldObject' - The existing object. The value is null for CREATE requests.
1862 // - 'request' - Attributes of the API
1863 // request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
1864 // - 'params' - Parameter resource referred to by the policy binding being
1865 // evaluated. Only populated if the policy has a ParamKind.
1866 // - 'namespaceObject' - The namespace object that the incoming object belongs
1867 // to. The value is null for cluster-scoped resources.
1868 // - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
1869 // For example, a variable named 'foo' can be accessed as 'variables.foo'.
1870 // - 'authorizer' - A CEL Authorizer. May be used to perform authorization
1871 // checks for the principal (user or service account) of the request.
1872 // See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
1873 // - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the
1874 // 'authorizer' and configured with the
1875 // request resource.
1876 //
1877 // The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are
1878 // always accessible from the root of the
1879 // object. No other metadata properties are accessible.
1880 //
1881 // Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
1882 // Accessible property names are escaped according to the following rules when
1883 // accessed in the expression:
1884 // - '__' escapes to '__underscores__'
1885 // - '.' escapes to '__dot__'
1886 // - '-' escapes to '__dash__'
1887 // - '/' escapes to '__slash__'
1888 // - Property names that exactly match a CEL RESERVED keyword escape to
1889 // '__{keyword}__'. The keywords are:
1890 // "true", "false", "null", "in", "as", "break", "const", "continue", "else",
1891 // "for", "function", "if",
1892 // "import", "let", "loop", "package", "namespace", "return".
1893 // Examples:
1894 // - Expression accessing a property named "namespace": {"Expression": "object.__namespace__ > 0"}
1895 // - Expression accessing a property named "x-prop": {"Expression": "object.x__dash__prop > 0"}
1896 // - Expression accessing a property named "redact__d": {"Expression":
1897 // "object.redact__underscores__d > 0"}
1898 //
1899 // Equality on arrays with list type of 'set' or 'map' ignores element order, i.e. [1, 2] == [2, 1].
1900 // Concatenation on arrays with x-kubernetes-list-type use the semantics of the list type:
1901 // - 'set': `X + Y` performs a union where the array positions of all elements
1902 // in `X` are preserved and
1903 // non-intersecting elements in `Y` are appended, retaining their partial order.
1904 // - 'map': `X + Y` performs a merge where the array positions of all keys in
1905 // `X` are preserved but the values
1906 // are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with
1907 // non-intersecting keys are appended, retaining their partial order.
1908 // Required.
1909 expression!: string
1910
1911 // Message represents the message displayed when validation fails. The message
1912 // is required if the Expression contains
1913 // line breaks. The message must not contain line breaks.
1914 // If unset, the message is "failed rule: {Rule}".
1915 // e.g. "must be a URL with the host matching spec.host"
1916 // If the Expression contains line breaks. Message is required.
1917 // The message must not contain line breaks.
1918 // If unset, the message is "failed Expression: {Expression}".
1919 message?: string
1920
1921 // messageExpression declares a CEL expression that evaluates to the validation
1922 // failure message that is returned when this rule fails.
1923 // Since messageExpression is used as a failure message, it must evaluate to a string.
1924 // If both message and messageExpression are present on a validation, then
1925 // messageExpression will be used if validation fails.
1926 // If messageExpression results in a runtime error, the runtime error is logged,
1927 // and the validation failure message is produced
1928 // as if the messageExpression field were unset. If messageExpression evaluates
1929 // to an empty string, a string with only spaces, or a string
1930 // that contains line breaks, then the validation failure message will also be
1931 // produced as if the messageExpression field were unset, and
1932 // the fact that messageExpression produced an empty string/string with only
1933 // spaces/string with line breaks will be logged.
1934 // messageExpression has access to all the same variables as the `expression`
1935 // except for 'authorizer' and 'authorizer.requestResource'.
1936 // Example:
1937 // "object.x must be less than max ("+string(params.max)+")"
1938 messageExpression?: string
1939
1940 // Reason represents a machine-readable description of why this validation failed.
1941 // If this is the first validation in the list to fail, this reason, as well as the
1942 // corresponding HTTP response code, are used in the
1943 // HTTP response to the client.
1944 // The currently supported reasons are: "Unauthorized", "Forbidden", "Invalid",
1945 // "RequestEntityTooLarge".
1946 // If not set, StatusReasonInvalid is used in the response to the client.
1947 reason?: string
1948 }]
1949
1950 // Generate specifies whether to generate a Kubernetes ValidatingAdmissionPolicy from the rule.
1951 // Optional. Defaults to "false" if not specified.
1952 generate?: bool
1953
1954 // ParamKind is a tuple of Group Kind and Version.
1955 paramKind?: {
1956 // APIVersion is the API group version the resources belong to.
1957 // In format of "group/version".
1958 // Required.
1959 apiVersion?: string
1960
1961 // Kind is the API kind the resources belong to.
1962 // Required.
1963 kind?: string
1964 }
1965
1966 // ParamRef references a parameter resource.
1967 paramRef?: {
1968 // name is the name of the resource being referenced.
1969 //
1970 // One of `name` or `selector` must be set, but `name` and `selector` are
1971 // mutually exclusive properties. If one is set, the other must be unset.
1972 //
1973 // A single parameter used for all admission requests can be configured
1974 // by setting the `name` field, leaving `selector` blank, and setting namespace
1975 // if `paramKind` is namespace-scoped.
1976 name?: string
1977
1978 // namespace is the namespace of the referenced resource. Allows limiting
1979 // the search for params to a specific namespace. Applies to both `name` and
1980 // `selector` fields.
1981 //
1982 // A per-namespace parameter may be used by specifying a namespace-scoped
1983 // `paramKind` in the policy and leaving this field empty.
1984 //
1985 // - If `paramKind` is cluster-scoped, this field MUST be unset. Setting this
1986 // field results in a configuration error.
1987 //
1988 // - If `paramKind` is namespace-scoped, the namespace of the object being
1989 // evaluated for admission will be used when this field is left unset. Take
1990 // care that if this is left empty the binding must not match any cluster-scoped
1991 // resources, which will result in an error.
1992 namespace?: string
1993
1994 // `parameterNotFoundAction` controls the behavior of the binding when the resource
1995 // exists, and name or selector is valid, but there are no parameters
1996 // matched by the binding. If the value is set to `Allow`, then no
1997 // matched parameters will be treated as successful validation by the binding.
1998 // If set to `Deny`, then no matched parameters will be subject to the
1999 // `failurePolicy` of the policy.
2000 //
2001 // Allowed values are `Allow` or `Deny`
2002 //
2003 // Required
2004 parameterNotFoundAction?: string
2005
2006 // selector can be used to match multiple param objects based on their labels.
2007 // Supply selector: {} to match all resources of the ParamKind.
2008 //
2009 // If multiple params are found, they are all evaluated with the policy expressions
2010 // and the results are ANDed together.
2011 //
2012 // One of `name` or `selector` must be set, but `name` and `selector` are
2013 // mutually exclusive properties. If one is set, the other must be unset.
2014 selector?: {
2015 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
2016 matchExpressions?: [...{
2017 // key is the label key that the selector applies to.
2018 key!: string
2019
2020 // operator represents a key's relationship to a set of values.
2021 // Valid operators are In, NotIn, Exists and DoesNotExist.
2022 operator!: string
2023
2024 // values is an array of string values. If the operator is In or NotIn,
2025 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
2026 // the values array must be empty. This array is replaced during a strategic
2027 // merge patch.
2028 values?: [...string]
2029 }]
2030
2031 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
2032 // map is equivalent to an element of matchExpressions, whose key field is "key", the
2033 // operator is "In", and the values array contains only "value". The requirements are ANDed.
2034 matchLabels?: [string]: string
2035 }
2036 }
2037
2038 // Variables contain definitions of variables that can be used in composition of other expressions.
2039 // Each variable is defined as a named CEL expression.
2040 // The variables defined here will be available under `variables` in other
2041 // expressions of the policy.
2042 variables?: [...{
2043 // Expression is the expression that will be evaluated as the value of the variable.
2044 // The CEL expression has access to the same identifiers as the CEL expressions in Validation.
2045 expression!: string
2046
2047 // Name is the name of the variable. The name must be a valid CEL identifier and
2048 // unique among all variables.
2049 // The variable can be accessed in other expressions through `variables`
2050 // For example, if name is "foo", the variable will be available as `variables.foo`
2051 name!: string
2052 }]
2053 }
2054
2055 // Deny defines conditions used to pass or fail a validation rule.
2056 deny?: {
2057 // Multiple conditions can be declared under an `any` or `all` statement. A direct list
2058 // of conditions (without `any` or `all` statements) is also supported for backwards compatibility
2059 // but will be deprecated in the next major release.
2060 // See: https://kyverno.io/docs/writing-policies/validate/#deny-rules
2061 conditions?: null | bool | number | string | [...] | {...}
2062 }
2063
2064 // FailureAction defines if a validation policy rule violation should block
2065 // the admission review request (Enforce), or allow (Audit) the admission review request
2066 // and report an error in a policy report. Optional.
2067 // Allowed values are Audit or Enforce.
2068 failureAction?: "Audit" | "Enforce"
2069
2070 // FailureActionOverrides is a Cluster Policy attribute that specifies FailureAction
2071 // namespace-wise. It overrides FailureAction for the specified namespaces.
2072 failureActionOverrides?: [...{
2073 // ValidationFailureAction defines the policy validation failure action
2074 action?: "audit" | "enforce" | "Audit" | "Enforce"
2075
2076 // A label selector is a label query over a set of resources. The result of matchLabels and
2077 // matchExpressions are ANDed. An empty label selector matches all objects. A null
2078 // label selector matches no objects.
2079 namespaceSelector?: {
2080 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
2081 matchExpressions?: [...{
2082 // key is the label key that the selector applies to.
2083 key!: string
2084
2085 // operator represents a key's relationship to a set of values.
2086 // Valid operators are In, NotIn, Exists and DoesNotExist.
2087 operator!: string
2088
2089 // values is an array of string values. If the operator is In or NotIn,
2090 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
2091 // the values array must be empty. This array is replaced during a strategic
2092 // merge patch.
2093 values?: [...string]
2094 }]
2095
2096 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
2097 // map is equivalent to an element of matchExpressions, whose key field is "key", the
2098 // operator is "In", and the values array contains only "value". The requirements are ANDed.
2099 matchLabels?: [string]: string
2100 }
2101 namespaces?: [...string]
2102 }]
2103
2104 // ForEach applies validate rules to a list of sub-elements by creating a
2105 // context for each entry in the list and looping over it to apply the
2106 // specified logic.
2107 foreach?: [...{
2108 // AnyPattern specifies list of validation patterns. At least one of the patterns
2109 // must be satisfied for the validation rule to succeed.
2110 anyPattern?: null | bool | number | string | [...] | {...}
2111
2112 // Context defines variables and data sources that can be used during rule execution.
2113 context?: [...matchN(1, [
2114 {configMap!: _}, {apiCall!: _}, {imageRegistry!: _}, {variable!: _}, {globalReference!: _},
2115 ]) & {
2116 // APICall is an HTTP request to the Kubernetes API server, or other JSON web service.
2117 // The data returned is stored in the context with the name for the context entry.
2118 apiCall?: {
2119 // The data object specifies the POST data sent to the server.
2120 // Only applicable when the method field is set to POST.
2121 data?: [...{
2122 // Key is a unique identifier for the data value
2123 key!: string
2124
2125 // Value is the data value
2126 value!: null | bool | number | string | [...] | {...}
2127 }]
2128
2129 // Default is an optional arbitrary JSON object that the context
2130 // value is set to, if the apiCall returns error.
2131 default?: null | bool | number | string | [...] | {...}
2132
2133 // JMESPath is an optional JSON Match Expression that can be used to
2134 // transform the JSON response returned from the server. For example
2135 // a JMESPath of "items | length(@)" applied to the API server response
2136 // for the URLPath "/apis/apps/v1/deployments" will return the total count
2137 // of deployments across all namespaces.
2138 jmesPath?: string
2139
2140 // Method is the HTTP request type (GET or POST). Defaults to GET.
2141 method?: "GET" | "POST"
2142
2143 // Service is an API call to a JSON web service.
2144 // This is used for non-Kubernetes API server calls.
2145 // It's mutually exclusive with the URLPath field.
2146 service?: {
2147 // CABundle is a PEM encoded CA bundle which will be used to validate
2148 // the server certificate.
2149 caBundle?: string
2150
2151 // Headers is a list of optional HTTP headers to be included in the request.
2152 headers?: [...{
2153 // Key is the header key
2154 key!: string
2155
2156 // Value is the header value
2157 value!: string
2158 }]
2159
2160 // URL is the JSON web service URL. A typical form is
2161 // `https://{service}.{namespace}:{port}/{path}`.
2162 url!: string
2163 }
2164
2165 // URLPath is the URL path to be used in the HTTP GET or POST request to the
2166 // Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
2167 // The format required is the same format used by the `kubectl get --raw` command.
2168 // See
2169 // https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls
2170 // for details.
2171 // It's mutually exclusive with the Service field.
2172 urlPath?: string
2173 }
2174
2175 // ConfigMap is the ConfigMap reference.
2176 configMap?: {
2177 // Name is the ConfigMap name.
2178 name!: string
2179
2180 // Namespace is the ConfigMap namespace.
2181 namespace?: string
2182 }
2183
2184 // GlobalContextEntryReference is a reference to a cached global context entry.
2185 globalReference?: {
2186 // JMESPath is an optional JSON Match Expression that can be used to
2187 // transform the JSON response returned from the server. For example
2188 // a JMESPath of "items | length(@)" applied to the API server response
2189 // for the URLPath "/apis/apps/v1/deployments" will return the total count
2190 // of deployments across all namespaces.
2191 jmesPath?: string
2192
2193 // Name of the global context entry
2194 name!: string
2195 }
2196
2197 // ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image
2198 // details.
2199 imageRegistry?: {
2200 // ImageRegistryCredentials provides credentials that will be used for authentication with registry
2201 imageRegistryCredentials?: {
2202 // AllowInsecureRegistry allows insecure access to a registry.
2203 allowInsecureRegistry?: bool
2204
2205 // Providers specifies a list of OCI Registry names, whose authentication providers are provided.
2206 // It can be of one of these values: default,google,azure,amazon,github.
2207 providers?: [..."default" | "amazon" | "azure" | "google" | "github"]
2208
2209 // Secrets specifies a list of secrets that are provided for credentials.
2210 // Secrets can be specified as a name (Kyverno namespace) or namespace/name.
2211 // imagePullSecrets from the resource namespace are also used.
2212 secrets?: [...string]
2213 }
2214
2215 // JMESPath is an optional JSON Match Expression that can be used to
2216 // transform the ImageData struct returned as a result of processing
2217 // the image reference.
2218 jmesPath?: string
2219
2220 // Reference is image reference to a container image in the registry.
2221 // Example: ghcr.io/kyverno/kyverno:latest
2222 reference!: string
2223 }
2224
2225 // Name is the variable name.
2226 name!: string
2227
2228 // Variable defines an arbitrary JMESPath context variable that can be defined inline.
2229 variable?: {
2230 // Default is an optional arbitrary JSON object that the variable may take if the JMESPath
2231 // expression evaluates to nil
2232 default?: null | bool | number | string | [...] | {...}
2233
2234 // JMESPath is an optional JMESPath Expression that can be used to
2235 // transform the variable.
2236 jmesPath?: string
2237
2238 // Value is any arbitrary JSON object representable in YAML or JSON form.
2239 value?: null | bool | number | string | [...] | {...}
2240 }
2241 }]
2242
2243 // Deny defines conditions used to pass or fail a validation rule.
2244 deny?: {
2245 // Multiple conditions can be declared under an `any` or `all` statement. A direct list
2246 // of conditions (without `any` or `all` statements) is also supported for backwards compatibility
2247 // but will be deprecated in the next major release.
2248 // See: https://kyverno.io/docs/writing-policies/validate/#deny-rules
2249 conditions?: null | bool | number | string | [...] | {...}
2250 }
2251
2252 // ElementScope specifies whether to use the current list element as the scope
2253 // for validation. Defaults to "true" if not specified.
2254 // When set to "false", "request.object" is used as the validation scope within the foreach
2255 // block to allow referencing other elements in the subtree.
2256 elementScope?: bool
2257
2258 // Foreach declares a nested foreach iterator
2259 foreach?: null | bool | number | string | [...] | {...}
2260
2261 // List specifies a JMESPath expression that results in one or more elements
2262 // to which the validation logic is applied.
2263 list?: string
2264
2265 // Pattern specifies an overlay-style pattern used to check resources.
2266 pattern?: null | bool | number | string | [...] | {...}
2267
2268 // AnyAllConditions are used to determine if a policy rule should be applied by evaluating a
2269 // set of conditions. The declaration can contain nested `any` or `all` statements.
2270 // See: https://kyverno.io/docs/writing-policies/preconditions/
2271 preconditions?: {
2272 // AllConditions enable variable-based conditional rule execution. This is useful for
2273 // finer control of when an rule is applied. A condition can reference object data
2274 // using JMESPath notation.
2275 // Here, all of the conditions need to pass
2276 all?: [...{
2277 // Key is the context entry (using JMESPath) for conditional rule evaluation.
2278 key?: null | bool | number | string | [...] | {...}
2279
2280 // Message is an optional display message
2281 message?: string
2282
2283 // Operator is the conditional operation to perform. Valid operators are:
2284 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
2285 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
2286 // DurationLessThanOrEquals, DurationLessThan
2287 operator?: "Equals" |
2288 "NotEquals" |
2289 "In" |
2290 "AnyIn" |
2291 "AllIn" |
2292 "NotIn" |
2293 "AnyNotIn" |
2294 "AllNotIn" |
2295 "GreaterThanOrEquals" |
2296 "GreaterThan" |
2297 "LessThanOrEquals" |
2298 "LessThan" |
2299 "DurationGreaterThanOrEquals" |
2300 "DurationGreaterThan" |
2301 "DurationLessThanOrEquals" |
2302 "DurationLessThan"
2303
2304 // Value is the conditional value, or set of values. The values can be fixed set
2305 // or can be variables declared using JMESPath.
2306 value?: null | bool | number | string | [...] | {...}
2307 }]
2308
2309 // AnyConditions enable variable-based conditional rule execution. This is useful for
2310 // finer control of when an rule is applied. A condition can reference object data
2311 // using JMESPath notation.
2312 // Here, at least one of the conditions need to pass
2313 any?: [...{
2314 // Key is the context entry (using JMESPath) for conditional rule evaluation.
2315 key?: null | bool | number | string | [...] | {...}
2316
2317 // Message is an optional display message
2318 message?: string
2319
2320 // Operator is the conditional operation to perform. Valid operators are:
2321 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
2322 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
2323 // DurationLessThanOrEquals, DurationLessThan
2324 operator?: "Equals" |
2325 "NotEquals" |
2326 "In" |
2327 "AnyIn" |
2328 "AllIn" |
2329 "NotIn" |
2330 "AnyNotIn" |
2331 "AllNotIn" |
2332 "GreaterThanOrEquals" |
2333 "GreaterThan" |
2334 "LessThanOrEquals" |
2335 "LessThan" |
2336 "DurationGreaterThanOrEquals" |
2337 "DurationGreaterThan" |
2338 "DurationLessThanOrEquals" |
2339 "DurationLessThan"
2340
2341 // Value is the conditional value, or set of values. The values can be fixed set
2342 // or can be variables declared using JMESPath.
2343 value?: null | bool | number | string | [...] | {...}
2344 }]
2345 ...
2346 }
2347 }]
2348
2349 // Manifest specifies conditions for manifest verification
2350 manifests?: {
2351 // AnnotationDomain is custom domain of annotation for message and signature.
2352 // Default is "cosign.sigstore.dev".
2353 annotationDomain?: string
2354
2355 // Attestors specified the required attestors (i.e. authorities)
2356 attestors?: [...{
2357 // Count specifies the required number of entries that must match. If the count
2358 // is null, all entries must match
2359 // (a logical AND). If the count is 1, at least one entry must match (a logical
2360 // OR). If the count contains a
2361 // value N, then N must be less than or equal to the size of entries, and at
2362 // least N entries must match.
2363 count?: int & >=1
2364
2365 // Entries contains the available attestors. An attestor can be a static key,
2366 // attributes for keyless verification, or a nested attestor declaration.
2367 entries?: [...{
2368 // Annotations are used for image verification.
2369 // Every specified key-value pair must exist and match in the verified payload.
2370 // The payload may contain other key-value pairs.
2371 annotations?: [string]: string
2372
2373 // Attestor is a nested set of Attestor used to specify a more complex set of match authorities.
2374 attestor?: null | bool | number | string | [...] | {...}
2375
2376 // Certificates specifies one or more certificates.
2377 certificates?: {
2378 // Cert is an optional PEM-encoded public certificate.
2379 cert?: string
2380
2381 // CertChain is an optional PEM encoded set of certificates used to verify.
2382 certChain?: string
2383
2384 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
2385 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
2386 ctlog?: {
2387 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
2388 // to check for a certificate
2389 // timestamp. Default is false. Set to true if this was opted out during signing.
2390 ignoreSCT?: bool
2391
2392 // PubKey, if set, is used to validate SCTs against a custom source.
2393 pubkey?: string
2394
2395 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
2396 // RFC3161 timestamp authority. Must
2397 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
2398 // may contain the leaf TSA certificate if not present in the timestamurce.
2399 tsaCertChain?: string
2400 }
2401
2402 // Rekor provides configuration for the Rekor transparency log service. If an empty object
2403 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
2404 rekor?: {
2405 // IgnoreTlog skips transparency log verification.
2406 ignoreTlog?: bool
2407
2408 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
2409 // If set, this will be used to validate transparency log signatures from a custom Rekor.
2410 pubkey?: string
2411
2412 // URL is the address of the transparency log. Defaults to the public Rekor log
2413 // instance https://rekor.sigstore.dev.
2414 url?: string
2415 }
2416 }
2417
2418 // Keyless is a set of attribute used to verify a Sigstore keyless attestor.
2419 // See https://github.com/sigstore/cosign/blob/main/KEYLESS.md.
2420 keyless?: {
2421 // AdditionalExtensions are certificate-extensions used for keyless signing.
2422 additionalExtensions?: [string]: string
2423
2424 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
2425 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
2426 ctlog?: {
2427 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
2428 // to check for a certificate
2429 // timestamp. Default is false. Set to true if this was opted out during signing.
2430 ignoreSCT?: bool
2431
2432 // PubKey, if set, is used to validate SCTs against a custom source.
2433 pubkey?: string
2434
2435 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
2436 // RFC3161 timestamp authority. Must
2437 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
2438 // may contain the leaf TSA certificate if not present in the timestamurce.
2439 tsaCertChain?: string
2440 }
2441
2442 // Issuer is the certificate issuer used for keyless signing.
2443 issuer?: string
2444
2445 // IssuerRegExp is the regular expression to match certificate issuer used for keyless signing.
2446 issuerRegExp?: string
2447
2448 // Rekor provides configuration for the Rekor transparency log service. If an empty object
2449 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
2450 rekor?: {
2451 // IgnoreTlog skips transparency log verification.
2452 ignoreTlog?: bool
2453
2454 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
2455 // If set, this will be used to validate transparency log signatures from a custom Rekor.
2456 pubkey?: string
2457
2458 // URL is the address of the transparency log. Defaults to the public Rekor log
2459 // instance https://rekor.sigstore.dev.
2460 url?: string
2461 }
2462
2463 // Roots is an optional set of PEM encoded trusted root certificates.
2464 // If not provided, the system roots are used.
2465 roots?: string
2466
2467 // Subject is the verified identity used for keyless signing, for example the email address.
2468 subject?: string
2469
2470 // SubjectRegExp is the regular expression to match identity used for keyless
2471 // signing, for example the email address.
2472 subjectRegExp?: string
2473 }
2474
2475 // Keys specifies one or more public keys.
2476 keys?: {
2477 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
2478 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
2479 ctlog?: {
2480 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
2481 // to check for a certificate
2482 // timestamp. Default is false. Set to true if this was opted out during signing.
2483 ignoreSCT?: bool
2484
2485 // PubKey, if set, is used to validate SCTs against a custom source.
2486 pubkey?: string
2487
2488 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
2489 // RFC3161 timestamp authority. Must
2490 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
2491 // may contain the leaf TSA certificate if not present in the timestamurce.
2492 tsaCertChain?: string
2493 }
2494
2495 // KMS provides the URI to the public key stored in a Key Management System. See:
2496 // https://github.com/sigstore/cosign/blob/main/KMS.md
2497 kms?: string
2498
2499 // Keys is a set of X.509 public keys used to verify image signatures. The keys can be directly
2500 // specified or can be a variable reference to a key specified in a ConfigMap (see
2501 // https://kyverno.io/docs/writing-policies/variables/), or reference a standard Kubernetes Secret
2502 // elsewhere in the cluster by specifying it in the format "k8s://<namespace>/<secret_name>".
2503 // The named Secret must specify a key `cosign.pub` containing the public key used for
2504 // verification, (see https://github.com/sigstore/cosign/blob/main/KMS.md#kubernetes-secret).
2505 // When multiple keys are specified each key is processed as a separate staticKey entry
2506 // (.attestors[*].entries.keys) within the set of attestors and the count is
2507 // applied across the keys.
2508 publicKeys?: string
2509
2510 // Rekor provides configuration for the Rekor transparency log service. If an empty object
2511 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
2512 rekor?: {
2513 // IgnoreTlog skips transparency log verification.
2514 ignoreTlog?: bool
2515
2516 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
2517 // If set, this will be used to validate transparency log signatures from a custom Rekor.
2518 pubkey?: string
2519
2520 // URL is the address of the transparency log. Defaults to the public Rekor log
2521 // instance https://rekor.sigstore.dev.
2522 url?: string
2523 }
2524
2525 // Reference to a Secret resource that contains a public key
2526 secret?: {
2527 // Name of the secret. The provided secret must contain a key named cosign.pub.
2528 name!: string
2529
2530 // Namespace name where the Secret exists.
2531 namespace!: string
2532 }
2533
2534 // Deprecated. Use attestor.signatureAlgorithm instead.
2535 signatureAlgorithm?: string
2536 }
2537
2538 // Repository is an optional alternate OCI repository to use for signatures and
2539 // attestations that match this rule.
2540 // If specified Repository will override other OCI image repository locations for this Attestor.
2541 repository?: string
2542
2543 // Specify signature algorithm for public keys. Supported values are sha224,
2544 // sha256, sha384 and sha512.
2545 signatureAlgorithm?: string
2546 }]
2547 }]
2548
2549 // DryRun configuration
2550 dryRun?: {
2551 enable?: bool
2552 namespace?: string
2553 }
2554
2555 // Fields which will be ignored while comparing manifests.
2556 ignoreFields?: [...{
2557 fields?: [...string]
2558 objects?: [...{
2559 group?: string
2560 kind?: string
2561 name?: string
2562 namespace?: string
2563 version?: string
2564 }]
2565 }]
2566
2567 // Repository is an optional alternate OCI repository to use for resource bundle reference.
2568 // The repository can be overridden per Attestor or Attestation.
2569 repository?: string
2570 }
2571
2572 // Message specifies a custom message to be displayed on failure.
2573 message?: string
2574
2575 // Pattern specifies an overlay-style pattern used to check resources.
2576 pattern?: null | bool | number | string | [...] | {...}
2577
2578 // PodSecurity applies exemptions for Kubernetes Pod Security admission
2579 // by specifying exclusions for Pod Security Standards controls.
2580 podSecurity?: {
2581 // Exclude specifies the Pod Security Standard controls to be excluded.
2582 exclude?: [...{
2583 // ControlName specifies the name of the Pod Security Standard control.
2584 // See: https://kubernetes.io/docs/concepts/security/pod-security-standards/
2585 controlName!: "HostProcess" |
2586 "Host Namespaces" |
2587 "Privileged Containers" |
2588 "Capabilities" |
2589 "HostPath Volumes" |
2590 "Host Ports" |
2591 "AppArmor" |
2592 "SELinux" |
2593 "/proc Mount Type" |
2594 "Seccomp" |
2595 "Sysctls" |
2596 "Volume Types" |
2597 "Privilege Escalation" |
2598 "Running as Non-root" |
2599 "Running as Non-root user"
2600
2601 // Images selects matching containers and applies the container level PSS.
2602 // Each image is the image name consisting of the registry address, repository, image, and tag.
2603 // Empty list matches no containers, PSS checks are applied at the pod level only.
2604 // Wildcards ('*' and '?') are allowed. See: https://kubernetes.io/docs/concepts/containers/images.
2605 images?: [...string]
2606
2607 // RestrictedField selects the field for the given Pod Security Standard control.
2608 // When not set, all restricted fields for the control are selected.
2609 restrictedField?: string
2610
2611 // Values defines the allowed values that can be excluded.
2612 values?: [...string]
2613 }]
2614
2615 // Level defines the Pod Security Standard level to be applied to workloads.
2616 // Allowed values are privileged, baseline, and restricted.
2617 level?: "privileged" | "baseline" | "restricted"
2618
2619 // Version defines the Pod Security Standard versions that Kubernetes supports.
2620 // Allowed values are v1.19, v1.20, v1.21, v1.22, v1.23, v1.24, v1.25, v1.26,
2621 // v1.27, v1.28, v1.29, v1.30, v1.31, v1.32, latest. Defaults to latest.
2622 version?: "v1.19" |
2623 "v1.20" |
2624 "v1.21" |
2625 "v1.22" |
2626 "v1.23" |
2627 "v1.24" |
2628 "v1.25" |
2629 "v1.26" |
2630 "v1.27" |
2631 "v1.28" |
2632 "v1.29" |
2633 "v1.30" |
2634 "v1.31" |
2635 "v1.32" |
2636 "latest"
2637 }
2638 }
2639
2640 // VerifyImages is used to verify image signatures and mutate them to add a digest
2641 verifyImages?: [...{
2642 // Deprecated.
2643 additionalExtensions?: [string]: string
2644
2645 // Deprecated. Use annotations per Attestor instead.
2646 annotations?: [string]: string
2647
2648 // Attestations are optional checks for signed in-toto Statements used to verify the image.
2649 // See https://github.com/in-toto/attestation. Kyverno fetches signed attestations from the
2650 // OCI registry and decodes them into a list of Statement declarations.
2651 attestations?: [...{
2652 // Attestors specify the required attestors (i.e. authorities).
2653 attestors?: [...{
2654 // Count specifies the required number of entries that must match. If the count
2655 // is null, all entries must match
2656 // (a logical AND). If the count is 1, at least one entry must match (a logical
2657 // OR). If the count contains a
2658 // value N, then N must be less than or equal to the size of entries, and at
2659 // least N entries must match.
2660 count?: int & >=1
2661
2662 // Entries contains the available attestors. An attestor can be a static key,
2663 // attributes for keyless verification, or a nested attestor declaration.
2664 entries?: [...{
2665 // Annotations are used for image verification.
2666 // Every specified key-value pair must exist and match in the verified payload.
2667 // The payload may contain other key-value pairs.
2668 annotations?: [string]: string
2669
2670 // Attestor is a nested set of Attestor used to specify a more complex set of match authorities.
2671 attestor?: null | bool | number | string | [...] | {...}
2672
2673 // Certificates specifies one or more certificates.
2674 certificates?: {
2675 // Cert is an optional PEM-encoded public certificate.
2676 cert?: string
2677
2678 // CertChain is an optional PEM encoded set of certificates used to verify.
2679 certChain?: string
2680
2681 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
2682 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
2683 ctlog?: {
2684 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
2685 // to check for a certificate
2686 // timestamp. Default is false. Set to true if this was opted out during signing.
2687 ignoreSCT?: bool
2688
2689 // PubKey, if set, is used to validate SCTs against a custom source.
2690 pubkey?: string
2691
2692 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
2693 // RFC3161 timestamp authority. Must
2694 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
2695 // may contain the leaf TSA certificate if not present in the timestamurce.
2696 tsaCertChain?: string
2697 }
2698
2699 // Rekor provides configuration for the Rekor transparency log service. If an empty object
2700 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
2701 rekor?: {
2702 // IgnoreTlog skips transparency log verification.
2703 ignoreTlog?: bool
2704
2705 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
2706 // If set, this will be used to validate transparency log signatures from a custom Rekor.
2707 pubkey?: string
2708
2709 // URL is the address of the transparency log. Defaults to the public Rekor log
2710 // instance https://rekor.sigstore.dev.
2711 url?: string
2712 }
2713 }
2714
2715 // Keyless is a set of attribute used to verify a Sigstore keyless attestor.
2716 // See https://github.com/sigstore/cosign/blob/main/KEYLESS.md.
2717 keyless?: {
2718 // AdditionalExtensions are certificate-extensions used for keyless signing.
2719 additionalExtensions?: [string]: string
2720
2721 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
2722 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
2723 ctlog?: {
2724 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
2725 // to check for a certificate
2726 // timestamp. Default is false. Set to true if this was opted out during signing.
2727 ignoreSCT?: bool
2728
2729 // PubKey, if set, is used to validate SCTs against a custom source.
2730 pubkey?: string
2731
2732 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
2733 // RFC3161 timestamp authority. Must
2734 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
2735 // may contain the leaf TSA certificate if not present in the timestamurce.
2736 tsaCertChain?: string
2737 }
2738
2739 // Issuer is the certificate issuer used for keyless signing.
2740 issuer?: string
2741
2742 // IssuerRegExp is the regular expression to match certificate issuer used for keyless signing.
2743 issuerRegExp?: string
2744
2745 // Rekor provides configuration for the Rekor transparency log service. If an empty object
2746 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
2747 rekor?: {
2748 // IgnoreTlog skips transparency log verification.
2749 ignoreTlog?: bool
2750
2751 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
2752 // If set, this will be used to validate transparency log signatures from a custom Rekor.
2753 pubkey?: string
2754
2755 // URL is the address of the transparency log. Defaults to the public Rekor log
2756 // instance https://rekor.sigstore.dev.
2757 url?: string
2758 }
2759
2760 // Roots is an optional set of PEM encoded trusted root certificates.
2761 // If not provided, the system roots are used.
2762 roots?: string
2763
2764 // Subject is the verified identity used for keyless signing, for example the email address.
2765 subject?: string
2766
2767 // SubjectRegExp is the regular expression to match identity used for keyless
2768 // signing, for example the email address.
2769 subjectRegExp?: string
2770 }
2771
2772 // Keys specifies one or more public keys.
2773 keys?: {
2774 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
2775 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
2776 ctlog?: {
2777 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
2778 // to check for a certificate
2779 // timestamp. Default is false. Set to true if this was opted out during signing.
2780 ignoreSCT?: bool
2781
2782 // PubKey, if set, is used to validate SCTs against a custom source.
2783 pubkey?: string
2784
2785 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
2786 // RFC3161 timestamp authority. Must
2787 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
2788 // may contain the leaf TSA certificate if not present in the timestamurce.
2789 tsaCertChain?: string
2790 }
2791
2792 // KMS provides the URI to the public key stored in a Key Management System. See:
2793 // https://github.com/sigstore/cosign/blob/main/KMS.md
2794 kms?: string
2795
2796 // Keys is a set of X.509 public keys used to verify image signatures. The keys can be directly
2797 // specified or can be a variable reference to a key specified in a ConfigMap (see
2798 // https://kyverno.io/docs/writing-policies/variables/), or reference a standard Kubernetes Secret
2799 // elsewhere in the cluster by specifying it in the format "k8s://<namespace>/<secret_name>".
2800 // The named Secret must specify a key `cosign.pub` containing the public key used for
2801 // verification, (see https://github.com/sigstore/cosign/blob/main/KMS.md#kubernetes-secret).
2802 // When multiple keys are specified each key is processed as a separate staticKey entry
2803 // (.attestors[*].entries.keys) within the set of attestors and the count is
2804 // applied across the keys.
2805 publicKeys?: string
2806
2807 // Rekor provides configuration for the Rekor transparency log service. If an empty object
2808 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
2809 rekor?: {
2810 // IgnoreTlog skips transparency log verification.
2811 ignoreTlog?: bool
2812
2813 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
2814 // If set, this will be used to validate transparency log signatures from a custom Rekor.
2815 pubkey?: string
2816
2817 // URL is the address of the transparency log. Defaults to the public Rekor log
2818 // instance https://rekor.sigstore.dev.
2819 url?: string
2820 }
2821
2822 // Reference to a Secret resource that contains a public key
2823 secret?: {
2824 // Name of the secret. The provided secret must contain a key named cosign.pub.
2825 name!: string
2826
2827 // Namespace name where the Secret exists.
2828 namespace!: string
2829 }
2830
2831 // Deprecated. Use attestor.signatureAlgorithm instead.
2832 signatureAlgorithm?: string
2833 }
2834
2835 // Repository is an optional alternate OCI repository to use for signatures and
2836 // attestations that match this rule.
2837 // If specified Repository will override other OCI image repository locations for this Attestor.
2838 repository?: string
2839
2840 // Specify signature algorithm for public keys. Supported values are sha224,
2841 // sha256, sha384 and sha512.
2842 signatureAlgorithm?: string
2843 }]
2844 }]
2845
2846 // Conditions are used to verify attributes within a Predicate. If no Conditions are specified
2847 // the attestation check is satisfied as long there are predicates that match the predicate type.
2848 conditions?: [...{
2849 // AllConditions enable variable-based conditional rule execution. This is useful for
2850 // finer control of when an rule is applied. A condition can reference object data
2851 // using JMESPath notation.
2852 // Here, all of the conditions need to pass
2853 all?: [...{
2854 // Key is the context entry (using JMESPath) for conditional rule evaluation.
2855 key?: null | bool | number | string | [...] | {...}
2856
2857 // Message is an optional display message
2858 message?: string
2859
2860 // Operator is the conditional operation to perform. Valid operators are:
2861 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
2862 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
2863 // DurationLessThanOrEquals, DurationLessThan
2864 operator?: "Equals" |
2865 "NotEquals" |
2866 "In" |
2867 "AnyIn" |
2868 "AllIn" |
2869 "NotIn" |
2870 "AnyNotIn" |
2871 "AllNotIn" |
2872 "GreaterThanOrEquals" |
2873 "GreaterThan" |
2874 "LessThanOrEquals" |
2875 "LessThan" |
2876 "DurationGreaterThanOrEquals" |
2877 "DurationGreaterThan" |
2878 "DurationLessThanOrEquals" |
2879 "DurationLessThan"
2880
2881 // Value is the conditional value, or set of values. The values can be fixed set
2882 // or can be variables declared using JMESPath.
2883 value?: null | bool | number | string | [...] | {...}
2884 }]
2885
2886 // AnyConditions enable variable-based conditional rule execution. This is useful for
2887 // finer control of when an rule is applied. A condition can reference object data
2888 // using JMESPath notation.
2889 // Here, at least one of the conditions need to pass
2890 any?: [...{
2891 // Key is the context entry (using JMESPath) for conditional rule evaluation.
2892 key?: null | bool | number | string | [...] | {...}
2893
2894 // Message is an optional display message
2895 message?: string
2896
2897 // Operator is the conditional operation to perform. Valid operators are:
2898 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
2899 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
2900 // DurationLessThanOrEquals, DurationLessThan
2901 operator?: "Equals" |
2902 "NotEquals" |
2903 "In" |
2904 "AnyIn" |
2905 "AllIn" |
2906 "NotIn" |
2907 "AnyNotIn" |
2908 "AllNotIn" |
2909 "GreaterThanOrEquals" |
2910 "GreaterThan" |
2911 "LessThanOrEquals" |
2912 "LessThan" |
2913 "DurationGreaterThanOrEquals" |
2914 "DurationGreaterThan" |
2915 "DurationLessThanOrEquals" |
2916 "DurationLessThan"
2917
2918 // Value is the conditional value, or set of values. The values can be fixed set
2919 // or can be variables declared using JMESPath.
2920 value?: null | bool | number | string | [...] | {...}
2921 }]
2922 }]
2923
2924 // Name is the variable name.
2925 name?: string
2926
2927 // Deprecated in favour of 'Type', to be removed soon
2928 predicateType?: string
2929
2930 // Type defines the type of attestation contained within the Statement.
2931 type?: string
2932 }]
2933
2934 // Attestors specified the required attestors (i.e. authorities)
2935 attestors?: [...{
2936 // Count specifies the required number of entries that must match. If the count
2937 // is null, all entries must match
2938 // (a logical AND). If the count is 1, at least one entry must match (a logical
2939 // OR). If the count contains a
2940 // value N, then N must be less than or equal to the size of entries, and at
2941 // least N entries must match.
2942 count?: int & >=1
2943
2944 // Entries contains the available attestors. An attestor can be a static key,
2945 // attributes for keyless verification, or a nested attestor declaration.
2946 entries?: [...{
2947 // Annotations are used for image verification.
2948 // Every specified key-value pair must exist and match in the verified payload.
2949 // The payload may contain other key-value pairs.
2950 annotations?: [string]: string
2951
2952 // Attestor is a nested set of Attestor used to specify a more complex set of match authorities.
2953 attestor?: null | bool | number | string | [...] | {...}
2954
2955 // Certificates specifies one or more certificates.
2956 certificates?: {
2957 // Cert is an optional PEM-encoded public certificate.
2958 cert?: string
2959
2960 // CertChain is an optional PEM encoded set of certificates used to verify.
2961 certChain?: string
2962
2963 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
2964 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
2965 ctlog?: {
2966 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
2967 // to check for a certificate
2968 // timestamp. Default is false. Set to true if this was opted out during signing.
2969 ignoreSCT?: bool
2970
2971 // PubKey, if set, is used to validate SCTs against a custom source.
2972 pubkey?: string
2973
2974 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
2975 // RFC3161 timestamp authority. Must
2976 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
2977 // may contain the leaf TSA certificate if not present in the timestamurce.
2978 tsaCertChain?: string
2979 }
2980
2981 // Rekor provides configuration for the Rekor transparency log service. If an empty object
2982 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
2983 rekor?: {
2984 // IgnoreTlog skips transparency log verification.
2985 ignoreTlog?: bool
2986
2987 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
2988 // If set, this will be used to validate transparency log signatures from a custom Rekor.
2989 pubkey?: string
2990
2991 // URL is the address of the transparency log. Defaults to the public Rekor log
2992 // instance https://rekor.sigstore.dev.
2993 url?: string
2994 }
2995 }
2996
2997 // Keyless is a set of attribute used to verify a Sigstore keyless attestor.
2998 // See https://github.com/sigstore/cosign/blob/main/KEYLESS.md.
2999 keyless?: {
3000 // AdditionalExtensions are certificate-extensions used for keyless signing.
3001 additionalExtensions?: [string]: string
3002
3003 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
3004 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
3005 ctlog?: {
3006 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
3007 // to check for a certificate
3008 // timestamp. Default is false. Set to true if this was opted out during signing.
3009 ignoreSCT?: bool
3010
3011 // PubKey, if set, is used to validate SCTs against a custom source.
3012 pubkey?: string
3013
3014 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
3015 // RFC3161 timestamp authority. Must
3016 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
3017 // may contain the leaf TSA certificate if not present in the timestamurce.
3018 tsaCertChain?: string
3019 }
3020
3021 // Issuer is the certificate issuer used for keyless signing.
3022 issuer?: string
3023
3024 // IssuerRegExp is the regular expression to match certificate issuer used for keyless signing.
3025 issuerRegExp?: string
3026
3027 // Rekor provides configuration for the Rekor transparency log service. If an empty object
3028 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
3029 rekor?: {
3030 // IgnoreTlog skips transparency log verification.
3031 ignoreTlog?: bool
3032
3033 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
3034 // If set, this will be used to validate transparency log signatures from a custom Rekor.
3035 pubkey?: string
3036
3037 // URL is the address of the transparency log. Defaults to the public Rekor log
3038 // instance https://rekor.sigstore.dev.
3039 url?: string
3040 }
3041
3042 // Roots is an optional set of PEM encoded trusted root certificates.
3043 // If not provided, the system roots are used.
3044 roots?: string
3045
3046 // Subject is the verified identity used for keyless signing, for example the email address.
3047 subject?: string
3048
3049 // SubjectRegExp is the regular expression to match identity used for keyless
3050 // signing, for example the email address.
3051 subjectRegExp?: string
3052 }
3053
3054 // Keys specifies one or more public keys.
3055 keys?: {
3056 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
3057 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
3058 ctlog?: {
3059 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
3060 // to check for a certificate
3061 // timestamp. Default is false. Set to true if this was opted out during signing.
3062 ignoreSCT?: bool
3063
3064 // PubKey, if set, is used to validate SCTs against a custom source.
3065 pubkey?: string
3066
3067 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
3068 // RFC3161 timestamp authority. Must
3069 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
3070 // may contain the leaf TSA certificate if not present in the timestamurce.
3071 tsaCertChain?: string
3072 }
3073
3074 // KMS provides the URI to the public key stored in a Key Management System. See:
3075 // https://github.com/sigstore/cosign/blob/main/KMS.md
3076 kms?: string
3077
3078 // Keys is a set of X.509 public keys used to verify image signatures. The keys can be directly
3079 // specified or can be a variable reference to a key specified in a ConfigMap (see
3080 // https://kyverno.io/docs/writing-policies/variables/), or reference a standard Kubernetes Secret
3081 // elsewhere in the cluster by specifying it in the format "k8s://<namespace>/<secret_name>".
3082 // The named Secret must specify a key `cosign.pub` containing the public key used for
3083 // verification, (see https://github.com/sigstore/cosign/blob/main/KMS.md#kubernetes-secret).
3084 // When multiple keys are specified each key is processed as a separate staticKey entry
3085 // (.attestors[*].entries.keys) within the set of attestors and the count is
3086 // applied across the keys.
3087 publicKeys?: string
3088
3089 // Rekor provides configuration for the Rekor transparency log service. If an empty object
3090 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
3091 rekor?: {
3092 // IgnoreTlog skips transparency log verification.
3093 ignoreTlog?: bool
3094
3095 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
3096 // If set, this will be used to validate transparency log signatures from a custom Rekor.
3097 pubkey?: string
3098
3099 // URL is the address of the transparency log. Defaults to the public Rekor log
3100 // instance https://rekor.sigstore.dev.
3101 url?: string
3102 }
3103
3104 // Reference to a Secret resource that contains a public key
3105 secret?: {
3106 // Name of the secret. The provided secret must contain a key named cosign.pub.
3107 name!: string
3108
3109 // Namespace name where the Secret exists.
3110 namespace!: string
3111 }
3112
3113 // Deprecated. Use attestor.signatureAlgorithm instead.
3114 signatureAlgorithm?: string
3115 }
3116
3117 // Repository is an optional alternate OCI repository to use for signatures and
3118 // attestations that match this rule.
3119 // If specified Repository will override other OCI image repository locations for this Attestor.
3120 repository?: string
3121
3122 // Specify signature algorithm for public keys. Supported values are sha224,
3123 // sha256, sha384 and sha512.
3124 signatureAlgorithm?: string
3125 }]
3126 }]
3127
3128 // CosignOCI11 enables the experimental OCI 1.1 behaviour in cosign image verification.
3129 // Defaults to false.
3130 cosignOCI11?: bool
3131
3132 // Allowed values are Audit or Enforce.
3133 failureAction?: "Audit" | "Enforce"
3134
3135 // Deprecated. Use ImageReferences instead.
3136 image?: string
3137
3138 // ImageReferences is a list of matching image reference patterns. At least one pattern in the
3139 // list must match the image for the rule to apply. Each image reference consists of a registry
3140 // address (defaults to docker.io), repository, image, and tag (defaults to latest).
3141 // Wildcards ('*' and '?') are allowed. See: https://kubernetes.io/docs/concepts/containers/images.
3142 imageReferences?: [...string]
3143
3144 // ImageRegistryCredentials provides credentials that will be used for authentication with registry.
3145 imageRegistryCredentials?: {
3146 // AllowInsecureRegistry allows insecure access to a registry.
3147 allowInsecureRegistry?: bool
3148
3149 // Providers specifies a list of OCI Registry names, whose authentication providers are provided.
3150 // It can be of one of these values: default,google,azure,amazon,github.
3151 providers?: [..."default" | "amazon" | "azure" | "google" | "github"]
3152
3153 // Secrets specifies a list of secrets that are provided for credentials.
3154 // Secrets can be specified as a name (Kyverno namespace) or namespace/name.
3155 // imagePullSecrets from the resource namespace are also used.
3156 secrets?: [...string]
3157 }
3158
3159 // Deprecated. Use KeylessAttestor instead.
3160 issuer?: string
3161
3162 // Deprecated. Use StaticKeyAttestor instead.
3163 key?: string
3164
3165 // MutateDigest enables replacement of image tags with digests.
3166 // Defaults to true.
3167 mutateDigest?: bool
3168
3169 // Repository is an optional alternate OCI repository to use for image
3170 // signatures and attestations that match this rule.
3171 // If specified Repository will override the default OCI image repository
3172 // configured for the installation.
3173 // The repository can also be overridden per Attestor or Attestation.
3174 repository?: string
3175
3176 // Required validates that images are verified i.e. have matched passed a
3177 // signature or attestation check.
3178 required?: bool
3179
3180 // Deprecated. Use KeylessAttestor instead.
3181 roots?: string
3182
3183 // SkipImageReferences is a list of matching image reference patterns that should be skipped.
3184 // At least one pattern in the list must match the image for the rule to be
3185 // skipped. Each image reference
3186 // consists of a registry address (defaults to docker.io), repository, image,
3187 // and tag (defaults to latest).
3188 // Wildcards ('*' and '?') are allowed. See: https://kubernetes.io/docs/concepts/containers/images.
3189 skipImageReferences?: [...string]
3190
3191 // Deprecated. Use KeylessAttestor instead.
3192 subject?: string
3193
3194 // Type specifies the method of signature validation. The allowed options
3195 // are Cosign, Sigstore Bundle and Notary. By default Cosign is used if a type is not specified.
3196 type?: "Cosign" | "SigstoreBundle" | "Notary"
3197
3198 // UseCache enables caching of image verify responses for this rule.
3199 useCache?: bool
3200
3201 // Validation checks conditions across multiple image
3202 // verification attestations or context entries
3203 validate?: {
3204 // Deny defines conditions used to pass or fail a validation rule.
3205 deny?: {
3206 // Multiple conditions can be declared under an `any` or `all` statement. A direct list
3207 // of conditions (without `any` or `all` statements) is also supported for backwards compatibility
3208 // but will be deprecated in the next major release.
3209 // See: https://kyverno.io/docs/writing-policies/validate/#deny-rules
3210 conditions?: null | bool | number | string | [...] | {...}
3211 }
3212
3213 // Message specifies a custom message to be displayed on failure.
3214 message?: string
3215 }
3216
3217 // VerifyDigest validates that images have a digest.
3218 verifyDigest?: bool
3219 }]
3220 }]
3221
3222 // Deprecated.
3223 schemaValidation?: bool
3224
3225 // UseServerSideApply controls whether to use server-side apply for generate rules
3226 // If is set to "true" create & update for generate rules will use apply instead of create/update.
3227 // Defaults to "false" if not specified.
3228 useServerSideApply?: bool
3229
3230 // Deprecated, use validationFailureAction under the validate rule instead.
3231 validationFailureAction?: "audit" | "enforce" | "Audit" | "Enforce"
3232
3233 // Deprecated, use validationFailureActionOverrides under the validate rule instead.
3234 validationFailureActionOverrides?: [...{
3235 // ValidationFailureAction defines the policy validation failure action
3236 action?: "audit" | "enforce" | "Audit" | "Enforce"
3237
3238 // A label selector is a label query over a set of resources. The result of matchLabels and
3239 // matchExpressions are ANDed. An empty label selector matches all objects. A null
3240 // label selector matches no objects.
3241 namespaceSelector?: {
3242 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
3243 matchExpressions?: [...{
3244 // key is the label key that the selector applies to.
3245 key!: string
3246
3247 // operator represents a key's relationship to a set of values.
3248 // Valid operators are In, NotIn, Exists and DoesNotExist.
3249 operator!: string
3250
3251 // values is an array of string values. If the operator is In or NotIn,
3252 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
3253 // the values array must be empty. This array is replaced during a strategic
3254 // merge patch.
3255 values?: [...string]
3256 }]
3257
3258 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
3259 // map is equivalent to an element of matchExpressions, whose key field is "key", the
3260 // operator is "In", and the values array contains only "value". The requirements are ANDed.
3261 matchLabels?: [string]: string
3262 }
3263 namespaces?: [...string]
3264 }]
3265
3266 // WebhookConfiguration specifies the custom configuration for Kubernetes
3267 // admission webhookconfiguration.
3268 webhookConfiguration?: {
3269 // FailurePolicy defines how unexpected policy errors and webhook response
3270 // timeout errors are handled.
3271 // Rules within the same policy share the same failure behavior.
3272 // This field should not be accessed directly, instead `GetFailurePolicy()` should be used.
3273 // Allowed values are Ignore or Fail. Defaults to Fail.
3274 failurePolicy?: "Ignore" | "Fail"
3275
3276 // MatchCondition configures admission webhook matchConditions.
3277 // Requires Kubernetes 1.27 or later.
3278 matchConditions?: [...{
3279 // Expression represents the expression which will be evaluated by CEL. Must evaluate to bool.
3280 // CEL expressions have access to the contents of the AdmissionRequest and
3281 // Authorizer, organized into CEL variables:
3282 //
3283 // 'object' - The object from the incoming request. The value is null for DELETE requests.
3284 // 'oldObject' - The existing object. The value is null for CREATE requests.
3285 // 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest).
3286 // 'authorizer' - A CEL Authorizer. May be used to perform authorization checks
3287 // for the principal (user or service account) of the request.
3288 // See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
3289 // 'authorizer.requestResource' - A CEL ResourceCheck constructed from the
3290 // 'authorizer' and configured with the
3291 // request resource.
3292 // Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
3293 //
3294 // Required.
3295 expression!: string
3296
3297 // Name is an identifier for this match condition, used for strategic merging of MatchConditions,
3298 // as well as providing an identifier for logging purposes. A good name should be descriptive of
3299 // the associated expression.
3300 // Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and
3301 // must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or
3302 // '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an
3303 // optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
3304 //
3305 // Required.
3306 name!: string
3307 }]
3308
3309 // TimeoutSeconds specifies the maximum time in seconds allowed to apply this policy.
3310 // After the configured time expires, the admission request may fail, or may
3311 // simply ignore the policy results,
3312 // based on the failure policy. The default timeout is 10s, the value must be
3313 // between 1 and 30 seconds.
3314 timeoutSeconds?: int32 & int
3315 }
3316
3317 // Deprecated, use webhookTimeoutSeconds under webhookConfiguration instead.
3318 webhookTimeoutSeconds?: int32 & int
3319 }
3320
3321 // Deprecated. Policy metrics are available via the metrics endpoint
3322 status?: {
3323 // AutogenStatus contains autogen status information.
3324 autogen?: {
3325 // Rules is a list of Rule instances. It contains auto generated rules added for pod controllers
3326 rules?: [...{
3327 // CELPreconditions are used to determine if a policy rule should be applied by evaluating a
3328 // set of CEL conditions. It can only be used with the validate.cel subrule
3329 celPreconditions?: [...{
3330 // Expression represents the expression which will be evaluated by CEL. Must evaluate to bool.
3331 // CEL expressions have access to the contents of the AdmissionRequest and
3332 // Authorizer, organized into CEL variables:
3333 //
3334 // 'object' - The object from the incoming request. The value is null for DELETE requests.
3335 // 'oldObject' - The existing object. The value is null for CREATE requests.
3336 // 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest).
3337 // 'authorizer' - A CEL Authorizer. May be used to perform authorization checks
3338 // for the principal (user or service account) of the request.
3339 // See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
3340 // 'authorizer.requestResource' - A CEL ResourceCheck constructed from the
3341 // 'authorizer' and configured with the
3342 // request resource.
3343 // Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
3344 //
3345 // Required.
3346 expression!: string
3347
3348 // Name is an identifier for this match condition, used for strategic merging of MatchConditions,
3349 // as well as providing an identifier for logging purposes. A good name should be descriptive of
3350 // the associated expression.
3351 // Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and
3352 // must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or
3353 // '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an
3354 // optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
3355 //
3356 // Required.
3357 name!: string
3358 }]
3359
3360 // Context defines variables and data sources that can be used during rule execution.
3361 context?: [...matchN(1, [
3362 {configMap!: _}, {apiCall!: _}, {imageRegistry!: _}, {variable!: _}, {globalReference!: _},
3363 ]) & {
3364 // APICall is an HTTP request to the Kubernetes API server, or other JSON web service.
3365 // The data returned is stored in the context with the name for the context entry.
3366 apiCall?: {
3367 // The data object specifies the POST data sent to the server.
3368 // Only applicable when the method field is set to POST.
3369 data?: [...{
3370 // Key is a unique identifier for the data value
3371 key!: string
3372
3373 // Value is the data value
3374 value!: null | bool | number | string | [...] | {...}
3375 }]
3376
3377 // Default is an optional arbitrary JSON object that the context
3378 // value is set to, if the apiCall returns error.
3379 default?: null | bool | number | string | [...] | {...}
3380
3381 // JMESPath is an optional JSON Match Expression that can be used to
3382 // transform the JSON response returned from the server. For example
3383 // a JMESPath of "items | length(@)" applied to the API server response
3384 // for the URLPath "/apis/apps/v1/deployments" will return the total count
3385 // of deployments across all namespaces.
3386 jmesPath?: string
3387
3388 // Method is the HTTP request type (GET or POST). Defaults to GET.
3389 method?: "GET" | "POST"
3390
3391 // Service is an API call to a JSON web service.
3392 // This is used for non-Kubernetes API server calls.
3393 // It's mutually exclusive with the URLPath field.
3394 service?: {
3395 // CABundle is a PEM encoded CA bundle which will be used to validate
3396 // the server certificate.
3397 caBundle?: string
3398
3399 // Headers is a list of optional HTTP headers to be included in the request.
3400 headers?: [...{
3401 // Key is the header key
3402 key!: string
3403
3404 // Value is the header value
3405 value!: string
3406 }]
3407
3408 // URL is the JSON web service URL. A typical form is
3409 // `https://{service}.{namespace}:{port}/{path}`.
3410 url!: string
3411 }
3412
3413 // URLPath is the URL path to be used in the HTTP GET or POST request to the
3414 // Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
3415 // The format required is the same format used by the `kubectl get --raw` command.
3416 // See
3417 // https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls
3418 // for details.
3419 // It's mutually exclusive with the Service field.
3420 urlPath?: string
3421 }
3422
3423 // ConfigMap is the ConfigMap reference.
3424 configMap?: {
3425 // Name is the ConfigMap name.
3426 name!: string
3427
3428 // Namespace is the ConfigMap namespace.
3429 namespace?: string
3430 }
3431
3432 // GlobalContextEntryReference is a reference to a cached global context entry.
3433 globalReference?: {
3434 // JMESPath is an optional JSON Match Expression that can be used to
3435 // transform the JSON response returned from the server. For example
3436 // a JMESPath of "items | length(@)" applied to the API server response
3437 // for the URLPath "/apis/apps/v1/deployments" will return the total count
3438 // of deployments across all namespaces.
3439 jmesPath?: string
3440
3441 // Name of the global context entry
3442 name!: string
3443 }
3444
3445 // ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image
3446 // details.
3447 imageRegistry?: {
3448 // ImageRegistryCredentials provides credentials that will be used for authentication with registry
3449 imageRegistryCredentials?: {
3450 // AllowInsecureRegistry allows insecure access to a registry.
3451 allowInsecureRegistry?: bool
3452
3453 // Providers specifies a list of OCI Registry names, whose authentication providers are provided.
3454 // It can be of one of these values: default,google,azure,amazon,github.
3455 providers?: [..."default" | "amazon" | "azure" | "google" | "github"]
3456
3457 // Secrets specifies a list of secrets that are provided for credentials.
3458 // Secrets can be specified as a name (Kyverno namespace) or namespace/name.
3459 // imagePullSecrets from the resource namespace are also used.
3460 secrets?: [...string]
3461 }
3462
3463 // JMESPath is an optional JSON Match Expression that can be used to
3464 // transform the ImageData struct returned as a result of processing
3465 // the image reference.
3466 jmesPath?: string
3467
3468 // Reference is image reference to a container image in the registry.
3469 // Example: ghcr.io/kyverno/kyverno:latest
3470 reference!: string
3471 }
3472
3473 // Name is the variable name.
3474 name!: string
3475
3476 // Variable defines an arbitrary JMESPath context variable that can be defined inline.
3477 variable?: {
3478 // Default is an optional arbitrary JSON object that the variable may take if the JMESPath
3479 // expression evaluates to nil
3480 default?: null | bool | number | string | [...] | {...}
3481
3482 // JMESPath is an optional JMESPath Expression that can be used to
3483 // transform the variable.
3484 jmesPath?: string
3485
3486 // Value is any arbitrary JSON object representable in YAML or JSON form.
3487 value?: null | bool | number | string | [...] | {...}
3488 }
3489 }]
3490
3491 // ExcludeResources defines when this policy rule should not be applied. The exclude
3492 // criteria can include resource information (e.g. kind, name, namespace, labels)
3493 // and admission review request information like the name or role.
3494 exclude?: matchN(0, [null | bool | number | string | [...] | {
3495 any!: _
3496 all!: _
3497 }]) & {
3498 // All allows specifying resources which will be ANDed
3499 all?: [...{
3500 // ClusterRoles is the list of cluster-wide role names for the user.
3501 clusterRoles?: [...string]
3502
3503 // ResourceDescription contains information about the resource being created or modified.
3504 resources?: matchN(0, [null | bool | number | string | [...] | {
3505 name!: _
3506 names!: _
3507 }]) & {
3508 // Annotations is a map of annotations (key-value pairs of type string). Annotation keys
3509 // and values support the wildcard characters "*" (matches zero or many characters) and
3510 // "?" (matches at least one character).
3511 annotations?: [string]: string
3512
3513 // Kinds is a list of resource kinds.
3514 kinds?: [...string]
3515
3516 // Name is the name of the resource. The name supports wildcard characters
3517 // "*" (matches zero or many characters) and "?" (at least one character).
3518 // NOTE: "Name" is being deprecated in favor of "Names".
3519 name?: string
3520
3521 // Names are the names of the resources. Each name supports wildcard characters
3522 // "*" (matches zero or many characters) and "?" (at least one character).
3523 names?: [...string]
3524
3525 // NamespaceSelector is a label selector for the resource namespace. Label keys and values
3526 // in `matchLabels` support the wildcard characters `*` (matches zero or many characters)
3527 // and `?` (matches one character).Wildcards allows writing label selectors like
3528 // ["storage.k8s.io/*": "*"]. Note that using ["*" : "*"] matches any key and value but
3529 // does not match an empty label set.
3530 namespaceSelector?: {
3531 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
3532 matchExpressions?: [...{
3533 // key is the label key that the selector applies to.
3534 key!: string
3535
3536 // operator represents a key's relationship to a set of values.
3537 // Valid operators are In, NotIn, Exists and DoesNotExist.
3538 operator!: string
3539
3540 // values is an array of string values. If the operator is In or NotIn,
3541 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
3542 // the values array must be empty. This array is replaced during a strategic
3543 // merge patch.
3544 values?: [...string]
3545 }]
3546
3547 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
3548 // map is equivalent to an element of matchExpressions, whose key field is "key", the
3549 // operator is "In", and the values array contains only "value". The requirements are ANDed.
3550 matchLabels?: [string]: string
3551 }
3552
3553 // Namespaces is a list of namespaces names. Each name supports wildcard characters
3554 // "*" (matches zero or many characters) and "?" (at least one character).
3555 namespaces?: [...string]
3556
3557 // Operations can contain values ["CREATE, "UPDATE", "CONNECT", "DELETE"], which
3558 // are used to match a specific action.
3559 operations?: [..."CREATE" | "CONNECT" | "UPDATE" | "DELETE"]
3560
3561 // Selector is a label selector. Label keys and values in `matchLabels` support the wildcard
3562 // characters `*` (matches zero or many characters) and `?` (matches one character).
3563 // Wildcards allows writing label selectors like ["storage.k8s.io/*": "*"]. Note that
3564 // using ["*" : "*"] matches any key and value but does not match an empty label set.
3565 selector?: {
3566 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
3567 matchExpressions?: [...{
3568 // key is the label key that the selector applies to.
3569 key!: string
3570
3571 // operator represents a key's relationship to a set of values.
3572 // Valid operators are In, NotIn, Exists and DoesNotExist.
3573 operator!: string
3574
3575 // values is an array of string values. If the operator is In or NotIn,
3576 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
3577 // the values array must be empty. This array is replaced during a strategic
3578 // merge patch.
3579 values?: [...string]
3580 }]
3581
3582 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
3583 // map is equivalent to an element of matchExpressions, whose key field is "key", the
3584 // operator is "In", and the values array contains only "value". The requirements are ANDed.
3585 matchLabels?: [string]: string
3586 }
3587 }
3588
3589 // Roles is the list of namespaced role names for the user.
3590 roles?: [...string]
3591
3592 // Subjects is the list of subject names like users, user groups, and service accounts.
3593 subjects?: [...{
3594 // APIGroup holds the API group of the referenced subject.
3595 // Defaults to "" for ServiceAccount subjects.
3596 // Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
3597 apiGroup?: string
3598
3599 // Kind of object being referenced. Values defined by this API group are "User",
3600 // "Group", and "ServiceAccount".
3601 // If the Authorizer does not recognized the kind value, the Authorizer should report an error.
3602 kind!: string
3603
3604 // Name of the object being referenced.
3605 name!: string
3606
3607 // Namespace of the referenced object. If the object kind is non-namespace, such
3608 // as "User" or "Group", and this value is not empty
3609 // the Authorizer should report an error.
3610 namespace?: string
3611 }]
3612 }]
3613
3614 // Any allows specifying resources which will be ORed
3615 any?: [...{
3616 // ClusterRoles is the list of cluster-wide role names for the user.
3617 clusterRoles?: [...string]
3618
3619 // ResourceDescription contains information about the resource being created or modified.
3620 resources?: matchN(0, [null | bool | number | string | [...] | {
3621 name!: _
3622 names!: _
3623 }]) & {
3624 // Annotations is a map of annotations (key-value pairs of type string). Annotation keys
3625 // and values support the wildcard characters "*" (matches zero or many characters) and
3626 // "?" (matches at least one character).
3627 annotations?: [string]: string
3628
3629 // Kinds is a list of resource kinds.
3630 kinds?: [...string]
3631
3632 // Name is the name of the resource. The name supports wildcard characters
3633 // "*" (matches zero or many characters) and "?" (at least one character).
3634 // NOTE: "Name" is being deprecated in favor of "Names".
3635 name?: string
3636
3637 // Names are the names of the resources. Each name supports wildcard characters
3638 // "*" (matches zero or many characters) and "?" (at least one character).
3639 names?: [...string]
3640
3641 // NamespaceSelector is a label selector for the resource namespace. Label keys and values
3642 // in `matchLabels` support the wildcard characters `*` (matches zero or many characters)
3643 // and `?` (matches one character).Wildcards allows writing label selectors like
3644 // ["storage.k8s.io/*": "*"]. Note that using ["*" : "*"] matches any key and value but
3645 // does not match an empty label set.
3646 namespaceSelector?: {
3647 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
3648 matchExpressions?: [...{
3649 // key is the label key that the selector applies to.
3650 key!: string
3651
3652 // operator represents a key's relationship to a set of values.
3653 // Valid operators are In, NotIn, Exists and DoesNotExist.
3654 operator!: string
3655
3656 // values is an array of string values. If the operator is In or NotIn,
3657 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
3658 // the values array must be empty. This array is replaced during a strategic
3659 // merge patch.
3660 values?: [...string]
3661 }]
3662
3663 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
3664 // map is equivalent to an element of matchExpressions, whose key field is "key", the
3665 // operator is "In", and the values array contains only "value". The requirements are ANDed.
3666 matchLabels?: [string]: string
3667 }
3668
3669 // Namespaces is a list of namespaces names. Each name supports wildcard characters
3670 // "*" (matches zero or many characters) and "?" (at least one character).
3671 namespaces?: [...string]
3672
3673 // Operations can contain values ["CREATE, "UPDATE", "CONNECT", "DELETE"], which
3674 // are used to match a specific action.
3675 operations?: [..."CREATE" | "CONNECT" | "UPDATE" | "DELETE"]
3676
3677 // Selector is a label selector. Label keys and values in `matchLabels` support the wildcard
3678 // characters `*` (matches zero or many characters) and `?` (matches one character).
3679 // Wildcards allows writing label selectors like ["storage.k8s.io/*": "*"]. Note that
3680 // using ["*" : "*"] matches any key and value but does not match an empty label set.
3681 selector?: {
3682 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
3683 matchExpressions?: [...{
3684 // key is the label key that the selector applies to.
3685 key!: string
3686
3687 // operator represents a key's relationship to a set of values.
3688 // Valid operators are In, NotIn, Exists and DoesNotExist.
3689 operator!: string
3690
3691 // values is an array of string values. If the operator is In or NotIn,
3692 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
3693 // the values array must be empty. This array is replaced during a strategic
3694 // merge patch.
3695 values?: [...string]
3696 }]
3697
3698 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
3699 // map is equivalent to an element of matchExpressions, whose key field is "key", the
3700 // operator is "In", and the values array contains only "value". The requirements are ANDed.
3701 matchLabels?: [string]: string
3702 }
3703 }
3704
3705 // Roles is the list of namespaced role names for the user.
3706 roles?: [...string]
3707
3708 // Subjects is the list of subject names like users, user groups, and service accounts.
3709 subjects?: [...{
3710 // APIGroup holds the API group of the referenced subject.
3711 // Defaults to "" for ServiceAccount subjects.
3712 // Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
3713 apiGroup?: string
3714
3715 // Kind of object being referenced. Values defined by this API group are "User",
3716 // "Group", and "ServiceAccount".
3717 // If the Authorizer does not recognized the kind value, the Authorizer should report an error.
3718 kind!: string
3719
3720 // Name of the object being referenced.
3721 name!: string
3722
3723 // Namespace of the referenced object. If the object kind is non-namespace, such
3724 // as "User" or "Group", and this value is not empty
3725 // the Authorizer should report an error.
3726 namespace?: string
3727 }]
3728 }]
3729
3730 // ClusterRoles is the list of cluster-wide role names for the user.
3731 clusterRoles?: [...string]
3732
3733 // ResourceDescription contains information about the resource being created or modified.
3734 // Requires at least one tag to be specified when under MatchResources.
3735 // Specifying ResourceDescription directly under match is being deprecated.
3736 // Please specify under "any" or "all" instead.
3737 resources?: matchN(0, [null | bool | number | string | [...] | {
3738 name!: _
3739 names!: _
3740 }]) & {
3741 // Annotations is a map of annotations (key-value pairs of type string). Annotation keys
3742 // and values support the wildcard characters "*" (matches zero or many characters) and
3743 // "?" (matches at least one character).
3744 annotations?: [string]: string
3745
3746 // Kinds is a list of resource kinds.
3747 kinds?: [...string]
3748
3749 // Name is the name of the resource. The name supports wildcard characters
3750 // "*" (matches zero or many characters) and "?" (at least one character).
3751 // NOTE: "Name" is being deprecated in favor of "Names".
3752 name?: string
3753
3754 // Names are the names of the resources. Each name supports wildcard characters
3755 // "*" (matches zero or many characters) and "?" (at least one character).
3756 names?: [...string]
3757
3758 // NamespaceSelector is a label selector for the resource namespace. Label keys and values
3759 // in `matchLabels` support the wildcard characters `*` (matches zero or many characters)
3760 // and `?` (matches one character).Wildcards allows writing label selectors like
3761 // ["storage.k8s.io/*": "*"]. Note that using ["*" : "*"] matches any key and value but
3762 // does not match an empty label set.
3763 namespaceSelector?: {
3764 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
3765 matchExpressions?: [...{
3766 // key is the label key that the selector applies to.
3767 key!: string
3768
3769 // operator represents a key's relationship to a set of values.
3770 // Valid operators are In, NotIn, Exists and DoesNotExist.
3771 operator!: string
3772
3773 // values is an array of string values. If the operator is In or NotIn,
3774 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
3775 // the values array must be empty. This array is replaced during a strategic
3776 // merge patch.
3777 values?: [...string]
3778 }]
3779
3780 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
3781 // map is equivalent to an element of matchExpressions, whose key field is "key", the
3782 // operator is "In", and the values array contains only "value". The requirements are ANDed.
3783 matchLabels?: [string]: string
3784 }
3785
3786 // Namespaces is a list of namespaces names. Each name supports wildcard characters
3787 // "*" (matches zero or many characters) and "?" (at least one character).
3788 namespaces?: [...string]
3789
3790 // Operations can contain values ["CREATE, "UPDATE", "CONNECT", "DELETE"], which
3791 // are used to match a specific action.
3792 operations?: [..."CREATE" | "CONNECT" | "UPDATE" | "DELETE"]
3793
3794 // Selector is a label selector. Label keys and values in `matchLabels` support the wildcard
3795 // characters `*` (matches zero or many characters) and `?` (matches one character).
3796 // Wildcards allows writing label selectors like ["storage.k8s.io/*": "*"]. Note that
3797 // using ["*" : "*"] matches any key and value but does not match an empty label set.
3798 selector?: {
3799 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
3800 matchExpressions?: [...{
3801 // key is the label key that the selector applies to.
3802 key!: string
3803
3804 // operator represents a key's relationship to a set of values.
3805 // Valid operators are In, NotIn, Exists and DoesNotExist.
3806 operator!: string
3807
3808 // values is an array of string values. If the operator is In or NotIn,
3809 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
3810 // the values array must be empty. This array is replaced during a strategic
3811 // merge patch.
3812 values?: [...string]
3813 }]
3814
3815 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
3816 // map is equivalent to an element of matchExpressions, whose key field is "key", the
3817 // operator is "In", and the values array contains only "value". The requirements are ANDed.
3818 matchLabels?: [string]: string
3819 }
3820 }
3821
3822 // Roles is the list of namespaced role names for the user.
3823 roles?: [...string]
3824
3825 // Subjects is the list of subject names like users, user groups, and service accounts.
3826 subjects?: [...{
3827 // APIGroup holds the API group of the referenced subject.
3828 // Defaults to "" for ServiceAccount subjects.
3829 // Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
3830 apiGroup?: string
3831
3832 // Kind of object being referenced. Values defined by this API group are "User",
3833 // "Group", and "ServiceAccount".
3834 // If the Authorizer does not recognized the kind value, the Authorizer should report an error.
3835 kind!: string
3836
3837 // Name of the object being referenced.
3838 name!: string
3839
3840 // Namespace of the referenced object. If the object kind is non-namespace, such
3841 // as "User" or "Group", and this value is not empty
3842 // the Authorizer should report an error.
3843 namespace?: string
3844 }]
3845 }
3846
3847 // Generation is used to create new resources.
3848 generate?: {
3849 // APIVersion specifies resource apiVersion.
3850 apiVersion?: string
3851
3852 // Clone specifies the source resource used to populate each generated resource.
3853 // At most one of Data or Clone can be specified. If neither are provided, the generated
3854 // resource will be created with default data only.
3855 clone?: {
3856 // Name specifies name of the resource.
3857 name?: string
3858
3859 // Namespace specifies source resource namespace.
3860 namespace?: string
3861 }
3862
3863 // CloneList specifies the list of source resource used to populate each generated resource.
3864 cloneList?: {
3865 // Kinds is a list of resource kinds.
3866 kinds?: [...string]
3867
3868 // Namespace specifies source resource namespace.
3869 namespace?: string
3870
3871 // Selector is a label selector. Label keys and values in `matchLabels`.
3872 // wildcard characters are not supported.
3873 selector?: {
3874 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
3875 matchExpressions?: [...{
3876 // key is the label key that the selector applies to.
3877 key!: string
3878
3879 // operator represents a key's relationship to a set of values.
3880 // Valid operators are In, NotIn, Exists and DoesNotExist.
3881 operator!: string
3882
3883 // values is an array of string values. If the operator is In or NotIn,
3884 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
3885 // the values array must be empty. This array is replaced during a strategic
3886 // merge patch.
3887 values?: [...string]
3888 }]
3889
3890 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
3891 // map is equivalent to an element of matchExpressions, whose key field is "key", the
3892 // operator is "In", and the values array contains only "value". The requirements are ANDed.
3893 matchLabels?: [string]: string
3894 }
3895 }
3896
3897 // Data provides the resource declaration used to populate each generated resource.
3898 // At most one of Data or Clone must be specified. If neither are provided, the generated
3899 // resource will be created with default data only.
3900 data?: null | bool | number | string | [...] | {...}
3901
3902 // ForEach applies generate rules to a list of sub-elements by creating a
3903 // context for each entry in the list and looping over it to apply the
3904 // specified logic.
3905 foreach?: [...{
3906 // APIVersion specifies resource apiVersion.
3907 apiVersion?: string
3908
3909 // Clone specifies the source resource used to populate each generated resource.
3910 // At most one of Data or Clone can be specified. If neither are provided, the generated
3911 // resource will be created with default data only.
3912 clone?: {
3913 // Name specifies name of the resource.
3914 name?: string
3915
3916 // Namespace specifies source resource namespace.
3917 namespace?: string
3918 }
3919
3920 // CloneList specifies the list of source resource used to populate each generated resource.
3921 cloneList?: {
3922 // Kinds is a list of resource kinds.
3923 kinds?: [...string]
3924
3925 // Namespace specifies source resource namespace.
3926 namespace?: string
3927
3928 // Selector is a label selector. Label keys and values in `matchLabels`.
3929 // wildcard characters are not supported.
3930 selector?: {
3931 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
3932 matchExpressions?: [...{
3933 // key is the label key that the selector applies to.
3934 key!: string
3935
3936 // operator represents a key's relationship to a set of values.
3937 // Valid operators are In, NotIn, Exists and DoesNotExist.
3938 operator!: string
3939
3940 // values is an array of string values. If the operator is In or NotIn,
3941 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
3942 // the values array must be empty. This array is replaced during a strategic
3943 // merge patch.
3944 values?: [...string]
3945 }]
3946
3947 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
3948 // map is equivalent to an element of matchExpressions, whose key field is "key", the
3949 // operator is "In", and the values array contains only "value". The requirements are ANDed.
3950 matchLabels?: [string]: string
3951 }
3952 }
3953
3954 // Context defines variables and data sources that can be used during rule execution.
3955 context?: [...matchN(1, [
3956 {configMap!: _}, {apiCall!: _}, {imageRegistry!: _}, {variable!: _}, {globalReference!: _},
3957 ]) & {
3958 // APICall is an HTTP request to the Kubernetes API server, or other JSON web service.
3959 // The data returned is stored in the context with the name for the context entry.
3960 apiCall?: {
3961 // The data object specifies the POST data sent to the server.
3962 // Only applicable when the method field is set to POST.
3963 data?: [...{
3964 // Key is a unique identifier for the data value
3965 key!: string
3966
3967 // Value is the data value
3968 value!: null | bool | number | string | [...] | {...}
3969 }]
3970
3971 // Default is an optional arbitrary JSON object that the context
3972 // value is set to, if the apiCall returns error.
3973 default?: null | bool | number | string | [...] | {...}
3974
3975 // JMESPath is an optional JSON Match Expression that can be used to
3976 // transform the JSON response returned from the server. For example
3977 // a JMESPath of "items | length(@)" applied to the API server response
3978 // for the URLPath "/apis/apps/v1/deployments" will return the total count
3979 // of deployments across all namespaces.
3980 jmesPath?: string
3981
3982 // Method is the HTTP request type (GET or POST). Defaults to GET.
3983 method?: "GET" | "POST"
3984
3985 // Service is an API call to a JSON web service.
3986 // This is used for non-Kubernetes API server calls.
3987 // It's mutually exclusive with the URLPath field.
3988 service?: {
3989 // CABundle is a PEM encoded CA bundle which will be used to validate
3990 // the server certificate.
3991 caBundle?: string
3992
3993 // Headers is a list of optional HTTP headers to be included in the request.
3994 headers?: [...{
3995 // Key is the header key
3996 key!: string
3997
3998 // Value is the header value
3999 value!: string
4000 }]
4001
4002 // URL is the JSON web service URL. A typical form is
4003 // `https://{service}.{namespace}:{port}/{path}`.
4004 url!: string
4005 }
4006
4007 // URLPath is the URL path to be used in the HTTP GET or POST request to the
4008 // Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
4009 // The format required is the same format used by the `kubectl get --raw` command.
4010 // See
4011 // https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls
4012 // for details.
4013 // It's mutually exclusive with the Service field.
4014 urlPath?: string
4015 }
4016
4017 // ConfigMap is the ConfigMap reference.
4018 configMap?: {
4019 // Name is the ConfigMap name.
4020 name!: string
4021
4022 // Namespace is the ConfigMap namespace.
4023 namespace?: string
4024 }
4025
4026 // GlobalContextEntryReference is a reference to a cached global context entry.
4027 globalReference?: {
4028 // JMESPath is an optional JSON Match Expression that can be used to
4029 // transform the JSON response returned from the server. For example
4030 // a JMESPath of "items | length(@)" applied to the API server response
4031 // for the URLPath "/apis/apps/v1/deployments" will return the total count
4032 // of deployments across all namespaces.
4033 jmesPath?: string
4034
4035 // Name of the global context entry
4036 name!: string
4037 }
4038
4039 // ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image
4040 // details.
4041 imageRegistry?: {
4042 // ImageRegistryCredentials provides credentials that will be used for authentication with registry
4043 imageRegistryCredentials?: {
4044 // AllowInsecureRegistry allows insecure access to a registry.
4045 allowInsecureRegistry?: bool
4046
4047 // Providers specifies a list of OCI Registry names, whose authentication providers are provided.
4048 // It can be of one of these values: default,google,azure,amazon,github.
4049 providers?: [..."default" | "amazon" | "azure" | "google" | "github"]
4050
4051 // Secrets specifies a list of secrets that are provided for credentials.
4052 // Secrets can be specified as a name (Kyverno namespace) or namespace/name.
4053 // imagePullSecrets from the resource namespace are also used.
4054 secrets?: [...string]
4055 }
4056
4057 // JMESPath is an optional JSON Match Expression that can be used to
4058 // transform the ImageData struct returned as a result of processing
4059 // the image reference.
4060 jmesPath?: string
4061
4062 // Reference is image reference to a container image in the registry.
4063 // Example: ghcr.io/kyverno/kyverno:latest
4064 reference!: string
4065 }
4066
4067 // Name is the variable name.
4068 name!: string
4069
4070 // Variable defines an arbitrary JMESPath context variable that can be defined inline.
4071 variable?: {
4072 // Default is an optional arbitrary JSON object that the variable may take if the JMESPath
4073 // expression evaluates to nil
4074 default?: null | bool | number | string | [...] | {...}
4075
4076 // JMESPath is an optional JMESPath Expression that can be used to
4077 // transform the variable.
4078 jmesPath?: string
4079
4080 // Value is any arbitrary JSON object representable in YAML or JSON form.
4081 value?: null | bool | number | string | [...] | {...}
4082 }
4083 }]
4084
4085 // Data provides the resource declaration used to populate each generated resource.
4086 // At most one of Data or Clone must be specified. If neither are provided, the generated
4087 // resource will be created with default data only.
4088 data?: null | bool | number | string | [...] | {...}
4089
4090 // Kind specifies resource kind.
4091 kind?: string
4092
4093 // List specifies a JMESPath expression that results in one or more elements
4094 // to which the validation logic is applied.
4095 list?: string
4096
4097 // Name specifies the resource name.
4098 name?: string
4099
4100 // Namespace specifies resource namespace.
4101 namespace?: string
4102
4103 // AnyAllConditions are used to determine if a policy rule should be applied by evaluating a
4104 // set of conditions. The declaration can contain nested `any` or `all` statements.
4105 // See: https://kyverno.io/docs/writing-policies/preconditions/
4106 preconditions?: {
4107 // AllConditions enable variable-based conditional rule execution. This is useful for
4108 // finer control of when an rule is applied. A condition can reference object data
4109 // using JMESPath notation.
4110 // Here, all of the conditions need to pass
4111 all?: [...{
4112 // Key is the context entry (using JMESPath) for conditional rule evaluation.
4113 key?: null | bool | number | string | [...] | {...}
4114
4115 // Message is an optional display message
4116 message?: string
4117
4118 // Operator is the conditional operation to perform. Valid operators are:
4119 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
4120 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
4121 // DurationLessThanOrEquals, DurationLessThan
4122 operator?: "Equals" |
4123 "NotEquals" |
4124 "In" |
4125 "AnyIn" |
4126 "AllIn" |
4127 "NotIn" |
4128 "AnyNotIn" |
4129 "AllNotIn" |
4130 "GreaterThanOrEquals" |
4131 "GreaterThan" |
4132 "LessThanOrEquals" |
4133 "LessThan" |
4134 "DurationGreaterThanOrEquals" |
4135 "DurationGreaterThan" |
4136 "DurationLessThanOrEquals" |
4137 "DurationLessThan"
4138
4139 // Value is the conditional value, or set of values. The values can be fixed set
4140 // or can be variables declared using JMESPath.
4141 value?: null | bool | number | string | [...] | {...}
4142 }]
4143
4144 // AnyConditions enable variable-based conditional rule execution. This is useful for
4145 // finer control of when an rule is applied. A condition can reference object data
4146 // using JMESPath notation.
4147 // Here, at least one of the conditions need to pass
4148 any?: [...{
4149 // Key is the context entry (using JMESPath) for conditional rule evaluation.
4150 key?: null | bool | number | string | [...] | {...}
4151
4152 // Message is an optional display message
4153 message?: string
4154
4155 // Operator is the conditional operation to perform. Valid operators are:
4156 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
4157 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
4158 // DurationLessThanOrEquals, DurationLessThan
4159 operator?: "Equals" |
4160 "NotEquals" |
4161 "In" |
4162 "AnyIn" |
4163 "AllIn" |
4164 "NotIn" |
4165 "AnyNotIn" |
4166 "AllNotIn" |
4167 "GreaterThanOrEquals" |
4168 "GreaterThan" |
4169 "LessThanOrEquals" |
4170 "LessThan" |
4171 "DurationGreaterThanOrEquals" |
4172 "DurationGreaterThan" |
4173 "DurationLessThanOrEquals" |
4174 "DurationLessThan"
4175
4176 // Value is the conditional value, or set of values. The values can be fixed set
4177 // or can be variables declared using JMESPath.
4178 value?: null | bool | number | string | [...] | {...}
4179 }]
4180 ...
4181 }
4182
4183 // UID specifies the resource uid.
4184 uid?: string
4185 }]
4186
4187 // GenerateExisting controls whether to trigger the rule in existing resources
4188 // If is set to "true" the rule will be triggered and applied to existing matched resources.
4189 generateExisting?: bool
4190
4191 // Kind specifies resource kind.
4192 kind?: string
4193
4194 // Name specifies the resource name.
4195 name?: string
4196
4197 // Namespace specifies resource namespace.
4198 namespace?: string
4199
4200 // OrphanDownstreamOnPolicyDelete controls whether generated resources should be
4201 // deleted when the rule that generated
4202 // them is deleted with synchronization enabled. This option is only applicable
4203 // to generate rules of the data type.
4204 // See https://kyverno.io/docs/writing-policies/generate/#data-examples.
4205 // Defaults to "false" if not specified.
4206 orphanDownstreamOnPolicyDelete?: bool
4207
4208 // Synchronize controls if generated resources should be kept in-sync with their source resource.
4209 // If Synchronize is set to "true" changes to generated resources will be overwritten with resource
4210 // data from Data or the resource specified in the Clone declaration.
4211 // Optional. Defaults to "false" if not specified.
4212 synchronize?: bool
4213
4214 // UID specifies the resource uid.
4215 uid?: string
4216 }
4217
4218 // ImageExtractors defines a mapping from kinds to ImageExtractorConfigs.
4219 // This config is only valid for verifyImages rules.
4220 imageExtractors?: [string]: [...{
4221 // JMESPath is an optional JMESPath expression to apply to the image value.
4222 // This is useful when the extracted image begins with a prefix like 'docker://'.
4223 // The 'trim_prefix' function may be used to trim the prefix: trim_prefix(@, 'docker://').
4224 // Note - Image digest mutation may not be used when applying a JMESPAth to an image.
4225 jmesPath?: string
4226
4227 // Key is an optional name of the field within 'path' that will be used to
4228 // uniquely identify an image.
4229 // Note - this field MUST be unique.
4230 key?: string
4231
4232 // Name is the entry the image will be available under 'images.<name>' in the context.
4233 // If this field is not defined, image entries will appear under 'images.custom'.
4234 name?: string
4235
4236 // Path is the path to the object containing the image field in a custom resource.
4237 // It should be slash-separated. Each slash-separated key must be a valid YAML
4238 // key or a wildcard '*'.
4239 // Wildcard keys are expanded in case of arrays or objects.
4240 path!: string
4241
4242 // Value is an optional name of the field within 'path' that points to the image URI.
4243 // This is useful when a custom 'key' is also defined.
4244 value?: string
4245 }]
4246
4247 // MatchResources defines when this policy rule should be applied. The match
4248 // criteria can include resource information (e.g. kind, name, namespace, labels)
4249 // and admission review request information like the user name or role.
4250 // At least one kind is required.
4251 match!: matchN(0, [null | bool | number | string | [...] | {
4252 any!: _
4253 all!: _
4254 }]) & {
4255 // All allows specifying resources which will be ANDed
4256 all?: [...{
4257 // ClusterRoles is the list of cluster-wide role names for the user.
4258 clusterRoles?: [...string]
4259
4260 // ResourceDescription contains information about the resource being created or modified.
4261 resources?: matchN(0, [null | bool | number | string | [...] | {
4262 name!: _
4263 names!: _
4264 }]) & {
4265 // Annotations is a map of annotations (key-value pairs of type string). Annotation keys
4266 // and values support the wildcard characters "*" (matches zero or many characters) and
4267 // "?" (matches at least one character).
4268 annotations?: [string]: string
4269
4270 // Kinds is a list of resource kinds.
4271 kinds?: [...string]
4272
4273 // Name is the name of the resource. The name supports wildcard characters
4274 // "*" (matches zero or many characters) and "?" (at least one character).
4275 // NOTE: "Name" is being deprecated in favor of "Names".
4276 name?: string
4277
4278 // Names are the names of the resources. Each name supports wildcard characters
4279 // "*" (matches zero or many characters) and "?" (at least one character).
4280 names?: [...string]
4281
4282 // NamespaceSelector is a label selector for the resource namespace. Label keys and values
4283 // in `matchLabels` support the wildcard characters `*` (matches zero or many characters)
4284 // and `?` (matches one character).Wildcards allows writing label selectors like
4285 // ["storage.k8s.io/*": "*"]. Note that using ["*" : "*"] matches any key and value but
4286 // does not match an empty label set.
4287 namespaceSelector?: {
4288 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
4289 matchExpressions?: [...{
4290 // key is the label key that the selector applies to.
4291 key!: string
4292
4293 // operator represents a key's relationship to a set of values.
4294 // Valid operators are In, NotIn, Exists and DoesNotExist.
4295 operator!: string
4296
4297 // values is an array of string values. If the operator is In or NotIn,
4298 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
4299 // the values array must be empty. This array is replaced during a strategic
4300 // merge patch.
4301 values?: [...string]
4302 }]
4303
4304 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
4305 // map is equivalent to an element of matchExpressions, whose key field is "key", the
4306 // operator is "In", and the values array contains only "value". The requirements are ANDed.
4307 matchLabels?: [string]: string
4308 }
4309
4310 // Namespaces is a list of namespaces names. Each name supports wildcard characters
4311 // "*" (matches zero or many characters) and "?" (at least one character).
4312 namespaces?: [...string]
4313
4314 // Operations can contain values ["CREATE, "UPDATE", "CONNECT", "DELETE"], which
4315 // are used to match a specific action.
4316 operations?: [..."CREATE" | "CONNECT" | "UPDATE" | "DELETE"]
4317
4318 // Selector is a label selector. Label keys and values in `matchLabels` support the wildcard
4319 // characters `*` (matches zero or many characters) and `?` (matches one character).
4320 // Wildcards allows writing label selectors like ["storage.k8s.io/*": "*"]. Note that
4321 // using ["*" : "*"] matches any key and value but does not match an empty label set.
4322 selector?: {
4323 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
4324 matchExpressions?: [...{
4325 // key is the label key that the selector applies to.
4326 key!: string
4327
4328 // operator represents a key's relationship to a set of values.
4329 // Valid operators are In, NotIn, Exists and DoesNotExist.
4330 operator!: string
4331
4332 // values is an array of string values. If the operator is In or NotIn,
4333 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
4334 // the values array must be empty. This array is replaced during a strategic
4335 // merge patch.
4336 values?: [...string]
4337 }]
4338
4339 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
4340 // map is equivalent to an element of matchExpressions, whose key field is "key", the
4341 // operator is "In", and the values array contains only "value". The requirements are ANDed.
4342 matchLabels?: [string]: string
4343 }
4344 }
4345
4346 // Roles is the list of namespaced role names for the user.
4347 roles?: [...string]
4348
4349 // Subjects is the list of subject names like users, user groups, and service accounts.
4350 subjects?: [...{
4351 // APIGroup holds the API group of the referenced subject.
4352 // Defaults to "" for ServiceAccount subjects.
4353 // Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
4354 apiGroup?: string
4355
4356 // Kind of object being referenced. Values defined by this API group are "User",
4357 // "Group", and "ServiceAccount".
4358 // If the Authorizer does not recognized the kind value, the Authorizer should report an error.
4359 kind!: string
4360
4361 // Name of the object being referenced.
4362 name!: string
4363
4364 // Namespace of the referenced object. If the object kind is non-namespace, such
4365 // as "User" or "Group", and this value is not empty
4366 // the Authorizer should report an error.
4367 namespace?: string
4368 }]
4369 }]
4370
4371 // Any allows specifying resources which will be ORed
4372 any?: [...{
4373 // ClusterRoles is the list of cluster-wide role names for the user.
4374 clusterRoles?: [...string]
4375
4376 // ResourceDescription contains information about the resource being created or modified.
4377 resources?: matchN(0, [null | bool | number | string | [...] | {
4378 name!: _
4379 names!: _
4380 }]) & {
4381 // Annotations is a map of annotations (key-value pairs of type string). Annotation keys
4382 // and values support the wildcard characters "*" (matches zero or many characters) and
4383 // "?" (matches at least one character).
4384 annotations?: [string]: string
4385
4386 // Kinds is a list of resource kinds.
4387 kinds?: [...string]
4388
4389 // Name is the name of the resource. The name supports wildcard characters
4390 // "*" (matches zero or many characters) and "?" (at least one character).
4391 // NOTE: "Name" is being deprecated in favor of "Names".
4392 name?: string
4393
4394 // Names are the names of the resources. Each name supports wildcard characters
4395 // "*" (matches zero or many characters) and "?" (at least one character).
4396 names?: [...string]
4397
4398 // NamespaceSelector is a label selector for the resource namespace. Label keys and values
4399 // in `matchLabels` support the wildcard characters `*` (matches zero or many characters)
4400 // and `?` (matches one character).Wildcards allows writing label selectors like
4401 // ["storage.k8s.io/*": "*"]. Note that using ["*" : "*"] matches any key and value but
4402 // does not match an empty label set.
4403 namespaceSelector?: {
4404 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
4405 matchExpressions?: [...{
4406 // key is the label key that the selector applies to.
4407 key!: string
4408
4409 // operator represents a key's relationship to a set of values.
4410 // Valid operators are In, NotIn, Exists and DoesNotExist.
4411 operator!: string
4412
4413 // values is an array of string values. If the operator is In or NotIn,
4414 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
4415 // the values array must be empty. This array is replaced during a strategic
4416 // merge patch.
4417 values?: [...string]
4418 }]
4419
4420 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
4421 // map is equivalent to an element of matchExpressions, whose key field is "key", the
4422 // operator is "In", and the values array contains only "value". The requirements are ANDed.
4423 matchLabels?: [string]: string
4424 }
4425
4426 // Namespaces is a list of namespaces names. Each name supports wildcard characters
4427 // "*" (matches zero or many characters) and "?" (at least one character).
4428 namespaces?: [...string]
4429
4430 // Operations can contain values ["CREATE, "UPDATE", "CONNECT", "DELETE"], which
4431 // are used to match a specific action.
4432 operations?: [..."CREATE" | "CONNECT" | "UPDATE" | "DELETE"]
4433
4434 // Selector is a label selector. Label keys and values in `matchLabels` support the wildcard
4435 // characters `*` (matches zero or many characters) and `?` (matches one character).
4436 // Wildcards allows writing label selectors like ["storage.k8s.io/*": "*"]. Note that
4437 // using ["*" : "*"] matches any key and value but does not match an empty label set.
4438 selector?: {
4439 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
4440 matchExpressions?: [...{
4441 // key is the label key that the selector applies to.
4442 key!: string
4443
4444 // operator represents a key's relationship to a set of values.
4445 // Valid operators are In, NotIn, Exists and DoesNotExist.
4446 operator!: string
4447
4448 // values is an array of string values. If the operator is In or NotIn,
4449 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
4450 // the values array must be empty. This array is replaced during a strategic
4451 // merge patch.
4452 values?: [...string]
4453 }]
4454
4455 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
4456 // map is equivalent to an element of matchExpressions, whose key field is "key", the
4457 // operator is "In", and the values array contains only "value". The requirements are ANDed.
4458 matchLabels?: [string]: string
4459 }
4460 }
4461
4462 // Roles is the list of namespaced role names for the user.
4463 roles?: [...string]
4464
4465 // Subjects is the list of subject names like users, user groups, and service accounts.
4466 subjects?: [...{
4467 // APIGroup holds the API group of the referenced subject.
4468 // Defaults to "" for ServiceAccount subjects.
4469 // Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
4470 apiGroup?: string
4471
4472 // Kind of object being referenced. Values defined by this API group are "User",
4473 // "Group", and "ServiceAccount".
4474 // If the Authorizer does not recognized the kind value, the Authorizer should report an error.
4475 kind!: string
4476
4477 // Name of the object being referenced.
4478 name!: string
4479
4480 // Namespace of the referenced object. If the object kind is non-namespace, such
4481 // as "User" or "Group", and this value is not empty
4482 // the Authorizer should report an error.
4483 namespace?: string
4484 }]
4485 }]
4486
4487 // ClusterRoles is the list of cluster-wide role names for the user.
4488 clusterRoles?: [...string]
4489
4490 // ResourceDescription contains information about the resource being created or modified.
4491 // Requires at least one tag to be specified when under MatchResources.
4492 // Specifying ResourceDescription directly under match is being deprecated.
4493 // Please specify under "any" or "all" instead.
4494 resources?: matchN(0, [null | bool | number | string | [...] | {
4495 name!: _
4496 names!: _
4497 }]) & {
4498 // Annotations is a map of annotations (key-value pairs of type string). Annotation keys
4499 // and values support the wildcard characters "*" (matches zero or many characters) and
4500 // "?" (matches at least one character).
4501 annotations?: [string]: string
4502
4503 // Kinds is a list of resource kinds.
4504 kinds?: [...string]
4505
4506 // Name is the name of the resource. The name supports wildcard characters
4507 // "*" (matches zero or many characters) and "?" (at least one character).
4508 // NOTE: "Name" is being deprecated in favor of "Names".
4509 name?: string
4510
4511 // Names are the names of the resources. Each name supports wildcard characters
4512 // "*" (matches zero or many characters) and "?" (at least one character).
4513 names?: [...string]
4514
4515 // NamespaceSelector is a label selector for the resource namespace. Label keys and values
4516 // in `matchLabels` support the wildcard characters `*` (matches zero or many characters)
4517 // and `?` (matches one character).Wildcards allows writing label selectors like
4518 // ["storage.k8s.io/*": "*"]. Note that using ["*" : "*"] matches any key and value but
4519 // does not match an empty label set.
4520 namespaceSelector?: {
4521 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
4522 matchExpressions?: [...{
4523 // key is the label key that the selector applies to.
4524 key!: string
4525
4526 // operator represents a key's relationship to a set of values.
4527 // Valid operators are In, NotIn, Exists and DoesNotExist.
4528 operator!: string
4529
4530 // values is an array of string values. If the operator is In or NotIn,
4531 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
4532 // the values array must be empty. This array is replaced during a strategic
4533 // merge patch.
4534 values?: [...string]
4535 }]
4536
4537 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
4538 // map is equivalent to an element of matchExpressions, whose key field is "key", the
4539 // operator is "In", and the values array contains only "value". The requirements are ANDed.
4540 matchLabels?: [string]: string
4541 }
4542
4543 // Namespaces is a list of namespaces names. Each name supports wildcard characters
4544 // "*" (matches zero or many characters) and "?" (at least one character).
4545 namespaces?: [...string]
4546
4547 // Operations can contain values ["CREATE, "UPDATE", "CONNECT", "DELETE"], which
4548 // are used to match a specific action.
4549 operations?: [..."CREATE" | "CONNECT" | "UPDATE" | "DELETE"]
4550
4551 // Selector is a label selector. Label keys and values in `matchLabels` support the wildcard
4552 // characters `*` (matches zero or many characters) and `?` (matches one character).
4553 // Wildcards allows writing label selectors like ["storage.k8s.io/*": "*"]. Note that
4554 // using ["*" : "*"] matches any key and value but does not match an empty label set.
4555 selector?: {
4556 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
4557 matchExpressions?: [...{
4558 // key is the label key that the selector applies to.
4559 key!: string
4560
4561 // operator represents a key's relationship to a set of values.
4562 // Valid operators are In, NotIn, Exists and DoesNotExist.
4563 operator!: string
4564
4565 // values is an array of string values. If the operator is In or NotIn,
4566 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
4567 // the values array must be empty. This array is replaced during a strategic
4568 // merge patch.
4569 values?: [...string]
4570 }]
4571
4572 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
4573 // map is equivalent to an element of matchExpressions, whose key field is "key", the
4574 // operator is "In", and the values array contains only "value". The requirements are ANDed.
4575 matchLabels?: [string]: string
4576 }
4577 }
4578
4579 // Roles is the list of namespaced role names for the user.
4580 roles?: [...string]
4581
4582 // Subjects is the list of subject names like users, user groups, and service accounts.
4583 subjects?: [...{
4584 // APIGroup holds the API group of the referenced subject.
4585 // Defaults to "" for ServiceAccount subjects.
4586 // Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
4587 apiGroup?: string
4588
4589 // Kind of object being referenced. Values defined by this API group are "User",
4590 // "Group", and "ServiceAccount".
4591 // If the Authorizer does not recognized the kind value, the Authorizer should report an error.
4592 kind!: string
4593
4594 // Name of the object being referenced.
4595 name!: string
4596
4597 // Namespace of the referenced object. If the object kind is non-namespace, such
4598 // as "User" or "Group", and this value is not empty
4599 // the Authorizer should report an error.
4600 namespace?: string
4601 }]
4602 }
4603
4604 // Mutation is used to modify matching resources.
4605 mutate?: {
4606 // ForEach applies mutation rules to a list of sub-elements by creating a
4607 // context for each entry in the list and looping over it to apply the
4608 // specified logic.
4609 foreach?: [...{
4610 // Context defines variables and data sources that can be used during rule execution.
4611 context?: [...matchN(1, [
4612 {configMap!: _}, {apiCall!: _}, {imageRegistry!: _}, {variable!: _}, {globalReference!: _},
4613 ]) & {
4614 // APICall is an HTTP request to the Kubernetes API server, or other JSON web service.
4615 // The data returned is stored in the context with the name for the context entry.
4616 apiCall?: {
4617 // The data object specifies the POST data sent to the server.
4618 // Only applicable when the method field is set to POST.
4619 data?: [...{
4620 // Key is a unique identifier for the data value
4621 key!: string
4622
4623 // Value is the data value
4624 value!: null | bool | number | string | [...] | {...}
4625 }]
4626
4627 // Default is an optional arbitrary JSON object that the context
4628 // value is set to, if the apiCall returns error.
4629 default?: null | bool | number | string | [...] | {...}
4630
4631 // JMESPath is an optional JSON Match Expression that can be used to
4632 // transform the JSON response returned from the server. For example
4633 // a JMESPath of "items | length(@)" applied to the API server response
4634 // for the URLPath "/apis/apps/v1/deployments" will return the total count
4635 // of deployments across all namespaces.
4636 jmesPath?: string
4637
4638 // Method is the HTTP request type (GET or POST). Defaults to GET.
4639 method?: "GET" | "POST"
4640
4641 // Service is an API call to a JSON web service.
4642 // This is used for non-Kubernetes API server calls.
4643 // It's mutually exclusive with the URLPath field.
4644 service?: {
4645 // CABundle is a PEM encoded CA bundle which will be used to validate
4646 // the server certificate.
4647 caBundle?: string
4648
4649 // Headers is a list of optional HTTP headers to be included in the request.
4650 headers?: [...{
4651 // Key is the header key
4652 key!: string
4653
4654 // Value is the header value
4655 value!: string
4656 }]
4657
4658 // URL is the JSON web service URL. A typical form is
4659 // `https://{service}.{namespace}:{port}/{path}`.
4660 url!: string
4661 }
4662
4663 // URLPath is the URL path to be used in the HTTP GET or POST request to the
4664 // Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
4665 // The format required is the same format used by the `kubectl get --raw` command.
4666 // See
4667 // https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls
4668 // for details.
4669 // It's mutually exclusive with the Service field.
4670 urlPath?: string
4671 }
4672
4673 // ConfigMap is the ConfigMap reference.
4674 configMap?: {
4675 // Name is the ConfigMap name.
4676 name!: string
4677
4678 // Namespace is the ConfigMap namespace.
4679 namespace?: string
4680 }
4681
4682 // GlobalContextEntryReference is a reference to a cached global context entry.
4683 globalReference?: {
4684 // JMESPath is an optional JSON Match Expression that can be used to
4685 // transform the JSON response returned from the server. For example
4686 // a JMESPath of "items | length(@)" applied to the API server response
4687 // for the URLPath "/apis/apps/v1/deployments" will return the total count
4688 // of deployments across all namespaces.
4689 jmesPath?: string
4690
4691 // Name of the global context entry
4692 name!: string
4693 }
4694
4695 // ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image
4696 // details.
4697 imageRegistry?: {
4698 // ImageRegistryCredentials provides credentials that will be used for authentication with registry
4699 imageRegistryCredentials?: {
4700 // AllowInsecureRegistry allows insecure access to a registry.
4701 allowInsecureRegistry?: bool
4702
4703 // Providers specifies a list of OCI Registry names, whose authentication providers are provided.
4704 // It can be of one of these values: default,google,azure,amazon,github.
4705 providers?: [..."default" | "amazon" | "azure" | "google" | "github"]
4706
4707 // Secrets specifies a list of secrets that are provided for credentials.
4708 // Secrets can be specified as a name (Kyverno namespace) or namespace/name.
4709 // imagePullSecrets from the resource namespace are also used.
4710 secrets?: [...string]
4711 }
4712
4713 // JMESPath is an optional JSON Match Expression that can be used to
4714 // transform the ImageData struct returned as a result of processing
4715 // the image reference.
4716 jmesPath?: string
4717
4718 // Reference is image reference to a container image in the registry.
4719 // Example: ghcr.io/kyverno/kyverno:latest
4720 reference!: string
4721 }
4722
4723 // Name is the variable name.
4724 name!: string
4725
4726 // Variable defines an arbitrary JMESPath context variable that can be defined inline.
4727 variable?: {
4728 // Default is an optional arbitrary JSON object that the variable may take if the JMESPath
4729 // expression evaluates to nil
4730 default?: null | bool | number | string | [...] | {...}
4731
4732 // JMESPath is an optional JMESPath Expression that can be used to
4733 // transform the variable.
4734 jmesPath?: string
4735
4736 // Value is any arbitrary JSON object representable in YAML or JSON form.
4737 value?: null | bool | number | string | [...] | {...}
4738 }
4739 }]
4740
4741 // Foreach declares a nested foreach iterator
4742 foreach?: null | bool | number | string | [...] | {...}
4743
4744 // List specifies a JMESPath expression that results in one or more elements
4745 // to which the validation logic is applied.
4746 list?: string
4747
4748 // Order defines the iteration order on the list.
4749 // Can be Ascending to iterate from first to last element or Descending to
4750 // iterate in from last to first element.
4751 order?: "Ascending" | "Descending"
4752
4753 // PatchStrategicMerge is a strategic merge patch used to modify resources.
4754 // See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
4755 // and https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patchesstrategicmerge/.
4756 patchStrategicMerge?: null | bool | number | string | [...] | {...}
4757
4758 // PatchesJSON6902 is a list of RFC 6902 JSON Patch declarations used to modify resources.
4759 // See https://tools.ietf.org/html/rfc6902 and
4760 // https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patchesjson6902/.
4761 patchesJson6902?: string
4762
4763 // AnyAllConditions are used to determine if a policy rule should be applied by evaluating a
4764 // set of conditions. The declaration can contain nested `any` or `all` statements.
4765 // See: https://kyverno.io/docs/writing-policies/preconditions/
4766 preconditions?: {
4767 // AllConditions enable variable-based conditional rule execution. This is useful for
4768 // finer control of when an rule is applied. A condition can reference object data
4769 // using JMESPath notation.
4770 // Here, all of the conditions need to pass
4771 all?: [...{
4772 // Key is the context entry (using JMESPath) for conditional rule evaluation.
4773 key?: null | bool | number | string | [...] | {...}
4774
4775 // Message is an optional display message
4776 message?: string
4777
4778 // Operator is the conditional operation to perform. Valid operators are:
4779 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
4780 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
4781 // DurationLessThanOrEquals, DurationLessThan
4782 operator?: "Equals" |
4783 "NotEquals" |
4784 "In" |
4785 "AnyIn" |
4786 "AllIn" |
4787 "NotIn" |
4788 "AnyNotIn" |
4789 "AllNotIn" |
4790 "GreaterThanOrEquals" |
4791 "GreaterThan" |
4792 "LessThanOrEquals" |
4793 "LessThan" |
4794 "DurationGreaterThanOrEquals" |
4795 "DurationGreaterThan" |
4796 "DurationLessThanOrEquals" |
4797 "DurationLessThan"
4798
4799 // Value is the conditional value, or set of values. The values can be fixed set
4800 // or can be variables declared using JMESPath.
4801 value?: null | bool | number | string | [...] | {...}
4802 }]
4803
4804 // AnyConditions enable variable-based conditional rule execution. This is useful for
4805 // finer control of when an rule is applied. A condition can reference object data
4806 // using JMESPath notation.
4807 // Here, at least one of the conditions need to pass
4808 any?: [...{
4809 // Key is the context entry (using JMESPath) for conditional rule evaluation.
4810 key?: null | bool | number | string | [...] | {...}
4811
4812 // Message is an optional display message
4813 message?: string
4814
4815 // Operator is the conditional operation to perform. Valid operators are:
4816 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
4817 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
4818 // DurationLessThanOrEquals, DurationLessThan
4819 operator?: "Equals" |
4820 "NotEquals" |
4821 "In" |
4822 "AnyIn" |
4823 "AllIn" |
4824 "NotIn" |
4825 "AnyNotIn" |
4826 "AllNotIn" |
4827 "GreaterThanOrEquals" |
4828 "GreaterThan" |
4829 "LessThanOrEquals" |
4830 "LessThan" |
4831 "DurationGreaterThanOrEquals" |
4832 "DurationGreaterThan" |
4833 "DurationLessThanOrEquals" |
4834 "DurationLessThan"
4835
4836 // Value is the conditional value, or set of values. The values can be fixed set
4837 // or can be variables declared using JMESPath.
4838 value?: null | bool | number | string | [...] | {...}
4839 }]
4840 ...
4841 }
4842 }]
4843
4844 // MutateExistingOnPolicyUpdate controls if the mutateExisting rule will be
4845 // applied on policy events.
4846 mutateExistingOnPolicyUpdate?: bool
4847
4848 // PatchStrategicMerge is a strategic merge patch used to modify resources.
4849 // See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
4850 // and https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patchesstrategicmerge/.
4851 patchStrategicMerge?: null | bool | number | string | [...] | {...}
4852
4853 // PatchesJSON6902 is a list of RFC 6902 JSON Patch declarations used to modify resources.
4854 // See https://tools.ietf.org/html/rfc6902 and
4855 // https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patchesjson6902/.
4856 patchesJson6902?: string
4857
4858 // Targets defines the target resources to be mutated.
4859 targets?: [...{
4860 // APIVersion specifies resource apiVersion.
4861 apiVersion?: string
4862
4863 // Context defines variables and data sources that can be used during rule execution.
4864 context?: [...matchN(1, [
4865 {configMap!: _}, {apiCall!: _}, {imageRegistry!: _}, {variable!: _}, {globalReference!: _},
4866 ]) & {
4867 // APICall is an HTTP request to the Kubernetes API server, or other JSON web service.
4868 // The data returned is stored in the context with the name for the context entry.
4869 apiCall?: {
4870 // The data object specifies the POST data sent to the server.
4871 // Only applicable when the method field is set to POST.
4872 data?: [...{
4873 // Key is a unique identifier for the data value
4874 key!: string
4875
4876 // Value is the data value
4877 value!: null | bool | number | string | [...] | {...}
4878 }]
4879
4880 // Default is an optional arbitrary JSON object that the context
4881 // value is set to, if the apiCall returns error.
4882 default?: null | bool | number | string | [...] | {...}
4883
4884 // JMESPath is an optional JSON Match Expression that can be used to
4885 // transform the JSON response returned from the server. For example
4886 // a JMESPath of "items | length(@)" applied to the API server response
4887 // for the URLPath "/apis/apps/v1/deployments" will return the total count
4888 // of deployments across all namespaces.
4889 jmesPath?: string
4890
4891 // Method is the HTTP request type (GET or POST). Defaults to GET.
4892 method?: "GET" | "POST"
4893
4894 // Service is an API call to a JSON web service.
4895 // This is used for non-Kubernetes API server calls.
4896 // It's mutually exclusive with the URLPath field.
4897 service?: {
4898 // CABundle is a PEM encoded CA bundle which will be used to validate
4899 // the server certificate.
4900 caBundle?: string
4901
4902 // Headers is a list of optional HTTP headers to be included in the request.
4903 headers?: [...{
4904 // Key is the header key
4905 key!: string
4906
4907 // Value is the header value
4908 value!: string
4909 }]
4910
4911 // URL is the JSON web service URL. A typical form is
4912 // `https://{service}.{namespace}:{port}/{path}`.
4913 url!: string
4914 }
4915
4916 // URLPath is the URL path to be used in the HTTP GET or POST request to the
4917 // Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
4918 // The format required is the same format used by the `kubectl get --raw` command.
4919 // See
4920 // https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls
4921 // for details.
4922 // It's mutually exclusive with the Service field.
4923 urlPath?: string
4924 }
4925
4926 // ConfigMap is the ConfigMap reference.
4927 configMap?: {
4928 // Name is the ConfigMap name.
4929 name!: string
4930
4931 // Namespace is the ConfigMap namespace.
4932 namespace?: string
4933 }
4934
4935 // GlobalContextEntryReference is a reference to a cached global context entry.
4936 globalReference?: {
4937 // JMESPath is an optional JSON Match Expression that can be used to
4938 // transform the JSON response returned from the server. For example
4939 // a JMESPath of "items | length(@)" applied to the API server response
4940 // for the URLPath "/apis/apps/v1/deployments" will return the total count
4941 // of deployments across all namespaces.
4942 jmesPath?: string
4943
4944 // Name of the global context entry
4945 name!: string
4946 }
4947
4948 // ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image
4949 // details.
4950 imageRegistry?: {
4951 // ImageRegistryCredentials provides credentials that will be used for authentication with registry
4952 imageRegistryCredentials?: {
4953 // AllowInsecureRegistry allows insecure access to a registry.
4954 allowInsecureRegistry?: bool
4955
4956 // Providers specifies a list of OCI Registry names, whose authentication providers are provided.
4957 // It can be of one of these values: default,google,azure,amazon,github.
4958 providers?: [..."default" | "amazon" | "azure" | "google" | "github"]
4959
4960 // Secrets specifies a list of secrets that are provided for credentials.
4961 // Secrets can be specified as a name (Kyverno namespace) or namespace/name.
4962 // imagePullSecrets from the resource namespace are also used.
4963 secrets?: [...string]
4964 }
4965
4966 // JMESPath is an optional JSON Match Expression that can be used to
4967 // transform the ImageData struct returned as a result of processing
4968 // the image reference.
4969 jmesPath?: string
4970
4971 // Reference is image reference to a container image in the registry.
4972 // Example: ghcr.io/kyverno/kyverno:latest
4973 reference!: string
4974 }
4975
4976 // Name is the variable name.
4977 name!: string
4978
4979 // Variable defines an arbitrary JMESPath context variable that can be defined inline.
4980 variable?: {
4981 // Default is an optional arbitrary JSON object that the variable may take if the JMESPath
4982 // expression evaluates to nil
4983 default?: null | bool | number | string | [...] | {...}
4984
4985 // JMESPath is an optional JMESPath Expression that can be used to
4986 // transform the variable.
4987 jmesPath?: string
4988
4989 // Value is any arbitrary JSON object representable in YAML or JSON form.
4990 value?: null | bool | number | string | [...] | {...}
4991 }
4992 }]
4993
4994 // Kind specifies resource kind.
4995 kind?: string
4996
4997 // Name specifies the resource name.
4998 name?: string
4999
5000 // Namespace specifies resource namespace.
5001 namespace?: string
5002
5003 // Preconditions are used to determine if a policy rule should be applied by evaluating a
5004 // set of conditions. The declaration can contain nested `any` or `all` statements. A direct list
5005 // of conditions (without `any` or `all` statements is supported for backwards compatibility but
5006 // will be deprecated in the next major release.
5007 // See: https://kyverno.io/docs/writing-policies/preconditions/
5008 preconditions?: null | bool | number | string | [...] | {...}
5009
5010 // Selector allows you to select target resources with their labels.
5011 selector?: {
5012 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
5013 matchExpressions?: [...{
5014 // key is the label key that the selector applies to.
5015 key!: string
5016
5017 // operator represents a key's relationship to a set of values.
5018 // Valid operators are In, NotIn, Exists and DoesNotExist.
5019 operator!: string
5020
5021 // values is an array of string values. If the operator is In or NotIn,
5022 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
5023 // the values array must be empty. This array is replaced during a strategic
5024 // merge patch.
5025 values?: [...string]
5026 }]
5027
5028 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
5029 // map is equivalent to an element of matchExpressions, whose key field is "key", the
5030 // operator is "In", and the values array contains only "value". The requirements are ANDed.
5031 matchLabels?: [string]: string
5032 }
5033
5034 // UID specifies the resource uid.
5035 uid?: string
5036 }]
5037 }
5038
5039 // Name is a label to identify the rule, It must be unique within the policy.
5040 name!: strings.MaxRunes(
5041 63,
5042 )
5043
5044 // Preconditions are used to determine if a policy rule should be applied by evaluating a
5045 // set of conditions. The declaration can contain nested `any` or `all` statements. A direct list
5046 // of conditions (without `any` or `all` statements is supported for backwards compatibility but
5047 // will be deprecated in the next major release.
5048 // See: https://kyverno.io/docs/writing-policies/preconditions/
5049 preconditions?: null | bool | number | string | [...] | {...}
5050
5051 // ReportProperties are the additional properties from the rule that will be
5052 // added to the policy report result
5053 reportProperties?: [string]: string
5054
5055 // SkipBackgroundRequests bypasses admission requests that are sent by the background controller.
5056 // The default value is set to "true", it must be set to "false" to apply
5057 // generate and mutateExisting rules to those requests.
5058 skipBackgroundRequests?: bool
5059
5060 // Validation is used to validate matching resources.
5061 validate?: {
5062 // AllowExistingViolations allows prexisting violating resources to continue violating a policy.
5063 allowExistingViolations?: bool
5064
5065 // AnyPattern specifies list of validation patterns. At least one of the patterns
5066 // must be satisfied for the validation rule to succeed.
5067 anyPattern?: null | bool | number | string | [...] | {...}
5068
5069 // Assert defines a kyverno-json assertion tree.
5070 assert?: {...}
5071
5072 // CEL allows validation checks using the Common Expression Language
5073 // (https://kubernetes.io/docs/reference/using-api/cel/).
5074 cel?: {
5075 // AuditAnnotations contains CEL expressions which are used to produce audit
5076 // annotations for the audit event of the API request.
5077 auditAnnotations?: [...{
5078 // key specifies the audit annotation key. The audit annotation keys of
5079 // a ValidatingAdmissionPolicy must be unique. The key must be a qualified
5080 // name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length.
5081 //
5082 // The key is combined with the resource name of the
5083 // ValidatingAdmissionPolicy to construct an audit annotation key:
5084 // "{ValidatingAdmissionPolicy name}/{key}".
5085 //
5086 // If an admission webhook uses the same resource name as this ValidatingAdmissionPolicy
5087 // and the same audit annotation key, the annotation key will be identical.
5088 // In this case, the first annotation written with the key will be included
5089 // in the audit event and all subsequent annotations with the same key
5090 // will be discarded.
5091 //
5092 // Required.
5093 key!: string
5094
5095 // valueExpression represents the expression which is evaluated by CEL to
5096 // produce an audit annotation value. The expression must evaluate to either
5097 // a string or null value. If the expression evaluates to a string, the
5098 // audit annotation is included with the string value. If the expression
5099 // evaluates to null or empty string the audit annotation will be omitted.
5100 // The valueExpression may be no longer than 5kb in length.
5101 // If the result of the valueExpression is more than 10kb in length, it
5102 // will be truncated to 10kb.
5103 //
5104 // If multiple ValidatingAdmissionPolicyBinding resources match an
5105 // API request, then the valueExpression will be evaluated for
5106 // each binding. All unique values produced by the valueExpressions
5107 // will be joined together in a comma-separated list.
5108 //
5109 // Required.
5110 valueExpression!: string
5111 }]
5112
5113 // Expressions is a list of CELExpression types.
5114 expressions?: [...{
5115 // Expression represents the expression which will be evaluated by CEL.
5116 // ref: https://github.com/google/cel-spec
5117 // CEL expressions have access to the contents of the API request/response,
5118 // organized into CEL variables as well as some other useful variables:
5119 //
5120 // - 'object' - The object from the incoming request. The value is null for DELETE requests.
5121 // - 'oldObject' - The existing object. The value is null for CREATE requests.
5122 // - 'request' - Attributes of the API
5123 // request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
5124 // - 'params' - Parameter resource referred to by the policy binding being
5125 // evaluated. Only populated if the policy has a ParamKind.
5126 // - 'namespaceObject' - The namespace object that the incoming object belongs
5127 // to. The value is null for cluster-scoped resources.
5128 // - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
5129 // For example, a variable named 'foo' can be accessed as 'variables.foo'.
5130 // - 'authorizer' - A CEL Authorizer. May be used to perform authorization
5131 // checks for the principal (user or service account) of the request.
5132 // See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
5133 // - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the
5134 // 'authorizer' and configured with the
5135 // request resource.
5136 //
5137 // The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are
5138 // always accessible from the root of the
5139 // object. No other metadata properties are accessible.
5140 //
5141 // Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
5142 // Accessible property names are escaped according to the following rules when
5143 // accessed in the expression:
5144 // - '__' escapes to '__underscores__'
5145 // - '.' escapes to '__dot__'
5146 // - '-' escapes to '__dash__'
5147 // - '/' escapes to '__slash__'
5148 // - Property names that exactly match a CEL RESERVED keyword escape to
5149 // '__{keyword}__'. The keywords are:
5150 // "true", "false", "null", "in", "as", "break", "const", "continue", "else",
5151 // "for", "function", "if",
5152 // "import", "let", "loop", "package", "namespace", "return".
5153 // Examples:
5154 // - Expression accessing a property named "namespace": {"Expression": "object.__namespace__ > 0"}
5155 // - Expression accessing a property named "x-prop": {"Expression": "object.x__dash__prop > 0"}
5156 // - Expression accessing a property named "redact__d": {"Expression":
5157 // "object.redact__underscores__d > 0"}
5158 //
5159 // Equality on arrays with list type of 'set' or 'map' ignores element order, i.e. [1, 2] == [2, 1].
5160 // Concatenation on arrays with x-kubernetes-list-type use the semantics of the list type:
5161 // - 'set': `X + Y` performs a union where the array positions of all elements
5162 // in `X` are preserved and
5163 // non-intersecting elements in `Y` are appended, retaining their partial order.
5164 // - 'map': `X + Y` performs a merge where the array positions of all keys in
5165 // `X` are preserved but the values
5166 // are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with
5167 // non-intersecting keys are appended, retaining their partial order.
5168 // Required.
5169 expression!: string
5170
5171 // Message represents the message displayed when validation fails. The message
5172 // is required if the Expression contains
5173 // line breaks. The message must not contain line breaks.
5174 // If unset, the message is "failed rule: {Rule}".
5175 // e.g. "must be a URL with the host matching spec.host"
5176 // If the Expression contains line breaks. Message is required.
5177 // The message must not contain line breaks.
5178 // If unset, the message is "failed Expression: {Expression}".
5179 message?: string
5180
5181 // messageExpression declares a CEL expression that evaluates to the validation
5182 // failure message that is returned when this rule fails.
5183 // Since messageExpression is used as a failure message, it must evaluate to a string.
5184 // If both message and messageExpression are present on a validation, then
5185 // messageExpression will be used if validation fails.
5186 // If messageExpression results in a runtime error, the runtime error is logged,
5187 // and the validation failure message is produced
5188 // as if the messageExpression field were unset. If messageExpression evaluates
5189 // to an empty string, a string with only spaces, or a string
5190 // that contains line breaks, then the validation failure message will also be
5191 // produced as if the messageExpression field were unset, and
5192 // the fact that messageExpression produced an empty string/string with only
5193 // spaces/string with line breaks will be logged.
5194 // messageExpression has access to all the same variables as the `expression`
5195 // except for 'authorizer' and 'authorizer.requestResource'.
5196 // Example:
5197 // "object.x must be less than max ("+string(params.max)+")"
5198 messageExpression?: string
5199
5200 // Reason represents a machine-readable description of why this validation failed.
5201 // If this is the first validation in the list to fail, this reason, as well as the
5202 // corresponding HTTP response code, are used in the
5203 // HTTP response to the client.
5204 // The currently supported reasons are: "Unauthorized", "Forbidden", "Invalid",
5205 // "RequestEntityTooLarge".
5206 // If not set, StatusReasonInvalid is used in the response to the client.
5207 reason?: string
5208 }]
5209
5210 // Generate specifies whether to generate a Kubernetes ValidatingAdmissionPolicy from the rule.
5211 // Optional. Defaults to "false" if not specified.
5212 generate?: bool
5213
5214 // ParamKind is a tuple of Group Kind and Version.
5215 paramKind?: {
5216 // APIVersion is the API group version the resources belong to.
5217 // In format of "group/version".
5218 // Required.
5219 apiVersion?: string
5220
5221 // Kind is the API kind the resources belong to.
5222 // Required.
5223 kind?: string
5224 }
5225
5226 // ParamRef references a parameter resource.
5227 paramRef?: {
5228 // name is the name of the resource being referenced.
5229 //
5230 // One of `name` or `selector` must be set, but `name` and `selector` are
5231 // mutually exclusive properties. If one is set, the other must be unset.
5232 //
5233 // A single parameter used for all admission requests can be configured
5234 // by setting the `name` field, leaving `selector` blank, and setting namespace
5235 // if `paramKind` is namespace-scoped.
5236 name?: string
5237
5238 // namespace is the namespace of the referenced resource. Allows limiting
5239 // the search for params to a specific namespace. Applies to both `name` and
5240 // `selector` fields.
5241 //
5242 // A per-namespace parameter may be used by specifying a namespace-scoped
5243 // `paramKind` in the policy and leaving this field empty.
5244 //
5245 // - If `paramKind` is cluster-scoped, this field MUST be unset. Setting this
5246 // field results in a configuration error.
5247 //
5248 // - If `paramKind` is namespace-scoped, the namespace of the object being
5249 // evaluated for admission will be used when this field is left unset. Take
5250 // care that if this is left empty the binding must not match any cluster-scoped
5251 // resources, which will result in an error.
5252 namespace?: string
5253
5254 // `parameterNotFoundAction` controls the behavior of the binding when the resource
5255 // exists, and name or selector is valid, but there are no parameters
5256 // matched by the binding. If the value is set to `Allow`, then no
5257 // matched parameters will be treated as successful validation by the binding.
5258 // If set to `Deny`, then no matched parameters will be subject to the
5259 // `failurePolicy` of the policy.
5260 //
5261 // Allowed values are `Allow` or `Deny`
5262 //
5263 // Required
5264 parameterNotFoundAction?: string
5265
5266 // selector can be used to match multiple param objects based on their labels.
5267 // Supply selector: {} to match all resources of the ParamKind.
5268 //
5269 // If multiple params are found, they are all evaluated with the policy expressions
5270 // and the results are ANDed together.
5271 //
5272 // One of `name` or `selector` must be set, but `name` and `selector` are
5273 // mutually exclusive properties. If one is set, the other must be unset.
5274 selector?: {
5275 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
5276 matchExpressions?: [...{
5277 // key is the label key that the selector applies to.
5278 key!: string
5279
5280 // operator represents a key's relationship to a set of values.
5281 // Valid operators are In, NotIn, Exists and DoesNotExist.
5282 operator!: string
5283
5284 // values is an array of string values. If the operator is In or NotIn,
5285 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
5286 // the values array must be empty. This array is replaced during a strategic
5287 // merge patch.
5288 values?: [...string]
5289 }]
5290
5291 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
5292 // map is equivalent to an element of matchExpressions, whose key field is "key", the
5293 // operator is "In", and the values array contains only "value". The requirements are ANDed.
5294 matchLabels?: [string]: string
5295 }
5296 }
5297
5298 // Variables contain definitions of variables that can be used in composition of other expressions.
5299 // Each variable is defined as a named CEL expression.
5300 // The variables defined here will be available under `variables` in other
5301 // expressions of the policy.
5302 variables?: [...{
5303 // Expression is the expression that will be evaluated as the value of the variable.
5304 // The CEL expression has access to the same identifiers as the CEL expressions in Validation.
5305 expression!: string
5306
5307 // Name is the name of the variable. The name must be a valid CEL identifier and
5308 // unique among all variables.
5309 // The variable can be accessed in other expressions through `variables`
5310 // For example, if name is "foo", the variable will be available as `variables.foo`
5311 name!: string
5312 }]
5313 }
5314
5315 // Deny defines conditions used to pass or fail a validation rule.
5316 deny?: {
5317 // Multiple conditions can be declared under an `any` or `all` statement. A direct list
5318 // of conditions (without `any` or `all` statements) is also supported for backwards compatibility
5319 // but will be deprecated in the next major release.
5320 // See: https://kyverno.io/docs/writing-policies/validate/#deny-rules
5321 conditions?: null | bool | number | string | [...] | {...}
5322 }
5323
5324 // FailureAction defines if a validation policy rule violation should block
5325 // the admission review request (Enforce), or allow (Audit) the admission review request
5326 // and report an error in a policy report. Optional.
5327 // Allowed values are Audit or Enforce.
5328 failureAction?: "Audit" | "Enforce"
5329
5330 // FailureActionOverrides is a Cluster Policy attribute that specifies FailureAction
5331 // namespace-wise. It overrides FailureAction for the specified namespaces.
5332 failureActionOverrides?: [...{
5333 // ValidationFailureAction defines the policy validation failure action
5334 action?: "audit" | "enforce" | "Audit" | "Enforce"
5335
5336 // A label selector is a label query over a set of resources. The result of matchLabels and
5337 // matchExpressions are ANDed. An empty label selector matches all objects. A null
5338 // label selector matches no objects.
5339 namespaceSelector?: {
5340 // matchExpressions is a list of label selector requirements. The requirements are ANDed.
5341 matchExpressions?: [...{
5342 // key is the label key that the selector applies to.
5343 key!: string
5344
5345 // operator represents a key's relationship to a set of values.
5346 // Valid operators are In, NotIn, Exists and DoesNotExist.
5347 operator!: string
5348
5349 // values is an array of string values. If the operator is In or NotIn,
5350 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
5351 // the values array must be empty. This array is replaced during a strategic
5352 // merge patch.
5353 values?: [...string]
5354 }]
5355
5356 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
5357 // map is equivalent to an element of matchExpressions, whose key field is "key", the
5358 // operator is "In", and the values array contains only "value". The requirements are ANDed.
5359 matchLabels?: [string]: string
5360 }
5361 namespaces?: [...string]
5362 }]
5363
5364 // ForEach applies validate rules to a list of sub-elements by creating a
5365 // context for each entry in the list and looping over it to apply the
5366 // specified logic.
5367 foreach?: [...{
5368 // AnyPattern specifies list of validation patterns. At least one of the patterns
5369 // must be satisfied for the validation rule to succeed.
5370 anyPattern?: null | bool | number | string | [...] | {...}
5371
5372 // Context defines variables and data sources that can be used during rule execution.
5373 context?: [...matchN(1, [
5374 {configMap!: _}, {apiCall!: _}, {imageRegistry!: _}, {variable!: _}, {globalReference!: _},
5375 ]) & {
5376 // APICall is an HTTP request to the Kubernetes API server, or other JSON web service.
5377 // The data returned is stored in the context with the name for the context entry.
5378 apiCall?: {
5379 // The data object specifies the POST data sent to the server.
5380 // Only applicable when the method field is set to POST.
5381 data?: [...{
5382 // Key is a unique identifier for the data value
5383 key!: string
5384
5385 // Value is the data value
5386 value!: null | bool | number | string | [...] | {...}
5387 }]
5388
5389 // Default is an optional arbitrary JSON object that the context
5390 // value is set to, if the apiCall returns error.
5391 default?: null | bool | number | string | [...] | {...}
5392
5393 // JMESPath is an optional JSON Match Expression that can be used to
5394 // transform the JSON response returned from the server. For example
5395 // a JMESPath of "items | length(@)" applied to the API server response
5396 // for the URLPath "/apis/apps/v1/deployments" will return the total count
5397 // of deployments across all namespaces.
5398 jmesPath?: string
5399
5400 // Method is the HTTP request type (GET or POST). Defaults to GET.
5401 method?: "GET" | "POST"
5402
5403 // Service is an API call to a JSON web service.
5404 // This is used for non-Kubernetes API server calls.
5405 // It's mutually exclusive with the URLPath field.
5406 service?: {
5407 // CABundle is a PEM encoded CA bundle which will be used to validate
5408 // the server certificate.
5409 caBundle?: string
5410
5411 // Headers is a list of optional HTTP headers to be included in the request.
5412 headers?: [...{
5413 // Key is the header key
5414 key!: string
5415
5416 // Value is the header value
5417 value!: string
5418 }]
5419
5420 // URL is the JSON web service URL. A typical form is
5421 // `https://{service}.{namespace}:{port}/{path}`.
5422 url!: string
5423 }
5424
5425 // URLPath is the URL path to be used in the HTTP GET or POST request to the
5426 // Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
5427 // The format required is the same format used by the `kubectl get --raw` command.
5428 // See
5429 // https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls
5430 // for details.
5431 // It's mutually exclusive with the Service field.
5432 urlPath?: string
5433 }
5434
5435 // ConfigMap is the ConfigMap reference.
5436 configMap?: {
5437 // Name is the ConfigMap name.
5438 name!: string
5439
5440 // Namespace is the ConfigMap namespace.
5441 namespace?: string
5442 }
5443
5444 // GlobalContextEntryReference is a reference to a cached global context entry.
5445 globalReference?: {
5446 // JMESPath is an optional JSON Match Expression that can be used to
5447 // transform the JSON response returned from the server. For example
5448 // a JMESPath of "items | length(@)" applied to the API server response
5449 // for the URLPath "/apis/apps/v1/deployments" will return the total count
5450 // of deployments across all namespaces.
5451 jmesPath?: string
5452
5453 // Name of the global context entry
5454 name!: string
5455 }
5456
5457 // ImageRegistry defines requests to an OCI/Docker V2 registry to fetch image
5458 // details.
5459 imageRegistry?: {
5460 // ImageRegistryCredentials provides credentials that will be used for authentication with registry
5461 imageRegistryCredentials?: {
5462 // AllowInsecureRegistry allows insecure access to a registry.
5463 allowInsecureRegistry?: bool
5464
5465 // Providers specifies a list of OCI Registry names, whose authentication providers are provided.
5466 // It can be of one of these values: default,google,azure,amazon,github.
5467 providers?: [..."default" | "amazon" | "azure" | "google" | "github"]
5468
5469 // Secrets specifies a list of secrets that are provided for credentials.
5470 // Secrets can be specified as a name (Kyverno namespace) or namespace/name.
5471 // imagePullSecrets from the resource namespace are also used.
5472 secrets?: [...string]
5473 }
5474
5475 // JMESPath is an optional JSON Match Expression that can be used to
5476 // transform the ImageData struct returned as a result of processing
5477 // the image reference.
5478 jmesPath?: string
5479
5480 // Reference is image reference to a container image in the registry.
5481 // Example: ghcr.io/kyverno/kyverno:latest
5482 reference!: string
5483 }
5484
5485 // Name is the variable name.
5486 name!: string
5487
5488 // Variable defines an arbitrary JMESPath context variable that can be defined inline.
5489 variable?: {
5490 // Default is an optional arbitrary JSON object that the variable may take if the JMESPath
5491 // expression evaluates to nil
5492 default?: null | bool | number | string | [...] | {...}
5493
5494 // JMESPath is an optional JMESPath Expression that can be used to
5495 // transform the variable.
5496 jmesPath?: string
5497
5498 // Value is any arbitrary JSON object representable in YAML or JSON form.
5499 value?: null | bool | number | string | [...] | {...}
5500 }
5501 }]
5502
5503 // Deny defines conditions used to pass or fail a validation rule.
5504 deny?: {
5505 // Multiple conditions can be declared under an `any` or `all` statement. A direct list
5506 // of conditions (without `any` or `all` statements) is also supported for backwards compatibility
5507 // but will be deprecated in the next major release.
5508 // See: https://kyverno.io/docs/writing-policies/validate/#deny-rules
5509 conditions?: null | bool | number | string | [...] | {...}
5510 }
5511
5512 // ElementScope specifies whether to use the current list element as the scope
5513 // for validation. Defaults to "true" if not specified.
5514 // When set to "false", "request.object" is used as the validation scope within the foreach
5515 // block to allow referencing other elements in the subtree.
5516 elementScope?: bool
5517
5518 // Foreach declares a nested foreach iterator
5519 foreach?: null | bool | number | string | [...] | {...}
5520
5521 // List specifies a JMESPath expression that results in one or more elements
5522 // to which the validation logic is applied.
5523 list?: string
5524
5525 // Pattern specifies an overlay-style pattern used to check resources.
5526 pattern?: null | bool | number | string | [...] | {...}
5527
5528 // AnyAllConditions are used to determine if a policy rule should be applied by evaluating a
5529 // set of conditions. The declaration can contain nested `any` or `all` statements.
5530 // See: https://kyverno.io/docs/writing-policies/preconditions/
5531 preconditions?: {
5532 // AllConditions enable variable-based conditional rule execution. This is useful for
5533 // finer control of when an rule is applied. A condition can reference object data
5534 // using JMESPath notation.
5535 // Here, all of the conditions need to pass
5536 all?: [...{
5537 // Key is the context entry (using JMESPath) for conditional rule evaluation.
5538 key?: null | bool | number | string | [...] | {...}
5539
5540 // Message is an optional display message
5541 message?: string
5542
5543 // Operator is the conditional operation to perform. Valid operators are:
5544 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
5545 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
5546 // DurationLessThanOrEquals, DurationLessThan
5547 operator?: "Equals" |
5548 "NotEquals" |
5549 "In" |
5550 "AnyIn" |
5551 "AllIn" |
5552 "NotIn" |
5553 "AnyNotIn" |
5554 "AllNotIn" |
5555 "GreaterThanOrEquals" |
5556 "GreaterThan" |
5557 "LessThanOrEquals" |
5558 "LessThan" |
5559 "DurationGreaterThanOrEquals" |
5560 "DurationGreaterThan" |
5561 "DurationLessThanOrEquals" |
5562 "DurationLessThan"
5563
5564 // Value is the conditional value, or set of values. The values can be fixed set
5565 // or can be variables declared using JMESPath.
5566 value?: null | bool | number | string | [...] | {...}
5567 }]
5568
5569 // AnyConditions enable variable-based conditional rule execution. This is useful for
5570 // finer control of when an rule is applied. A condition can reference object data
5571 // using JMESPath notation.
5572 // Here, at least one of the conditions need to pass
5573 any?: [...{
5574 // Key is the context entry (using JMESPath) for conditional rule evaluation.
5575 key?: null | bool | number | string | [...] | {...}
5576
5577 // Message is an optional display message
5578 message?: string
5579
5580 // Operator is the conditional operation to perform. Valid operators are:
5581 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
5582 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
5583 // DurationLessThanOrEquals, DurationLessThan
5584 operator?: "Equals" |
5585 "NotEquals" |
5586 "In" |
5587 "AnyIn" |
5588 "AllIn" |
5589 "NotIn" |
5590 "AnyNotIn" |
5591 "AllNotIn" |
5592 "GreaterThanOrEquals" |
5593 "GreaterThan" |
5594 "LessThanOrEquals" |
5595 "LessThan" |
5596 "DurationGreaterThanOrEquals" |
5597 "DurationGreaterThan" |
5598 "DurationLessThanOrEquals" |
5599 "DurationLessThan"
5600
5601 // Value is the conditional value, or set of values. The values can be fixed set
5602 // or can be variables declared using JMESPath.
5603 value?: null | bool | number | string | [...] | {...}
5604 }]
5605 ...
5606 }
5607 }]
5608
5609 // Manifest specifies conditions for manifest verification
5610 manifests?: {
5611 // AnnotationDomain is custom domain of annotation for message and signature.
5612 // Default is "cosign.sigstore.dev".
5613 annotationDomain?: string
5614
5615 // Attestors specified the required attestors (i.e. authorities)
5616 attestors?: [...{
5617 // Count specifies the required number of entries that must match. If the count
5618 // is null, all entries must match
5619 // (a logical AND). If the count is 1, at least one entry must match (a logical
5620 // OR). If the count contains a
5621 // value N, then N must be less than or equal to the size of entries, and at
5622 // least N entries must match.
5623 count?: int & >=1
5624
5625 // Entries contains the available attestors. An attestor can be a static key,
5626 // attributes for keyless verification, or a nested attestor declaration.
5627 entries?: [...{
5628 // Annotations are used for image verification.
5629 // Every specified key-value pair must exist and match in the verified payload.
5630 // The payload may contain other key-value pairs.
5631 annotations?: [string]: string
5632
5633 // Attestor is a nested set of Attestor used to specify a more complex set of match authorities.
5634 attestor?: null | bool | number | string | [...] | {...}
5635
5636 // Certificates specifies one or more certificates.
5637 certificates?: {
5638 // Cert is an optional PEM-encoded public certificate.
5639 cert?: string
5640
5641 // CertChain is an optional PEM encoded set of certificates used to verify.
5642 certChain?: string
5643
5644 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
5645 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
5646 ctlog?: {
5647 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
5648 // to check for a certificate
5649 // timestamp. Default is false. Set to true if this was opted out during signing.
5650 ignoreSCT?: bool
5651
5652 // PubKey, if set, is used to validate SCTs against a custom source.
5653 pubkey?: string
5654
5655 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
5656 // RFC3161 timestamp authority. Must
5657 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
5658 // may contain the leaf TSA certificate if not present in the timestamurce.
5659 tsaCertChain?: string
5660 }
5661
5662 // Rekor provides configuration for the Rekor transparency log service. If an empty object
5663 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
5664 rekor?: {
5665 // IgnoreTlog skips transparency log verification.
5666 ignoreTlog?: bool
5667
5668 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
5669 // If set, this will be used to validate transparency log signatures from a custom Rekor.
5670 pubkey?: string
5671
5672 // URL is the address of the transparency log. Defaults to the public Rekor log
5673 // instance https://rekor.sigstore.dev.
5674 url?: string
5675 }
5676 }
5677
5678 // Keyless is a set of attribute used to verify a Sigstore keyless attestor.
5679 // See https://github.com/sigstore/cosign/blob/main/KEYLESS.md.
5680 keyless?: {
5681 // AdditionalExtensions are certificate-extensions used for keyless signing.
5682 additionalExtensions?: [string]: string
5683
5684 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
5685 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
5686 ctlog?: {
5687 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
5688 // to check for a certificate
5689 // timestamp. Default is false. Set to true if this was opted out during signing.
5690 ignoreSCT?: bool
5691
5692 // PubKey, if set, is used to validate SCTs against a custom source.
5693 pubkey?: string
5694
5695 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
5696 // RFC3161 timestamp authority. Must
5697 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
5698 // may contain the leaf TSA certificate if not present in the timestamurce.
5699 tsaCertChain?: string
5700 }
5701
5702 // Issuer is the certificate issuer used for keyless signing.
5703 issuer?: string
5704
5705 // IssuerRegExp is the regular expression to match certificate issuer used for keyless signing.
5706 issuerRegExp?: string
5707
5708 // Rekor provides configuration for the Rekor transparency log service. If an empty object
5709 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
5710 rekor?: {
5711 // IgnoreTlog skips transparency log verification.
5712 ignoreTlog?: bool
5713
5714 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
5715 // If set, this will be used to validate transparency log signatures from a custom Rekor.
5716 pubkey?: string
5717
5718 // URL is the address of the transparency log. Defaults to the public Rekor log
5719 // instance https://rekor.sigstore.dev.
5720 url?: string
5721 }
5722
5723 // Roots is an optional set of PEM encoded trusted root certificates.
5724 // If not provided, the system roots are used.
5725 roots?: string
5726
5727 // Subject is the verified identity used for keyless signing, for example the email address.
5728 subject?: string
5729
5730 // SubjectRegExp is the regular expression to match identity used for keyless
5731 // signing, for example the email address.
5732 subjectRegExp?: string
5733 }
5734
5735 // Keys specifies one or more public keys.
5736 keys?: {
5737 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
5738 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
5739 ctlog?: {
5740 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
5741 // to check for a certificate
5742 // timestamp. Default is false. Set to true if this was opted out during signing.
5743 ignoreSCT?: bool
5744
5745 // PubKey, if set, is used to validate SCTs against a custom source.
5746 pubkey?: string
5747
5748 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
5749 // RFC3161 timestamp authority. Must
5750 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
5751 // may contain the leaf TSA certificate if not present in the timestamurce.
5752 tsaCertChain?: string
5753 }
5754
5755 // KMS provides the URI to the public key stored in a Key Management System. See:
5756 // https://github.com/sigstore/cosign/blob/main/KMS.md
5757 kms?: string
5758
5759 // Keys is a set of X.509 public keys used to verify image signatures. The keys can be directly
5760 // specified or can be a variable reference to a key specified in a ConfigMap (see
5761 // https://kyverno.io/docs/writing-policies/variables/), or reference a standard Kubernetes Secret
5762 // elsewhere in the cluster by specifying it in the format "k8s://<namespace>/<secret_name>".
5763 // The named Secret must specify a key `cosign.pub` containing the public key used for
5764 // verification, (see https://github.com/sigstore/cosign/blob/main/KMS.md#kubernetes-secret).
5765 // When multiple keys are specified each key is processed as a separate staticKey entry
5766 // (.attestors[*].entries.keys) within the set of attestors and the count is
5767 // applied across the keys.
5768 publicKeys?: string
5769
5770 // Rekor provides configuration for the Rekor transparency log service. If an empty object
5771 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
5772 rekor?: {
5773 // IgnoreTlog skips transparency log verification.
5774 ignoreTlog?: bool
5775
5776 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
5777 // If set, this will be used to validate transparency log signatures from a custom Rekor.
5778 pubkey?: string
5779
5780 // URL is the address of the transparency log. Defaults to the public Rekor log
5781 // instance https://rekor.sigstore.dev.
5782 url?: string
5783 }
5784
5785 // Reference to a Secret resource that contains a public key
5786 secret?: {
5787 // Name of the secret. The provided secret must contain a key named cosign.pub.
5788 name!: string
5789
5790 // Namespace name where the Secret exists.
5791 namespace!: string
5792 }
5793
5794 // Deprecated. Use attestor.signatureAlgorithm instead.
5795 signatureAlgorithm?: string
5796 }
5797
5798 // Repository is an optional alternate OCI repository to use for signatures and
5799 // attestations that match this rule.
5800 // If specified Repository will override other OCI image repository locations for this Attestor.
5801 repository?: string
5802
5803 // Specify signature algorithm for public keys. Supported values are sha224,
5804 // sha256, sha384 and sha512.
5805 signatureAlgorithm?: string
5806 }]
5807 }]
5808
5809 // DryRun configuration
5810 dryRun?: {
5811 enable?: bool
5812 namespace?: string
5813 }
5814
5815 // Fields which will be ignored while comparing manifests.
5816 ignoreFields?: [...{
5817 fields?: [...string]
5818 objects?: [...{
5819 group?: string
5820 kind?: string
5821 name?: string
5822 namespace?: string
5823 version?: string
5824 }]
5825 }]
5826
5827 // Repository is an optional alternate OCI repository to use for resource bundle reference.
5828 // The repository can be overridden per Attestor or Attestation.
5829 repository?: string
5830 }
5831
5832 // Message specifies a custom message to be displayed on failure.
5833 message?: string
5834
5835 // Pattern specifies an overlay-style pattern used to check resources.
5836 pattern?: null | bool | number | string | [...] | {...}
5837
5838 // PodSecurity applies exemptions for Kubernetes Pod Security admission
5839 // by specifying exclusions for Pod Security Standards controls.
5840 podSecurity?: {
5841 // Exclude specifies the Pod Security Standard controls to be excluded.
5842 exclude?: [...{
5843 // ControlName specifies the name of the Pod Security Standard control.
5844 // See: https://kubernetes.io/docs/concepts/security/pod-security-standards/
5845 controlName!: "HostProcess" |
5846 "Host Namespaces" |
5847 "Privileged Containers" |
5848 "Capabilities" |
5849 "HostPath Volumes" |
5850 "Host Ports" |
5851 "AppArmor" |
5852 "SELinux" |
5853 "/proc Mount Type" |
5854 "Seccomp" |
5855 "Sysctls" |
5856 "Volume Types" |
5857 "Privilege Escalation" |
5858 "Running as Non-root" |
5859 "Running as Non-root user"
5860
5861 // Images selects matching containers and applies the container level PSS.
5862 // Each image is the image name consisting of the registry address, repository, image, and tag.
5863 // Empty list matches no containers, PSS checks are applied at the pod level only.
5864 // Wildcards ('*' and '?') are allowed. See: https://kubernetes.io/docs/concepts/containers/images.
5865 images?: [...string]
5866
5867 // RestrictedField selects the field for the given Pod Security Standard control.
5868 // When not set, all restricted fields for the control are selected.
5869 restrictedField?: string
5870
5871 // Values defines the allowed values that can be excluded.
5872 values?: [...string]
5873 }]
5874
5875 // Level defines the Pod Security Standard level to be applied to workloads.
5876 // Allowed values are privileged, baseline, and restricted.
5877 level?: "privileged" | "baseline" | "restricted"
5878
5879 // Version defines the Pod Security Standard versions that Kubernetes supports.
5880 // Allowed values are v1.19, v1.20, v1.21, v1.22, v1.23, v1.24, v1.25, v1.26,
5881 // v1.27, v1.28, v1.29, v1.30, v1.31, v1.32, latest. Defaults to latest.
5882 version?: "v1.19" |
5883 "v1.20" |
5884 "v1.21" |
5885 "v1.22" |
5886 "v1.23" |
5887 "v1.24" |
5888 "v1.25" |
5889 "v1.26" |
5890 "v1.27" |
5891 "v1.28" |
5892 "v1.29" |
5893 "v1.30" |
5894 "v1.31" |
5895 "v1.32" |
5896 "latest"
5897 }
5898 }
5899
5900 // VerifyImages is used to verify image signatures and mutate them to add a digest
5901 verifyImages?: [...{
5902 // Deprecated.
5903 additionalExtensions?: [string]: string
5904
5905 // Deprecated. Use annotations per Attestor instead.
5906 annotations?: [string]: string
5907
5908 // Attestations are optional checks for signed in-toto Statements used to verify the image.
5909 // See https://github.com/in-toto/attestation. Kyverno fetches signed attestations from the
5910 // OCI registry and decodes them into a list of Statement declarations.
5911 attestations?: [...{
5912 // Attestors specify the required attestors (i.e. authorities).
5913 attestors?: [...{
5914 // Count specifies the required number of entries that must match. If the count
5915 // is null, all entries must match
5916 // (a logical AND). If the count is 1, at least one entry must match (a logical
5917 // OR). If the count contains a
5918 // value N, then N must be less than or equal to the size of entries, and at
5919 // least N entries must match.
5920 count?: int & >=1
5921
5922 // Entries contains the available attestors. An attestor can be a static key,
5923 // attributes for keyless verification, or a nested attestor declaration.
5924 entries?: [...{
5925 // Annotations are used for image verification.
5926 // Every specified key-value pair must exist and match in the verified payload.
5927 // The payload may contain other key-value pairs.
5928 annotations?: [string]: string
5929
5930 // Attestor is a nested set of Attestor used to specify a more complex set of match authorities.
5931 attestor?: null | bool | number | string | [...] | {...}
5932
5933 // Certificates specifies one or more certificates.
5934 certificates?: {
5935 // Cert is an optional PEM-encoded public certificate.
5936 cert?: string
5937
5938 // CertChain is an optional PEM encoded set of certificates used to verify.
5939 certChain?: string
5940
5941 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
5942 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
5943 ctlog?: {
5944 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
5945 // to check for a certificate
5946 // timestamp. Default is false. Set to true if this was opted out during signing.
5947 ignoreSCT?: bool
5948
5949 // PubKey, if set, is used to validate SCTs against a custom source.
5950 pubkey?: string
5951
5952 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
5953 // RFC3161 timestamp authority. Must
5954 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
5955 // may contain the leaf TSA certificate if not present in the timestamurce.
5956 tsaCertChain?: string
5957 }
5958
5959 // Rekor provides configuration for the Rekor transparency log service. If an empty object
5960 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
5961 rekor?: {
5962 // IgnoreTlog skips transparency log verification.
5963 ignoreTlog?: bool
5964
5965 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
5966 // If set, this will be used to validate transparency log signatures from a custom Rekor.
5967 pubkey?: string
5968
5969 // URL is the address of the transparency log. Defaults to the public Rekor log
5970 // instance https://rekor.sigstore.dev.
5971 url?: string
5972 }
5973 }
5974
5975 // Keyless is a set of attribute used to verify a Sigstore keyless attestor.
5976 // See https://github.com/sigstore/cosign/blob/main/KEYLESS.md.
5977 keyless?: {
5978 // AdditionalExtensions are certificate-extensions used for keyless signing.
5979 additionalExtensions?: [string]: string
5980
5981 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
5982 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
5983 ctlog?: {
5984 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
5985 // to check for a certificate
5986 // timestamp. Default is false. Set to true if this was opted out during signing.
5987 ignoreSCT?: bool
5988
5989 // PubKey, if set, is used to validate SCTs against a custom source.
5990 pubkey?: string
5991
5992 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
5993 // RFC3161 timestamp authority. Must
5994 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
5995 // may contain the leaf TSA certificate if not present in the timestamurce.
5996 tsaCertChain?: string
5997 }
5998
5999 // Issuer is the certificate issuer used for keyless signing.
6000 issuer?: string
6001
6002 // IssuerRegExp is the regular expression to match certificate issuer used for keyless signing.
6003 issuerRegExp?: string
6004
6005 // Rekor provides configuration for the Rekor transparency log service. If an empty object
6006 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
6007 rekor?: {
6008 // IgnoreTlog skips transparency log verification.
6009 ignoreTlog?: bool
6010
6011 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
6012 // If set, this will be used to validate transparency log signatures from a custom Rekor.
6013 pubkey?: string
6014
6015 // URL is the address of the transparency log. Defaults to the public Rekor log
6016 // instance https://rekor.sigstore.dev.
6017 url?: string
6018 }
6019
6020 // Roots is an optional set of PEM encoded trusted root certificates.
6021 // If not provided, the system roots are used.
6022 roots?: string
6023
6024 // Subject is the verified identity used for keyless signing, for example the email address.
6025 subject?: string
6026
6027 // SubjectRegExp is the regular expression to match identity used for keyless
6028 // signing, for example the email address.
6029 subjectRegExp?: string
6030 }
6031
6032 // Keys specifies one or more public keys.
6033 keys?: {
6034 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
6035 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
6036 ctlog?: {
6037 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
6038 // to check for a certificate
6039 // timestamp. Default is false. Set to true if this was opted out during signing.
6040 ignoreSCT?: bool
6041
6042 // PubKey, if set, is used to validate SCTs against a custom source.
6043 pubkey?: string
6044
6045 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
6046 // RFC3161 timestamp authority. Must
6047 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
6048 // may contain the leaf TSA certificate if not present in the timestamurce.
6049 tsaCertChain?: string
6050 }
6051
6052 // KMS provides the URI to the public key stored in a Key Management System. See:
6053 // https://github.com/sigstore/cosign/blob/main/KMS.md
6054 kms?: string
6055
6056 // Keys is a set of X.509 public keys used to verify image signatures. The keys can be directly
6057 // specified or can be a variable reference to a key specified in a ConfigMap (see
6058 // https://kyverno.io/docs/writing-policies/variables/), or reference a standard Kubernetes Secret
6059 // elsewhere in the cluster by specifying it in the format "k8s://<namespace>/<secret_name>".
6060 // The named Secret must specify a key `cosign.pub` containing the public key used for
6061 // verification, (see https://github.com/sigstore/cosign/blob/main/KMS.md#kubernetes-secret).
6062 // When multiple keys are specified each key is processed as a separate staticKey entry
6063 // (.attestors[*].entries.keys) within the set of attestors and the count is
6064 // applied across the keys.
6065 publicKeys?: string
6066
6067 // Rekor provides configuration for the Rekor transparency log service. If an empty object
6068 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
6069 rekor?: {
6070 // IgnoreTlog skips transparency log verification.
6071 ignoreTlog?: bool
6072
6073 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
6074 // If set, this will be used to validate transparency log signatures from a custom Rekor.
6075 pubkey?: string
6076
6077 // URL is the address of the transparency log. Defaults to the public Rekor log
6078 // instance https://rekor.sigstore.dev.
6079 url?: string
6080 }
6081
6082 // Reference to a Secret resource that contains a public key
6083 secret?: {
6084 // Name of the secret. The provided secret must contain a key named cosign.pub.
6085 name!: string
6086
6087 // Namespace name where the Secret exists.
6088 namespace!: string
6089 }
6090
6091 // Deprecated. Use attestor.signatureAlgorithm instead.
6092 signatureAlgorithm?: string
6093 }
6094
6095 // Repository is an optional alternate OCI repository to use for signatures and
6096 // attestations that match this rule.
6097 // If specified Repository will override other OCI image repository locations for this Attestor.
6098 repository?: string
6099
6100 // Specify signature algorithm for public keys. Supported values are sha224,
6101 // sha256, sha384 and sha512.
6102 signatureAlgorithm?: string
6103 }]
6104 }]
6105
6106 // Conditions are used to verify attributes within a Predicate. If no Conditions are specified
6107 // the attestation check is satisfied as long there are predicates that match the predicate type.
6108 conditions?: [...{
6109 // AllConditions enable variable-based conditional rule execution. This is useful for
6110 // finer control of when an rule is applied. A condition can reference object data
6111 // using JMESPath notation.
6112 // Here, all of the conditions need to pass
6113 all?: [...{
6114 // Key is the context entry (using JMESPath) for conditional rule evaluation.
6115 key?: null | bool | number | string | [...] | {...}
6116
6117 // Message is an optional display message
6118 message?: string
6119
6120 // Operator is the conditional operation to perform. Valid operators are:
6121 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
6122 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
6123 // DurationLessThanOrEquals, DurationLessThan
6124 operator?: "Equals" |
6125 "NotEquals" |
6126 "In" |
6127 "AnyIn" |
6128 "AllIn" |
6129 "NotIn" |
6130 "AnyNotIn" |
6131 "AllNotIn" |
6132 "GreaterThanOrEquals" |
6133 "GreaterThan" |
6134 "LessThanOrEquals" |
6135 "LessThan" |
6136 "DurationGreaterThanOrEquals" |
6137 "DurationGreaterThan" |
6138 "DurationLessThanOrEquals" |
6139 "DurationLessThan"
6140
6141 // Value is the conditional value, or set of values. The values can be fixed set
6142 // or can be variables declared using JMESPath.
6143 value?: null | bool | number | string | [...] | {...}
6144 }]
6145
6146 // AnyConditions enable variable-based conditional rule execution. This is useful for
6147 // finer control of when an rule is applied. A condition can reference object data
6148 // using JMESPath notation.
6149 // Here, at least one of the conditions need to pass
6150 any?: [...{
6151 // Key is the context entry (using JMESPath) for conditional rule evaluation.
6152 key?: null | bool | number | string | [...] | {...}
6153
6154 // Message is an optional display message
6155 message?: string
6156
6157 // Operator is the conditional operation to perform. Valid operators are:
6158 // Equals, NotEquals, In, AnyIn, AllIn, NotIn, AnyNotIn, AllNotIn, GreaterThanOrEquals,
6159 // GreaterThan, LessThanOrEquals, LessThan, DurationGreaterThanOrEquals, DurationGreaterThan,
6160 // DurationLessThanOrEquals, DurationLessThan
6161 operator?: "Equals" |
6162 "NotEquals" |
6163 "In" |
6164 "AnyIn" |
6165 "AllIn" |
6166 "NotIn" |
6167 "AnyNotIn" |
6168 "AllNotIn" |
6169 "GreaterThanOrEquals" |
6170 "GreaterThan" |
6171 "LessThanOrEquals" |
6172 "LessThan" |
6173 "DurationGreaterThanOrEquals" |
6174 "DurationGreaterThan" |
6175 "DurationLessThanOrEquals" |
6176 "DurationLessThan"
6177
6178 // Value is the conditional value, or set of values. The values can be fixed set
6179 // or can be variables declared using JMESPath.
6180 value?: null | bool | number | string | [...] | {...}
6181 }]
6182 }]
6183
6184 // Name is the variable name.
6185 name?: string
6186
6187 // Deprecated in favour of 'Type', to be removed soon
6188 predicateType?: string
6189
6190 // Type defines the type of attestation contained within the Statement.
6191 type?: string
6192 }]
6193
6194 // Attestors specified the required attestors (i.e. authorities)
6195 attestors?: [...{
6196 // Count specifies the required number of entries that must match. If the count
6197 // is null, all entries must match
6198 // (a logical AND). If the count is 1, at least one entry must match (a logical
6199 // OR). If the count contains a
6200 // value N, then N must be less than or equal to the size of entries, and at
6201 // least N entries must match.
6202 count?: int & >=1
6203
6204 // Entries contains the available attestors. An attestor can be a static key,
6205 // attributes for keyless verification, or a nested attestor declaration.
6206 entries?: [...{
6207 // Annotations are used for image verification.
6208 // Every specified key-value pair must exist and match in the verified payload.
6209 // The payload may contain other key-value pairs.
6210 annotations?: [string]: string
6211
6212 // Attestor is a nested set of Attestor used to specify a more complex set of match authorities.
6213 attestor?: null | bool | number | string | [...] | {...}
6214
6215 // Certificates specifies one or more certificates.
6216 certificates?: {
6217 // Cert is an optional PEM-encoded public certificate.
6218 cert?: string
6219
6220 // CertChain is an optional PEM encoded set of certificates used to verify.
6221 certChain?: string
6222
6223 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
6224 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
6225 ctlog?: {
6226 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
6227 // to check for a certificate
6228 // timestamp. Default is false. Set to true if this was opted out during signing.
6229 ignoreSCT?: bool
6230
6231 // PubKey, if set, is used to validate SCTs against a custom source.
6232 pubkey?: string
6233
6234 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
6235 // RFC3161 timestamp authority. Must
6236 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
6237 // may contain the leaf TSA certificate if not present in the timestamurce.
6238 tsaCertChain?: string
6239 }
6240
6241 // Rekor provides configuration for the Rekor transparency log service. If an empty object
6242 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
6243 rekor?: {
6244 // IgnoreTlog skips transparency log verification.
6245 ignoreTlog?: bool
6246
6247 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
6248 // If set, this will be used to validate transparency log signatures from a custom Rekor.
6249 pubkey?: string
6250
6251 // URL is the address of the transparency log. Defaults to the public Rekor log
6252 // instance https://rekor.sigstore.dev.
6253 url?: string
6254 }
6255 }
6256
6257 // Keyless is a set of attribute used to verify a Sigstore keyless attestor.
6258 // See https://github.com/sigstore/cosign/blob/main/KEYLESS.md.
6259 keyless?: {
6260 // AdditionalExtensions are certificate-extensions used for keyless signing.
6261 additionalExtensions?: [string]: string
6262
6263 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
6264 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
6265 ctlog?: {
6266 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
6267 // to check for a certificate
6268 // timestamp. Default is false. Set to true if this was opted out during signing.
6269 ignoreSCT?: bool
6270
6271 // PubKey, if set, is used to validate SCTs against a custom source.
6272 pubkey?: string
6273
6274 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
6275 // RFC3161 timestamp authority. Must
6276 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
6277 // may contain the leaf TSA certificate if not present in the timestamurce.
6278 tsaCertChain?: string
6279 }
6280
6281 // Issuer is the certificate issuer used for keyless signing.
6282 issuer?: string
6283
6284 // IssuerRegExp is the regular expression to match certificate issuer used for keyless signing.
6285 issuerRegExp?: string
6286
6287 // Rekor provides configuration for the Rekor transparency log service. If an empty object
6288 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
6289 rekor?: {
6290 // IgnoreTlog skips transparency log verification.
6291 ignoreTlog?: bool
6292
6293 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
6294 // If set, this will be used to validate transparency log signatures from a custom Rekor.
6295 pubkey?: string
6296
6297 // URL is the address of the transparency log. Defaults to the public Rekor log
6298 // instance https://rekor.sigstore.dev.
6299 url?: string
6300 }
6301
6302 // Roots is an optional set of PEM encoded trusted root certificates.
6303 // If not provided, the system roots are used.
6304 roots?: string
6305
6306 // Subject is the verified identity used for keyless signing, for example the email address.
6307 subject?: string
6308
6309 // SubjectRegExp is the regular expression to match identity used for keyless
6310 // signing, for example the email address.
6311 subjectRegExp?: string
6312 }
6313
6314 // Keys specifies one or more public keys.
6315 keys?: {
6316 // CTLog (certificate timestamp log) provides a configuration for validation of Signed Certificate
6317 // Timestamps (SCTs). If the value is unset, the default behavior by Cosign is used.
6318 ctlog?: {
6319 // IgnoreSCT defines whether to use the Signed Certificate Timestamp (SCT) log
6320 // to check for a certificate
6321 // timestamp. Default is false. Set to true if this was opted out during signing.
6322 ignoreSCT?: bool
6323
6324 // PubKey, if set, is used to validate SCTs against a custom source.
6325 pubkey?: string
6326
6327 // TSACertChain, if set, is the PEM-encoded certificate chain file for the
6328 // RFC3161 timestamp authority. Must
6329 // contain the root CA certificate. Optionally may contain intermediate CA certificates, and
6330 // may contain the leaf TSA certificate if not present in the timestamurce.
6331 tsaCertChain?: string
6332 }
6333
6334 // KMS provides the URI to the public key stored in a Key Management System. See:
6335 // https://github.com/sigstore/cosign/blob/main/KMS.md
6336 kms?: string
6337
6338 // Keys is a set of X.509 public keys used to verify image signatures. The keys can be directly
6339 // specified or can be a variable reference to a key specified in a ConfigMap (see
6340 // https://kyverno.io/docs/writing-policies/variables/), or reference a standard Kubernetes Secret
6341 // elsewhere in the cluster by specifying it in the format "k8s://<namespace>/<secret_name>".
6342 // The named Secret must specify a key `cosign.pub` containing the public key used for
6343 // verification, (see https://github.com/sigstore/cosign/blob/main/KMS.md#kubernetes-secret).
6344 // When multiple keys are specified each key is processed as a separate staticKey entry
6345 // (.attestors[*].entries.keys) within the set of attestors and the count is
6346 // applied across the keys.
6347 publicKeys?: string
6348
6349 // Rekor provides configuration for the Rekor transparency log service. If an empty object
6350 // is provided the public instance of Rekor (https://rekor.sigstore.dev) is used.
6351 rekor?: {
6352 // IgnoreTlog skips transparency log verification.
6353 ignoreTlog?: bool
6354
6355 // RekorPubKey is an optional PEM-encoded public key to use for a custom Rekor.
6356 // If set, this will be used to validate transparency log signatures from a custom Rekor.
6357 pubkey?: string
6358
6359 // URL is the address of the transparency log. Defaults to the public Rekor log
6360 // instance https://rekor.sigstore.dev.
6361 url?: string
6362 }
6363
6364 // Reference to a Secret resource that contains a public key
6365 secret?: {
6366 // Name of the secret. The provided secret must contain a key named cosign.pub.
6367 name!: string
6368
6369 // Namespace name where the Secret exists.
6370 namespace!: string
6371 }
6372
6373 // Deprecated. Use attestor.signatureAlgorithm instead.
6374 signatureAlgorithm?: string
6375 }
6376
6377 // Repository is an optional alternate OCI repository to use for signatures and
6378 // attestations that match this rule.
6379 // If specified Repository will override other OCI image repository locations for this Attestor.
6380 repository?: string
6381
6382 // Specify signature algorithm for public keys. Supported values are sha224,
6383 // sha256, sha384 and sha512.
6384 signatureAlgorithm?: string
6385 }]
6386 }]
6387
6388 // CosignOCI11 enables the experimental OCI 1.1 behaviour in cosign image verification.
6389 // Defaults to false.
6390 cosignOCI11?: bool
6391
6392 // Allowed values are Audit or Enforce.
6393 failureAction?: "Audit" | "Enforce"
6394
6395 // Deprecated. Use ImageReferences instead.
6396 image?: string
6397
6398 // ImageReferences is a list of matching image reference patterns. At least one pattern in the
6399 // list must match the image for the rule to apply. Each image reference consists of a registry
6400 // address (defaults to docker.io), repository, image, and tag (defaults to latest).
6401 // Wildcards ('*' and '?') are allowed. See: https://kubernetes.io/docs/concepts/containers/images.
6402 imageReferences?: [...string]
6403
6404 // ImageRegistryCredentials provides credentials that will be used for authentication with registry.
6405 imageRegistryCredentials?: {
6406 // AllowInsecureRegistry allows insecure access to a registry.
6407 allowInsecureRegistry?: bool
6408
6409 // Providers specifies a list of OCI Registry names, whose authentication providers are provided.
6410 // It can be of one of these values: default,google,azure,amazon,github.
6411 providers?: [..."default" | "amazon" | "azure" | "google" | "github"]
6412
6413 // Secrets specifies a list of secrets that are provided for credentials.
6414 // Secrets can be specified as a name (Kyverno namespace) or namespace/name.
6415 // imagePullSecrets from the resource namespace are also used.
6416 secrets?: [...string]
6417 }
6418
6419 // Deprecated. Use KeylessAttestor instead.
6420 issuer?: string
6421
6422 // Deprecated. Use StaticKeyAttestor instead.
6423 key?: string
6424
6425 // MutateDigest enables replacement of image tags with digests.
6426 // Defaults to true.
6427 mutateDigest?: bool
6428
6429 // Repository is an optional alternate OCI repository to use for image
6430 // signatures and attestations that match this rule.
6431 // If specified Repository will override the default OCI image repository
6432 // configured for the installation.
6433 // The repository can also be overridden per Attestor or Attestation.
6434 repository?: string
6435
6436 // Required validates that images are verified i.e. have matched passed a
6437 // signature or attestation check.
6438 required?: bool
6439
6440 // Deprecated. Use KeylessAttestor instead.
6441 roots?: string
6442
6443 // SkipImageReferences is a list of matching image reference patterns that should be skipped.
6444 // At least one pattern in the list must match the image for the rule to be
6445 // skipped. Each image reference
6446 // consists of a registry address (defaults to docker.io), repository, image,
6447 // and tag (defaults to latest).
6448 // Wildcards ('*' and '?') are allowed. See: https://kubernetes.io/docs/concepts/containers/images.
6449 skipImageReferences?: [...string]
6450
6451 // Deprecated. Use KeylessAttestor instead.
6452 subject?: string
6453
6454 // Type specifies the method of signature validation. The allowed options
6455 // are Cosign, Sigstore Bundle and Notary. By default Cosign is used if a type is not specified.
6456 type?: "Cosign" | "SigstoreBundle" | "Notary"
6457
6458 // UseCache enables caching of image verify responses for this rule.
6459 useCache?: bool
6460
6461 // Validation checks conditions across multiple image
6462 // verification attestations or context entries
6463 validate?: {
6464 // Deny defines conditions used to pass or fail a validation rule.
6465 deny?: {
6466 // Multiple conditions can be declared under an `any` or `all` statement. A direct list
6467 // of conditions (without `any` or `all` statements) is also supported for backwards compatibility
6468 // but will be deprecated in the next major release.
6469 // See: https://kyverno.io/docs/writing-policies/validate/#deny-rules
6470 conditions?: null | bool | number | string | [...] | {...}
6471 }
6472
6473 // Message specifies a custom message to be displayed on failure.
6474 message?: string
6475 }
6476
6477 // VerifyDigest validates that images have a digest.
6478 verifyDigest?: bool
6479 }]
6480 }]
6481 }
6482 conditions?: [...{
6483 // lastTransitionTime is the last time the condition transitioned from one status to another.
6484 // This should be when the underlying condition changed. If that is not known,
6485 // then using the time when the API field changed is acceptable.
6486 lastTransitionTime!: time.Time
6487
6488 // message is a human readable message indicating details about the transition.
6489 // This may be an empty string.
6490 message!: strings.MaxRunes(
6491 32768,
6492 )
6493
6494 // observedGeneration represents the .metadata.generation that the condition was set based upon.
6495 // For instance, if .metadata.generation is currently 12, but the
6496 // .status.conditions[x].observedGeneration is 9, the condition is out of date
6497 // with respect to the current state of the instance.
6498 observedGeneration?: int64 & int & >=0
6499
6500 // reason contains a programmatic identifier indicating the reason for the
6501 // condition's last transition.
6502 // Producers of specific condition types may define expected values and meanings for this field,
6503 // and whether the values are considered a guaranteed API.
6504 // The value should be a CamelCase string.
6505 // This field may not be empty.
6506 reason!: strings.MaxRunes(
6507 1024,
6508 ) &
6509 strings.MinRunes(
6510 1,
6511 ) &
6512 =~"^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$"
6513
6514 // status of the condition, one of True, False, Unknown.
6515 status!: "True" | "False" | "Unknown"
6516
6517 // type of condition in CamelCase or in foo.example.com/CamelCase.
6518 type!: strings.MaxRunes(
6519 316,
6520 ) &
6521 =~"^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$"
6522 }]
6523
6524 // Deprecated in favor of Conditions
6525 ready?: bool
6526
6527 // RuleCountStatus contains four variables which describes counts for
6528 // validate, generate, mutate and verify images rules
6529 rulecount?: {
6530 // Count for generate rules in policy
6531 generate!: int
6532
6533 // Count for mutate rules in policy
6534 mutate!: int
6535
6536 // Count for validate rules in policy
6537 validate!: int
6538
6539 // Count for verify image rules in policy
6540 verifyimages!: int
6541 }
6542
6543 // ValidatingAdmissionPolicy contains status information
6544 validatingadmissionpolicy?: {
6545 // Generated indicates whether a validating admission policy is generated from the policy or not
6546 generated!: bool
6547
6548 // Message is a human readable message indicating details about the generation
6549 // of validating admission policy
6550 // It is an empty string when validating admission policy is successfully generated.
6551 message!: string
6552 }
6553 }
6554
6555 _embeddedResource: {
6556 apiVersion!: string
6557 kind!: string
6558 metadata?: {...}
6559 }
6560 apiVersion: "kyverno.io/v1"
6561 kind: "Policy"
6562 metadata!: {
6563 name!: string
6564 namespace!: string
6565 labels?: [string]: string
6566 annotations?: [string]: string
6567 ...
6568 }
6569}