-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Is your feature request related to a problem? Please describe.
When using the ConfigMap feature, I want to restrict permissions in K8s as much as possible, for example by using a rule like...
- apiGroups: [ "" ]
resources: [ "configmaps" ]
verbs: [ "list", "get", "watch" ]
resourceNames: [ "<my_app_name" ]
This would allow only minimal access. Unfortunately, according to the K8s documentation...
If you restrict list or watch by resourceName, clients must include a metadata.name field selector in their list or watch request that matches the specified resourceName in order to be authorized. For example, kubectl get configmaps --field-selector=metadata.name=my-configmap
Describe the solution you'd like
Adding this somehow to the filter get query could help minimizing access rights there.
Describe alternatives you've considered
Obviously it would also be possible to add separate rules for list and get/watch:
- apiGroups: [ "" ]
resources: [ "configmaps" ]
verbs: [ "list" ]
- apiGroups: [ "" ]
resources: [ "configmaps" ]
verbs: [ "get", "watch" ]
resourceNames: [ "<my_app_name" ]
but that is of course less verbose. Alternatively it would also be nice to just include the specific rights that need to be set in the documentation and refer to this limitation also.