Skip to content

Commit 8d7d4fe

Browse files
authored
Merge pull request #41816 from windsonsea/abacy
[zh] sync /access-authn-authz/abac.md
2 parents fd7fa1f + 86149db commit 8d7d4fe

File tree

1 file changed

+21
-12
lines changed
  • content/zh-cn/docs/reference/access-authn-authz

1 file changed

+21
-12
lines changed

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

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@ weight: 80
1717
<!-- overview -->
1818

1919
<!--
20-
Attribute-based access control (ABAC) defines an access control paradigm whereby access rights are granted to users through the use of policies which combine attributes together.
20+
Attribute-based access control (ABAC) defines an access control paradigm whereby access rights are granted
21+
to users through the use of policies which combine attributes together.
2122
-->
22-
基于属性的访问控制(Attribute-based access control - ABAC)定义了访问控制范例,
23+
基于属性的访问控制(Attribute-based access controlABAC)定义了访问控制范例,
2324
ABAC 通过使用将属性组合在一起的策略来向用户授予访问权限。
2425

2526
<!-- body -->
2627

2728
<!--
2829
## Policy File Format
2930
30-
To enable `ABAC` mode, specify `--authorization-policy-file=SOME_FILENAME` and `--authorization-mode=ABAC` on startup.
31+
To enable `ABAC` mode, specify `--authorization-policy-file=SOME_FILENAME` and `--authorization-mode=ABAC`
32+
on startup.
3133
32-
The file format is [one JSON object per line](https://jsonlines.org/). There
34+
The file format is [one JSON object per line](https://jsonlines.org/). There
3335
should be no enclosing list or map, only one map per line.
3436
3537
Each line is a "policy object", where each such object is a map with the following
@@ -45,7 +47,8 @@ properties:
4547

4648
<!--
4749
- Versioning properties:
48-
- `apiVersion`, type string; valid values are "abac.authorization.kubernetes.io/v1beta1". Allows versioning and conversion of the policy format.
50+
- `apiVersion`, type string; valid values are "abac.authorization.kubernetes.io/v1beta1". Allows versioning
51+
and conversion of the policy format.
4952
- `kind`, type string: valid values are "Policy". Allows versioning and conversion of the policy format.
5053
-->
5154
- 版本控制属性:
@@ -54,8 +57,11 @@ properties:
5457
<!--
5558
- `spec` property set to a map with the following properties:
5659
- Subject-matching properties:
57-
- `user`, type string; the user-string from `--token-auth-file`. If you specify `user`, it must match the username of the authenticated user.
58-
- `group`, type string; if you specify `group`, it must match one of the groups of the authenticated user. `system:authenticated` matches all authenticated requests. `system:unauthenticated` matches all unauthenticated requests.
60+
- `user`, type string; the user-string from `--token-auth-file`. If you specify `user`, it must match the
61+
username of the authenticated user.
62+
- `group`, type string; if you specify `group`, it must match one of the groups of the authenticated user.
63+
`system:authenticated` matches all authenticated requests. `system:unauthenticated` matches all
64+
unauthenticated requests.
5965
-->
6066
- `spec` 配置为具有以下映射的属性:
6167
- 主体匹配属性:
@@ -89,10 +95,11 @@ properties:
8995
- Non-resource-matching properties:
9096
- `nonResourcePath`, type string; non-resource request paths.
9197
- Ex: `/version` or `/apis`
92-
- Wildcard:
98+
- Wildcard:
9399
- `*` matches all non-resource requests.
94100
- `/foo/*` matches all subpaths of `/foo/`.
95-
- `readonly`, type boolean, when true, means that the Resource-matching policy only applies to get, list, and watch operations, Non-resource-matching policy only applies to get operation.
101+
- `readonly`, type boolean, when true, means that the Resource-matching policy only applies to get, list,
102+
and watch operations, Non-resource-matching policy only applies to get operation.
96103
-->
97104
- 非资源匹配属性:
98105
- `nonResourcePath`,字符串类型;非资源请求路径。
@@ -104,6 +111,7 @@ properties:
104111
非资源匹配属性仅适用于 get 操作。
105112

106113
{{< note >}}
114+
107115
<!--
108116
An unset property is the same as a property set to the zero value for its type
109117
(e.g. empty string, 0, false). However, unset should be preferred for
@@ -123,7 +131,7 @@ REST interface.
123131
124132
A request has attributes which correspond to the properties of a policy object.
125133
126-
When a request is received, the attributes are determined. Unknown attributes
134+
When a request is received, the attributes are determined. Unknown attributes
127135
are set to the zero value of its type (e.g. empty string, 0, false).
128136
129137
A property set to `"*"` will match any value of the corresponding attribute.
@@ -253,7 +261,8 @@ kubectl --v=8 version
253261
254262
## A quick note on service accounts
255263
256-
Every service account has a corresponding ABAC username, and that service account's username is generated according to the naming convention:
264+
Every service account has a corresponding ABAC username, and that service account's username is generated
265+
according to the naming convention:
257266
-->
258267
[完整文件示例](https://releases.k8s.io/v{{< skew currentPatchVersion >}}/pkg/auth/authorizer/abac/example_policy_file.jsonl)
259268

@@ -275,7 +284,7 @@ system:serviceaccount:<namespace>:default
275284
```
276285

277286
<!--
278-
For example, if you wanted to grant the default service account (in the `kube-system` namespace) full
287+
For example, if you wanted to grant the default service account (in the `kube-system` namespace) full
279288
privilege to the API using ABAC, you would add this line to your policy file:
280289
-->
281290
例如,如果你要使用 ABAC 将(`kube-system` 命名空间中)的默认服务账号完整权限授予 API,

0 commit comments

Comments
 (0)