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
Copy file name to clipboardExpand all lines: keps/sig-api-machinery/3488-cel-admission-control/README.md
+17-14Lines changed: 17 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1042,19 +1042,19 @@ The enum options will be:
1042
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
1043
- `Audit`: Validation failures are published as audit events (see below Audit
1044
1044
Annotations section for details).
1045
-
- `Log`: The apiserver handling the admission request logs the validation failure.
1046
1045
1047
1046
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
+
action fields, this effective enforcement will be the set intersection of the
1048
+
the policy enforcement actions and the binding enforcement actions.
1051
1049
1052
1050
Systems that need to aggregate validation failures may implement an [audit
1053
1051
webhook
1054
1052
backend](https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/#webhook-backend). See
1055
1053
below "Audit Events" for details.
1056
1054
1057
-
For singleton policies, the `validationActions` field will be set on the policy definition.
1055
+
For singleton policies, since there is no separate binding resource, the
1056
+
`validationActions`field will be set on the policy definition in the same way
1057
+
that other binding fields.
1058
1058
1059
1059
Metrics will include validation action so that cluster administrators can monitor the
1060
1060
validation failures of a binding before setting `validationActions` to `Deny`.
@@ -1086,10 +1086,12 @@ Future work:
1086
1086
ValidatingAdmissionPolicy authors to declare a expression as non-enforcing
1087
1087
regardless of `validationActions`.
1088
1088
1089
-
- ValidatingAdmissionPolicy resources, might, in the future, offer per-expression
1090
-
enforcement actions (instead of a separate `warnings` field) and combine these
1091
-
enforcement actions with the ValidatingAdmissionPolicyBinding enforcement action
1092
-
to determine the effective enforcement.
1089
+
- ValidatingAdmissionPolicy resources, might, in the future, offer
1090
+
per-expression enforcement actions (instead of a separate `warnings` field)
1091
+
and combine these enforcement actions with the
1092
+
ValidatingAdmissionPolicyBinding enforcement action to determine the effective
1093
+
enforcement. This would be designed to simplify the workflow required to add
1094
+
or update expression on an existing ValidatingAdmissionPolicy.
1093
1095
1094
1096
#### Audit Annotations
1095
1097
@@ -1129,17 +1131,18 @@ types will be supported.
1129
1131
1130
1132
All audit event keys are prefixed by `<ValidatingPolicyDefinition name>/`.
1131
1133
1132
-
At Metadata audit level or higher, when a validating admission binding fails any
1133
-
validation expression, details are included in the audit annotations
1134
-
for the audit event under the key `validation_failures`. E.g.:
1134
+
At Metadata audit level or higher, when a validating admission binding fails,
1135
+
and the binding's `validationActions` includes `Audit`, any validation
1136
+
expression, details are included in the audit annotations for the audit event
1137
+
under the key `validation_failures`. E.g.:
1135
1138
1136
1139
```yaml
1137
1140
# the audit event recorded
1138
1141
{
1139
1142
"kind": "Event",
1140
1143
"apiVersion": "audit.k8s.io/v1",
1141
1144
"annotations": {
1142
-
"mypolicy.mygroup.example.com/validation_failure": "{\"expression\": 1, \"message\": \"x must be greater than y\", \"enforcement\": \"Deny\", \"binding\": \"mybinding.mygroup.example.com\"}"
1145
+
"ValidatingAdmissionPolicy/mypolicy.mygroup.example.com/validation_failure": "{\"expression\": 1, \"message\": \"x must be greater than y\", \"enforcement\": \"Deny\", \"binding\": \"mybinding.mygroup.example.com\"}"
1143
1146
# other annotations
1144
1147
...
1145
1148
}
@@ -1157,7 +1160,7 @@ are included with the key provided. E.g.:
1157
1160
"kind": "Event",
1158
1161
"apiVersion": "audit.k8s.io/v1",
1159
1162
"annotations": {
1160
-
"mypolicy.mygroup.example.com/myauditkey": "my audit value"
1163
+
"ValidatingAdmissionPolicy/mypolicy.mygroup.example.com/myauditkey": "my audit value"
0 commit comments