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
messageExpression: "'object.spec.replicas must be no greater than ' + string(params.maxReplicas)"
408
-
enforcement:
409
-
deny:
410
-
reason: Invalid
409
+
reason: Invalid
411
410
# ...other rule related fields here...
412
411
```
413
412
@@ -851,16 +850,9 @@ Policy definitions:
851
850
will be included in the failure message
852
851
- If `messageExpression` results in an error: `expression`and `name` will be
853
852
included in the failure message plus the arg evaluation failure
854
-
- Each validation may set a `reason` or `code`
855
-
856
-
- Each validation may select `enforcement` options:
857
-
- `deny { reason: ..., code: ... }`
858
-
- If `reason` or `code` is provided, they use the same semantics as
859
-
admission review. The reason clarifies the code but does not override it.
860
-
- `warn {}`- Included as a warning in the response to the client AND logged.
861
-
- Note: audit annotations is deferred until phase 2, see below "Audit
862
-
Annotations" section for details.
863
-
- (metrics will be emitted regardless of which enforcement options are set)
853
+
- `reason`and/or `code` - these fields have same semantics as admission
854
+
review; the reason clarifies the code but does not override it. If
855
+
`reason`is well known (.e.g "Unauthorizied" is well known to be `code` 401), then the code will be inferred from the `reason` and use of a different code will not be allowed.
864
856
865
857
Example policy definition:
866
858
@@ -876,51 +868,19 @@ spec:
876
868
- expression: "self.name.startsWith('xyz-')"
877
869
name: name-prefix
878
870
messageExpression: "self.name + ' must start with xyz-'"
879
-
enforcement:
880
-
deny:
881
-
code: 401
882
-
reason: Unauthorized
871
+
reason: Unauthorized
883
872
- expression: "self.name.contains('bad')"
884
873
name: bad-name
885
874
message: "name contains 'bad' which is discouraged due to ..."
Decide exactly what we are willing to commit to here.
1214
-
<<[/UNRESOLVED]>>
1184
+
Additional safety features we should consider:
1215
1185
1216
1186
- Configurable admission blocking write requests made internally in
1217
1187
kube-apiserver during server startup (like RBAC default policy reconciliation)
@@ -1248,10 +1218,9 @@ To consider:
1248
1218
1249
1219
#### Audit Annotations
1250
1220
1251
-
<<[UNRESOLVED ]>>
1252
-
Would audit support in this enhancement become redundant if [Audit](https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/) were also extended to support CEL?
1253
-
If so, which should we invest in?
1254
-
<<[/UNRESOLVED]>>
1221
+
To consider: Would audit support in this enhancement become redundant if
1222
+
[Audit](https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/) were also
1223
+
extended to support CEL? If so, which should we invest in?
1255
1224
1256
1225
Admission webhooks are able to include an associative array of audit annotations
1257
1226
in a review response. If we intend to provide parity with webhooks we would
message: "The 1st namespaceSelector or ValidatingAdmissionWebhook and MutatingAdmissionWebhooks must be: {key: webhook-restricted, operator: In, values: ['true']}"
1523
-
enforcement:
1524
-
deny:
1525
-
reason: Forbidden
1492
+
reason: Forbidden
1526
1493
```
1527
1494
1528
1495
This approach would pair well with a admission mutation that adds the rule to
0 commit comments