Skip to content

Commit 49a31f0

Browse files
committed
Apply feedback
1 parent 87615fc commit 49a31f0

File tree

1 file changed

+17
-14
lines changed
  • keps/sig-api-machinery/3488-cel-admission-control

1 file changed

+17
-14
lines changed

keps/sig-api-machinery/3488-cel-admission-control/README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,19 +1042,19 @@ The enum options will be:
10421042
- `Warn`: Validation failures are reported as warnings to the client. (xref: [Admisssion Webhook Warnings](https://kubernetes.io/blog/2020/09/03/warnings/#admission-webhooks))
10431043
- `Audit`: Validation failures are published as audit events (see below Audit
10441044
Annotations section for details).
1045-
- `Log`: The apiserver handling the admission request logs the validation failure.
10461045

10471046
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.
10511049

10521050
Systems that need to aggregate validation failures may implement an [audit
10531051
webhook
10541052
backend](https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/#webhook-backend). See
10551053
below "Audit Events" for details.
10561054

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.
10581058

10591059
Metrics will include validation action so that cluster administrators can monitor the
10601060
validation failures of a binding before setting `validationActions` to `Deny`.
@@ -1086,10 +1086,12 @@ Future work:
10861086
ValidatingAdmissionPolicy authors to declare a expression as non-enforcing
10871087
regardless of `validationActions`.
10881088

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.
10931095

10941096
#### Audit Annotations
10951097

@@ -1129,17 +1131,18 @@ types will be supported.
11291131

11301132
All audit event keys are prefixed by `<ValidatingPolicyDefinition name>/`.
11311133

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.:
11351138

11361139
```yaml
11371140
# the audit event recorded
11381141
{
11391142
"kind": "Event",
11401143
"apiVersion": "audit.k8s.io/v1",
11411144
"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\"}"
11431146
# other annotations
11441147
...
11451148
}
@@ -1157,7 +1160,7 @@ are included with the key provided. E.g.:
11571160
"kind": "Event",
11581161
"apiVersion": "audit.k8s.io/v1",
11591162
"annotations": {
1160-
"mypolicy.mygroup.example.com/myauditkey": "my audit value"
1163+
"ValidatingAdmissionPolicy/mypolicy.mygroup.example.com/myauditkey": "my audit value"
11611164
# other annotations
11621165
...
11631166
}

0 commit comments

Comments
 (0)