@@ -201,8 +201,7 @@ the certain name/namespace. The resources must be `serviceaccounts`.
201
201
- ` impersonate:scheduled-node` that limits the impersonator to impersonate the node the
202
202
impersonator is running on. The resources must be `nodes`.
203
203
204
- For the imperonsonator, two permissions will be required :
205
-
204
+ For clusters that use RBAC authz mode, two permissions will be required for impersonation. For example :
206
205
1. The permission to impersonate a certain user. This is a cluster scoped
207
206
permission.
208
207
` ` ` yaml
@@ -394,7 +393,7 @@ metadata:
394
393
name: impersonate-user
395
394
rules:
396
395
- apiGroups:
397
- - auhtentications .k8s.io
396
+ - authentications .k8s.io
398
397
resources:
399
398
- users
400
399
verbs:
@@ -672,15 +671,15 @@ This can be done with:
672
671
- a search in the Kubernetes bug triage tool (https://storage.googleapis.com/k8s-triage/index.html)
673
672
-->
674
673
675
- - SAR check on impersonate user with permission :
674
+ - SubjectAccessReview check on impersonating user. For RBAC authz mode, this might look like :
676
675
` ` ` yaml
677
676
apiVersion: rbac.authorization.k8s.io/v1
678
677
kind: ClusterRole
679
678
metadata:
680
679
name: impersonate-user
681
680
rules:
682
681
- apiGroups:
683
- - auhtentications .k8s.io
682
+ - authentications .k8s.io
684
683
resources:
685
684
- users
686
685
resourceNames:
@@ -715,7 +714,7 @@ metadata:
715
714
name : impersonate-user
716
715
rules :
717
716
- apiGroups :
718
- - auhtentications .k8s.io
717
+ - authentications .k8s.io
719
718
resources :
720
719
- nodes
721
720
verbs :
@@ -744,20 +743,8 @@ rules:
744
743
745
744
##### e2e tests
746
745
747
- <!--
748
- This question should be filled when targeting a release.
749
- For Alpha, describe what tests will be added to ensure proper quality of the enhancement.
750
-
751
- For Beta and GA, document that tests have been written,
752
- have been executed regularly, and have been stable.
753
- This can be done with:
754
- - permalinks to the GitHub source code
755
- - links to the periodic job (typically a job owned by the SIG responsible for the feature), filtered by the test name
756
- - a search in the Kubernetes bug triage tool (https://storage.googleapis.com/k8s-triage/index.html)
757
-
758
- We expect no non-infra related flakes in the last month as a GA graduation criteria.
759
- If e2e tests are not necessary or useful, explain why.
760
- -->
746
+ This feature is fully tested with unit and integration tests. An eventual conformance
747
+ test is needed as part of GA
761
748
762
749
- [test name](https://github.com/kubernetes/kubernetes/blob/2334b8469e1983c525c0c6382125710093a25883/test/e2e/...): [SIG ...](https://testgrid.k8s.io/sig-...?include-filter-by-regex=MyCoolFeature), [triage search](https://storage.googleapis.com/k8s-triage/index.html?test=MyCoolFeature)
763
750
@@ -800,11 +787,11 @@ Below are some examples to consider, in addition to the aforementioned [maturity
800
787
- Determine if additional tests are necessary
801
788
- Ensure reliability of existing tests
802
789
803
-
804
790
# ### GA
805
791
806
792
- At least one successful adoption of each user story (node agent and deputy).
807
793
- All bugs resolved and no new bugs requiring code change since the previous shipped release.
794
+ - Conformance tests are added.
808
795
809
796
# ## Upgrade / Downgrade Strategy
810
797
@@ -821,7 +808,7 @@ enhancement:
821
808
-->
822
809
823
810
On upgrade to a version that enables the feature
824
- * the previous inpersonator with impersonate permission will still work, but it is highly
811
+ * the previous impersonator with impersonate permission will still work, but it is highly
825
812
recommanded to use the new permissions with less privilege.
826
813
827
814
@@ -894,7 +881,7 @@ No. Impersonator with existing impersonate permission will still be allowed to i
894
881
895
882
# ##### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
896
883
897
- Yes. Set the FeatureGate to false and restart the kube-apiserver.
884
+ Yes. Set the feature gate to false and restart the kube-apiserver.
898
885
899
886
# ##### What happens if we reenable the feature if it was previously rolled back?
900
887
@@ -935,6 +922,8 @@ What signals should users be paying attention to when the feature is young
935
922
that might indicate a serious problem?
936
923
-->
937
924
925
+ Authz latency for impersonation is too long.
926
+
938
927
# ##### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
939
928
940
929
<!--
@@ -960,7 +949,11 @@ For GA, this section is required: approvers should be able to confirm the
960
949
previous answers based on experience in the field.
961
950
-->
962
951
963
- None
952
+ There are existing metrics to record authz latency and request number :
953
+ - authorization latency
954
+ - authorization success
955
+ - webhook authorizer match condition latency
956
+ - webhook authorizer match condition success
964
957
965
958
# ##### How can an operator determine if the feature is in use by workloads?
966
959
@@ -1026,6 +1019,8 @@ implementation difficulties, etc.).
1026
1019
There are already metrics for the layers this feature is adding to :
1027
1020
- authorization latency
1028
1021
- authorization success
1022
+ - webhook authorizer match condition latency
1023
+ - webhook authorizer match condition success
1029
1024
1030
1025
# ## Dependencies
1031
1026
@@ -1119,7 +1114,12 @@ Think about adding additional work or introducing new steps in between
1119
1114
[existing SLIs/SLOs] : https://git.k8s.io/community/sig-scalability/slos/slos.md#kubernetes-slisslos
1120
1115
-->
1121
1116
1122
- It will introduce one additional access review check for request with impersonation.
1117
+ The existing impersonation mechanism will introduce 1 access review for request with impersonation. While upon
1118
+ feature is enabled :
1119
+ - When the check is passed, it will introduce 2-3 access review checks for request with impersonation.
1120
+ - 2 access review check if the new access rule is passed.
1121
+ - 3 access review check if the new access rule is not passed, and the legacy impersonate access rule is passed.
1122
+ - When the check is disallowed, it will introduce 3 access review checks for request with impersonation.
1123
1123
1124
1124
# ##### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components?
1125
1125
@@ -1194,17 +1194,15 @@ Major milestones might include:
1194
1194
1195
1195
# # Drawbacks
1196
1196
1197
- <!--
1198
- Why should this KEP _not_ be implemented?
1199
- -->
1197
+ - Several additional authorization checks are added introducing some overhead.
1200
1198
1201
1199
# # Alternatives
1202
1200
1203
1201
# ## Subject Access Review
1204
1202
1205
1203
The controller can sends a SAR request, and then uses its own permission to perform the action.
1206
1204
The main difference from impersonation is :
1207
- 1. the controller itself needs to have the permission for a certain action, while with impersonataion
1205
+ 1. the controller itself needs to have the permission for a certain action, while with impersonation
1208
1206
the controller does not need these permissions, but the permissions to `impersonate-on` certain action.
1209
1207
2. The audit log shows that controller performs the action, while with impersonatation audit log
1210
1208
shows controller is impersonating and the target user performs the action.
@@ -1214,11 +1212,11 @@ is running against the target user.
1214
1212
# ## Setting a special APIGroup suffix instead of special verb
1215
1213
1216
1214
Instead of using a verb with prefix `impersonate-on:`, a special apigroup suffix/prefix can be set for
1217
- each resource to be impersonated, e.g.
1215
+ each resource to be impersonated, e.g. setting the apigroup with a suffix of `.impersonation.k8s.io` :
1218
1216
1219
1217
` ` ` yaml
1220
1218
- apiGroups:
1221
- - apps.imperonsation .k8s.io
1219
+ - apps.impersonation .k8s.io
1222
1220
resources:
1223
1221
- deployments
1224
1222
verbs:
@@ -1229,7 +1227,7 @@ each resource to be impersonated, e.g.
1229
1227
It is almost the same as the verb based approach in the proposal. However, since existing impersonation flows are
1230
1228
verb based, so making the new flow verb based as well feels more consistent.
1231
1229
1232
- # ## Check permission intersaction of impersonator and target user
1230
+ # ## Check permission intersection of impersonator and target user
1233
1231
1234
1232
This is an approach to check intersected permission of the impersonator and the target user, and
1235
1233
only allow the action if both have the correct permission. Comparing to the proposed approach :
@@ -1258,7 +1256,7 @@ One example is
1258
1256
"group version": "example.org/v1",
1259
1257
"name": "elevation-of-privilege"
1260
1258
},
1261
- "user": "lmktfy ",
1259
+ "user": "impersonator ",
1262
1260
"group": []
1263
1261
]
1264
1262
}
0 commit comments