Skip to content

Commit 5eea6d5

Browse files
committed
[zh] Sync self-subject-access-review-v1.md
1 parent dfb663f commit 5eea6d5

File tree

1 file changed

+214
-8
lines changed

1 file changed

+214
-8
lines changed

content/zh-cn/docs/reference/kubernetes-api/authorization-resources/self-subject-access-review-v1.md

Lines changed: 214 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,231 @@ resourceAuthorizationAttributes 和 nonResourceAuthorizationAttributes 二者必
9999
100100
<a name="ResourceAttributes"></a>
101101
*ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface*
102-
103-
- **resourceAttributes.group** (string)
104-
Group is the API Group of the Resource. "*" means all.
105-
106-
- **resourceAttributes.name** (string)
107-
Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all.
108102
-->
109103
- **resourceAttributes** (ResourceAttributes)
110104

111105
resourceAuthorizationAttributes 描述资源访问请求的信息。
112106

113107
<a name="ResourceAttributes"></a>
114108
**resourceAttributes 包括提供给 Authorizer 接口进行资源请求鉴权时所用的属性。**
115-
109+
110+
<!--
111+
- **resourceAttributes.fieldSelector** (FieldSelectorAttributes)
112+
113+
fieldSelector describes the limitation on access based on field. It can only limit access, not broaden it.
114+
115+
This field is alpha-level. To use this field, you must enable the `AuthorizeWithSelectors` feature gate (disabled by default).
116+
-->
117+
118+
- **resourceAttributes.fieldSelector** (FieldSelectorAttributes)
119+
120+
fieldSelector 描述基于字段的访问限制。此字段只能限制访问权限,而不能扩大访问权限。
121+
122+
此字段处于 Alpha 级别。要使用此字段,你必须启用 `AuthorizeWithSelectors` 特性门控(默认禁用)。
123+
124+
<!--
125+
<a name="FieldSelectorAttributes"></a>
126+
*FieldSelectorAttributes indicates a field limited access. Webhook authors are encouraged to * ensure rawSelector and requirements are not both set * consider the requirements field if set * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details. For the *SubjectAccessReview endpoints of the kube-apiserver: * If rawSelector is empty and requirements are empty, the request is not limited. * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds. * If rawSelector is empty and requirements are present, the requirements should be honored * If rawSelector is present and requirements are present, the request is invalid.*
127+
-->
128+
129+
<a name="FieldSelectorAttributes"></a>
130+
FieldSelectorAttributes 表示一个限制访问的字段。建议 Webhook 的开发者们:
131+
132+
* 确保 rawSelector 和 requirements 未被同时设置
133+
* 如果设置了 fieldSelector,则考虑 requirements 字段
134+
* 如果设置了 fieldSelector,不要尝试解析或考虑 rawSelector 字段。
135+
136+
这是为了避免出现另一个 CVE-2022-2880(即我们不希望不同系统以一致的方式解析某个查询),
137+
有关细节参见 https://www.oxeye.io/resources/golang-parameter-smuggling-attack
138+
对于 kube-apiserver 的 SubjectAccessReview 端点:
139+
140+
* 如果 rawSelector 为空且 requirements 为空,则请求未被限制。
141+
* 如果 rawSelector 存在且 requirements 为空,则 rawSelector 将被解析,并在解析成功的情况下进行限制。
142+
* 如果 rawSelector 为空且 requirements 存在,则应优先使用 requirements。
143+
* 如果 rawSelector 存在,requirements 也存在,则请求无效。
144+
145+
<!--
146+
- **resourceAttributes.fieldSelector.rawSelector** (string)
147+
148+
rawSelector is the serialization of a field selector that would be included in a query parameter. Webhook implementations are encouraged to ignore rawSelector. The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.
149+
-->
150+
151+
- **resourceAttributes.fieldSelector.rawSelector** (string)
152+
153+
rawSelector 是字段选择算符的序列化形式,将被包含在查询参数中。
154+
建议 Webhook 实现忽略 rawSelector。只要 requirements 不存在,
155+
kube-apiserver 的 SubjectAccessReview 将解析 rawSelector。
156+
157+
<!--
158+
- **resourceAttributes.fieldSelector.requirements** ([]FieldSelectorRequirement)
159+
160+
*Atomic: will be replaced during a merge*
161+
162+
requirements is the parsed interpretation of a field selector. All requirements must be met for a resource instance to match the selector. Webhook implementations should handle requirements, but how to handle them is up to the webhook. Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements are not understood.
163+
164+
<a name="FieldSelectorRequirement"></a>
165+
*FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.*
166+
-->
167+
168+
- **resourceAttributes.fieldSelector.requirements** ([]FieldSelectorRequirement)
169+
170+
**原子:将在合并期间被替换**
171+
172+
requirements 是字段选择算符已解析的解释。资源实例必须满足所有 requirements 才能匹配此选择算符。
173+
Webhook 实现应处理 requirements,但如何处理由 Webhook 自行决定。
174+
由于 requirements 只能限制请求,因此如果不理解 requirements,可以安全地将请求鉴权为无限制请求。
175+
176+
<a name="FieldSelectorRequirement"></a>
177+
**FieldSelectorRequirement 是一个选择算符,包含值、键以及与将键和值关联起来的运算符。**
178+
179+
<!--
180+
- **resourceAttributes.fieldSelector.requirements.key** (string), required
181+
182+
key is the field selector key that the requirement applies to.
183+
184+
- **resourceAttributes.fieldSelector.requirements.operator** (string), required
185+
186+
operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future.
187+
188+
- **resourceAttributes.fieldSelector.requirements.values** ([]string)
189+
190+
*Atomic: will be replaced during a merge*
191+
192+
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.
193+
-->
194+
195+
- **resourceAttributes.fieldSelector.requirements.key** (string),必需
196+
197+
key 是 requirements 应用到的字段选择算符键。
198+
199+
- **resourceAttributes.fieldSelector.requirements.operator** (string),必需
200+
201+
operator 表示键与一组值之间的关系。有效的运算符有 In、NotIn、Exists、DoesNotExist。
202+
运算符列表可能会在未来增加。
203+
204+
- **resourceAttributes.fieldSelector.requirements.values**[]string)
205+
206+
**原子:将在合并期间被替换**
207+
208+
values 是一个字符串值的数组。如果运算符是 In 或 NotIn,则 values 数组必须非空。
209+
如果运算符是 Exists 或 DoesNotExist,则 values 数组必须为空。
210+
211+
<!--
212+
- **resourceAttributes.group** (string)
213+
Group is the API Group of the Resource. "*" means all.
214+
-->
215+
116216
- **resourceAttributes.group** (string)
117217

118218
group 是资源的 API 组。
119219
"*" 表示所有组。
120-
220+
221+
<!--
222+
- **resourceAttributes.labelSelector** (LabelSelectorAttributes)
223+
224+
labelSelector describes the limitation on access based on labels. It can only limit access, not broaden it.
225+
226+
This field is alpha-level. To use this field, you must enable the `AuthorizeWithSelectors` feature gate (disabled by default).
227+
-->
228+
229+
- **resourceAttributes.labelSelector** (LabelSelectorAttributes)
230+
231+
labelSelector 描述基于标签的访问限制。此字段只能限制访问权限,而不能扩大访问权限。
232+
233+
此字段处于 Alpha 级别。要使用此字段,你必须启用 `AuthorizeWithSelectors` 特性门控(默认禁用)。
234+
235+
<!--
236+
<a name="LabelSelectorAttributes"></a>
237+
*LabelSelectorAttributes indicates a label limited access. Webhook authors are encouraged to * ensure rawSelector and requirements are not both set * consider the requirements field if set * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details. For the *SubjectAccessReview endpoints of the kube-apiserver: * If rawSelector is empty and requirements are empty, the request is not limited. * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds. * If rawSelector is empty and requirements are present, the requirements should be honored * If rawSelector is present and requirements are present, the request is invalid.*
238+
-->
239+
240+
<a name="LabelSelectorAttributes"></a>
241+
LabelSelectorAttributes 表示通过标签限制的访问。建议 Webhook 开发者们:
242+
243+
* 确保 rawSelector 和 requirements 未被同时设置
244+
* 如果设置了 labelSelector,则考虑 requirements 字段
245+
* 如果设置了 labelSelector,不要尝试解析或考虑 rawSelector 字段。
246+
247+
这是为了避免出现另一个 CVE-2022-2880(即让不同系统以一致的方式解析为何某个查询不是我们想要的),
248+
有关细节参见 https://www.oxeye.io/resources/golang-parameter-smuggling-attack
249+
对于 kube-apiserver 的 SubjectAccessReview 端点:
250+
251+
* 如果 rawSelector 为空且 requirements 为空,则请求未被限制。
252+
* 如果 rawSelector 存在且 requirements 为空,则 rawSelector 将被解析,并在解析成功的情况下进行限制。
253+
* 如果 rawSelector 为空且 requirements 存在,则应优先使用 requirements。
254+
* 如果 rawSelector 存在,requirements 也存在,则请求无效。
255+
256+
<!--
257+
- **resourceAttributes.labelSelector.rawSelector** (string)
258+
259+
rawSelector is the serialization of a field selector that would be included in a query parameter. Webhook implementations are encouraged to ignore rawSelector. The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.
260+
-->
261+
262+
- **resourceAttributes.labelSelector.rawSelector** (string)
263+
264+
rawSelector 是字段选择算符的序列化形式,将被包含在查询参数中。
265+
建议 Webhook 实现忽略 rawSelector。只要 requirements 不存在,
266+
kube-apiserver 的 SubjectAccessReview 将解析 rawSelector。
267+
268+
<!--
269+
- **resourceAttributes.labelSelector.requirements** ([]LabelSelectorRequirement)
270+
271+
*Atomic: will be replaced during a merge*
272+
273+
requirements is the parsed interpretation of a label selector. All requirements must be met for a resource instance to match the selector. Webhook implementations should handle requirements, but how to handle them is up to the webhook. Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements are not understood.
274+
275+
<a name="LabelSelectorRequirement"></a>
276+
*A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.*
277+
-->
278+
279+
- **resourceAttributes.labelSelector.requirements** ([]LabelSelectorRequirement)
280+
281+
**原子:将在合并期间被替换**
282+
283+
requirements 是字段选择算符已解析的解释。资源实例必须满足所有 requirements,才能匹配此选择算符。
284+
Webhook 实现应处理 requirements,但如何处理由 Webhook 自行决定。
285+
由于 requirements 只能限制请求,因此如果不理解 requirements,可以安全地将请求鉴权为无限制请求。
286+
287+
<a name="FieldSelectorRequirement"></a>
288+
**FieldSelectorRequirement 是一个选择算符,包含值、键以及将键和值关联起来的运算符。**
289+
290+
<!--
291+
- **resourceAttributes.labelSelector.requirements.key** (string), required
292+
293+
key is the label key that the selector applies to.
294+
295+
- **resourceAttributes.labelSelector.requirements.operator** (string), required
296+
297+
operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
298+
299+
- **resourceAttributes.labelSelector.requirements.values** ([]string)
300+
301+
*Atomic: will be replaced during a merge*
302+
303+
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
304+
-->
305+
306+
- **resourceAttributes.labelSelector.requirements.key** (string),必需
307+
308+
key 是选择算符应用到的标签键。
309+
310+
- **resourceAttributes.labelSelector.requirements.operator** (string),必需
311+
312+
operator 表示键与一组值之间的关系。有效的运算符有 In、NotIn、Exists、DoesNotExist。
313+
314+
- **resourceAttributes.labelSelector.requirements.values** ([]string)
315+
316+
**原子:将在合并期间被替换**
317+
318+
values 是一个字符串值的数组。如果运算符是 In 或 NotIn,则 values 数组必须非空。
319+
如果运算符是 Exists 或 DoesNotExist,则 values 数组必须为空。
320+
此数组在策略性合并补丁(Strategic Merge Patch)期间被替换。
321+
322+
<!--
323+
- **resourceAttributes.name** (string)
324+
Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all.
325+
-->
326+
121327
- **resourceAttributes.name** (string)
122328

123329
name 是 "get" 正在请求或 "delete" 已删除的资源的名称。

0 commit comments

Comments
 (0)