Skip to content

Commit 1f1779e

Browse files
committed
Update structured authz examples
Signed-off-by: Rita Zhang <[email protected]>
1 parent 27ea28d commit 1f1779e

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

content/en/blog/_posts/2024-04-26-structured-authz-beta.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ authorizers:
109109
connectionInfo:
110110
# Controls how the webhook should communicate with the server.
111111
# Valid values:
112-
# - KubeConfig: use the file specified in kubeConfigFile to locate the
112+
# - KubeConfigFile: use the file specified in kubeConfigFile to locate the
113113
# server.
114114
# - InClusterConfig: use the in-cluster configuration to call the
115115
# SubjectAccessReview API hosted by kube-apiserver. This mode is not
116116
# allowed for kube-apiserver.
117-
type: KubeConfig
117+
type: KubeConfigFile
118118
# Path to KubeConfigFile for connection info
119-
# Required, if connectionInfo.Type is KubeConfig
119+
# Required, if connectionInfo.Type is KubeConfigFile
120120
kubeConfigFile: /kube-system-authz-webhook.yaml
121121
# matchConditions is a list of conditions that must be met for a request to be sent to this
122122
# webhook. An empty list of matchConditions matches all requests.
@@ -141,7 +141,7 @@ authorizers:
141141
# only intercept requests to kube-system
142142
- expression: request.resourceAttributes.namespace == 'kube-system'
143143
# don't intercept requests from kube-system service accounts
144-
- expression: !('system:serviceaccounts:kube-system' in request.user.groups)
144+
- expression: "!('system:serviceaccounts:kube-system' in request.groups)"
145145
- type: Node
146146
name: node
147147
- type: RBAC
@@ -190,7 +190,7 @@ authorizers:
190190
matchConditionSubjectAccessReviewVersion: v1
191191
failurePolicy: Deny
192192
connectionInfo:
193-
type: KubeConfig
193+
type: KubeConfigFile
194194
kubeConfigFile: /files/kube-system-authz-webhook.yaml
195195
matchConditions:
196196
# only send resource requests to the webhook
@@ -227,7 +227,7 @@ authorizers:
227227
matchConditionSubjectAccessReviewVersion: v1
228228
failurePolicy: Deny
229229
connectionInfo:
230-
type: KubeConfig
230+
type: KubeConfigFile
231231
kubeConfigFile: /files/kube-system-authz-webhook.yaml
232232
matchConditions:
233233
# only send resource requests to the webhook
@@ -248,15 +248,15 @@ authorizers:
248248
matchConditionSubjectAccessReviewVersion: v1
249249
failurePolicy: Deny
250250
connectionInfo:
251-
type: KubeConfig
251+
type: KubeConfigFile
252252
kubeConfigFile: /files/opa-default-authz-webhook.yaml
253253
matchConditions:
254254
# only send resource requests to the webhook
255255
- expression: has(request.resourceAttributes)
256256
# only intercept requests to default namespace
257257
- expression: request.resourceAttributes.namespace == 'default'
258258
# don't intercept requests from default service accounts
259-
- expression: !('system:serviceaccounts:default' in request.user.groups)
259+
- expression: "!('system:serviceaccounts:default' in request.groups)"
260260
```
261261

262262
## What's next?

content/en/docs/reference/access-authn-authz/authorization.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,14 @@ authorizers:
268268
connectionInfo:
269269
# Controls how the webhook should communicate with the server.
270270
# Valid values:
271-
# - KubeConfig: use the file specified in kubeConfigFile to locate the
271+
# - KubeConfigFile: use the file specified in kubeConfigFile to locate the
272272
# server.
273273
# - InClusterConfig: use the in-cluster configuration to call the
274274
# SubjectAccessReview API hosted by kube-apiserver. This mode is not
275275
# allowed for kube-apiserver.
276-
type: KubeConfig
276+
type: KubeConfigFile
277277
# Path to KubeConfigFile for connection info
278-
# Required, if connectionInfo.Type is KubeConfig
278+
# Required, if connectionInfo.Type is KubeConfigFile
279279
kubeConfigFile: /kube-system-authz-webhook.yaml
280280
# matchConditions is a list of conditions that must be met for a request to be sent to this
281281
# webhook. An empty list of matchConditions matches all requests.
@@ -300,7 +300,7 @@ authorizers:
300300
# only intercept requests to kube-system
301301
- expression: request.resourceAttributes.namespace == 'kube-system'
302302
# don't intercept requests from kube-system service accounts
303-
- expression: !('system:serviceaccounts:kube-system' in request.user.groups)
303+
- expression: "!('system:serviceaccounts:kube-system' in request.groups)"
304304
- type: Node
305305
name: node
306306
- type: RBAC

content/zh-cn/docs/reference/access-authn-authz/authorization.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -471,14 +471,14 @@ authorizers:
471471
connectionInfo:
472472
# Controls how the webhook should communicate with the server.
473473
# Valid values:
474-
# - KubeConfig: use the file specified in kubeConfigFile to locate the
474+
# - KubeConfigFile: use the file specified in kubeConfigFile to locate the
475475
# server.
476476
# - InClusterConfig: use the in-cluster configuration to call the
477477
# SubjectAccessReview API hosted by kube-apiserver. This mode is not
478478
# allowed for kube-apiserver.
479-
type: KubeConfig
479+
type: KubeConfigFile
480480
# Path to KubeConfigFile for connection info
481-
# Required, if connectionInfo.Type is KubeConfig
481+
# Required, if connectionInfo.Type is KubeConfigFile
482482
kubeConfigFile: /kube-system-authz-webhook.yaml
483483
# matchConditions is a list of conditions that must be met for a request to be sent to this
484484
# webhook. An empty list of matchConditions matches all requests.
@@ -503,7 +503,7 @@ authorizers:
503503
# only intercept requests to kube-system
504504
- expression: request.resourceAttributes.namespace == 'kube-system'
505505
# don't intercept requests from kube-system service accounts
506-
- expression: !('system:serviceaccounts:kube-system' in request.user.groups)
506+
- expression: "!('system:serviceaccounts:kube-system' in request.groups)"
507507
- type: Node
508508
name: node
509509
- type: RBAC
@@ -565,9 +565,9 @@ authorizers:
565565
connectionInfo:
566566
# 控制 Webhook 如何与服务器通信。
567567
# 有效值:
568-
# - KubeConfig:使用 kubeConfigFile 中指定的文件来定位服务器。
568+
# - KubeConfigFile:使用 kubeConfigFile 中指定的文件来定位服务器。
569569
# - InClusterConfig:使用集群内配置来调用由 kube-apiserver 托管的 SubjectAccessReview API,kube-apiserver 不允许使用此模式。
570-
type: KubeConfig
570+
type: KubeConfigFile
571571
# 连接信息的 KubeConfig 文件的路径
572572
# 如果 connectionInfo.Type 是 KubeConfig,则为必填项
573573
kubeConfigFile: /kube-system-authz-webhook.yaml
@@ -594,7 +594,7 @@ authorizers:
594594
# 仅拦截对 kube-system 的请求
595595
- expression: request.resourceAttributes.namespace == 'kube-system'
596596
# 不要拦截来自 kube-system 服务账户的请求
597-
- expression: !('system:serviceaccounts:kube-system' in request.user.groups)
597+
- expression: "!('system:serviceaccounts:kube-system' in request.groups)"
598598
- type: Node
599599
name: node
600600
- type: RBAC

0 commit comments

Comments
 (0)