You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- `deny`: Validation failures result in a denied request. (default beahvior if
1042
-
field is unset)
1043
-
- `warn`: Validation failures are reported as warnings to the client. (xref: [Admisssion Webhook Warnings](https://kubernetes.io/blog/2020/09/03/warnings/#admission-webhooks))
1044
-
- `audit`: Validation failures are published as audit events (see below Audit
1041
+
- `Deny`: Validation failures result in a denied request.
1042
+
- `Warn`: Validation failures are reported as warnings to the client. (xref: [Admisssion Webhook Warnings](https://kubernetes.io/blog/2020/09/03/warnings/#admission-webhooks))
1043
+
- `Audit`: Validation failures are published as audit events (see below Audit
1045
1044
Annotations section for details).
1046
-
- `log`: The apiserver handling the admission request logs the validation failure.
1045
+
- `Log`: The apiserver handling the admission request logs the validation failure.
1046
+
1047
+
If, in the future, `ValidatingAdmissionPolicy` also introduces enforcement
1048
+
action fields, this `validationActions` field on
1049
+
`ValidatingAdmissionPolicyBinding`will specify the "maximum" enforcement (at
1050
+
most the enforcement will be what `validationActions` specifies).
1047
1051
1048
1052
Systems that need to aggregate validation failures may implement an [audit
1049
1053
webhook
@@ -1053,7 +1057,7 @@ below "Audit Events" for details.
1053
1057
For singleton policies, the `validationActions` field will be set on the policy definition.
1054
1058
1055
1059
Metrics will include validation action so that cluster administrators can monitor the
1056
-
validation failures of a binding before setting `validationActions` to `deny`.
1060
+
validation failures of a binding before setting `validationActions` to `Deny`.
1057
1061
1058
1062
This enables the following use cases:
1059
1063
@@ -1066,7 +1070,7 @@ This enables the following use cases:
1066
1070
knowing all the details of the policies. During rollout the cluster admin
1067
1071
needs a state where the policies being rolled out cannot result in admission
1068
1072
rejection. With the enforcement field on bindings, cluster admins can decide
1069
-
which initial actions to enable and then add actions until `deny` is enabled.
1073
+
which initial actions to enable and then add actions until `Deny` is enabled.
1070
1074
The cluster admin may monitoring metrics, warnings and audit events along the
1071
1075
way.
1072
1076
- A policy framework needs different enforcement actions at different
@@ -1103,9 +1107,12 @@ spec:
1103
1107
- expression: <expression>
1104
1108
auditAnnotations:
1105
1109
- key: "my-audit-key"
1106
-
valueExpression: <expression that evaluates to a string>
1110
+
valueExpression: <expression that evaluates to a string (and is recorded) or null (and is not recorded)>
1107
1111
```
1108
1112
1113
+
`auditAnnotations`are independent of `validations`. A `ValidatingAdmissionPolicy`
1114
+
may contain only `validations`, only `auditAnnotations` or both.
1115
+
1109
1116
The published annotation key will be of the form `<ValidatingPolicyDefinition
1110
1117
name>/<auditAnnotation key>` and will be validated as a
@@ -1132,7 +1139,7 @@ for the audit event under the key `validation_failures`. E.g.:
1132
1139
"kind": "Event",
1133
1140
"apiVersion": "audit.k8s.io/v1",
1134
1141
"annotations": {
1135
-
"mypolicy.mygroup.example.com/validation_failure": "{\"expression\": 1, \"message\": \"x must be greater than y\", \"enforcement\": \"deny\", \"binding\": \"mybinding.mygroup.example.com\"}"
1142
+
"mypolicy.mygroup.example.com/validation_failure": "{\"expression\": 1, \"message\": \"x must be greater than y\", \"enforcement\": \"Deny\", \"binding\": \"mybinding.mygroup.example.com\"}"
0 commit comments