Skip to content

Commit ce389a5

Browse files
committed
Add user story for secondary-authz conditions
1 parent 5c45cc3 commit ce389a5

File tree

1 file changed

+15
-1
lines changed
  • keps/sig-api-machinery/3716-webhook-predicates

1 file changed

+15
-1
lines changed

keps/sig-api-machinery/3716-webhook-predicates/README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,20 @@ matchConditions:
150150
- expression: '!("system:nodes" in request.userInfo.groups)'
151151
```
152152

153+
Since the expression will be evaluated using a common Kubernetes CEL library, these expressions
154+
should also get automatic access to the secondary authorization check mechanism described in
155+
[KEP-3488: CEL for Admission Control](/keps/sig-api-machinery/3488-cel-admission-control#secondary-authz).
156+
In practice, this means that RBAC bindings can be used to opt-out privileged users from security policy:
157+
158+
_Note: The secondary authz mechanism has not yet been designed, and the example syntax here is just
159+
to illustrate how it might be used._
160+
161+
```yaml
162+
matchConditions:
163+
# Exclude users with the 'breakglass' permission on the 'security-policy' webhook.
164+
- expression: '!authorized(request.userInfo, "breakglass", "validatingwebhookconfigurations.admissionregistration.k8s.io/security-policy")'
165+
```
166+
153167
#### Scope an NFS access management webhook to Pods mounting NFS volumes
154168

155169
> I want to narrowly scope my webhook to only the relevant requests, in order to reduce load on the
@@ -223,7 +237,7 @@ type MatchCondition struct {
223237
//'request' - Attributes of the admission request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
224238
//
225239
// The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the
226-
// request.object. No other metadata properties are accessible.
240+
// object. No other metadata properties are accessible.
227241
//
228242
// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
229243
// Accessible property names are escaped according to the following rules when accessed in the expression:

0 commit comments

Comments
 (0)