Repository navigation
Description
HI,
I could not find exact requirement for bearer token support and hence i am opening this new issue. If you feel that this requirement is taken into consideration then please provide appropriate PR / issue and this can be closed.
Recently we implemented Kubernetes at the enterprise level. We have multiple clusters ( > 10 ). At the enterprise level for audit controls and traceability, security we use centralised deployment tool. The deployment tool uses agents for executing deployment process. In this case Agent has helm cli installed. The clusters have OIDC connector which goes to LDAP for authenticating user and then provides id_access and refresh token which we use in the deployment process. The user id that we use is generic user id ( no personal user ids for prod deployments) for which we get token from OIDC.
Currently with kubectl cli we can safely use this token along with other parameters such as cluster master url, namespace etc, this eliminates need of generating kube config file on agent. Having kube config file residing on server is a security exposure as agent runs with root permissions and user can easily "cat" the file generated as part of process and get the token ( valid for ~12 hrs). Having kubectl pass the id_access token is the safest and most secured way as tokens can be generated tokens dynamically ( secured/encrypted property ) to connect to multiple clusters with different ids. Eliminated need of managing multiple config files.
As we started looking at helm due to user community interest, I found that helm doesn't support bearer token instead it needs kube config file. Due to this we had to ask users not to use helm as we can not create config files and expose prod id tokens in there at run time. It also adds additional overhead of cleaning these files in any failure or success.
I am opening this issue to see if helm can support parameters similar to kubectl or may be more and honour kubernetes security model while performing any actions.
I know that there is going to be security model change in Helm 3 and no more tiler which is exciting but the requirement i stated is not clearly mentioned anywhere. I posted this on #helm-dev and #helm-user channel and i have been told to open the issue.
Activity
jdolitsky commentedon Jan 8, 2019
@JTG2020 implied with the removal of Tiller is "honour kubernetes security model while performing any actions" as you described.
Could you share an example of how youre using this OIDC token with
kubectl? We will likely support anything related to kubernetes api access in Helm 3JTG2020 commentedon Jan 9, 2019
@jdolitsky please see below example how kubectl is being used for deploying resource to multiple clusters with no overhead of creating kubeconfig files for multiple k8s clusters -
The general format we are using is :
kubectl <options> <commands>i.e.
kubectl --server=<https://xyz.net:8443 - master server url> --namespace=x-team1 --insecure-skip-tls-verify=true --token <bearer token received from OIDC which is masked> apply --filename=my-deployment.yamlThe actual token is masked by deployment tool from displaying in logs so actual statement looks as below -
kubectl --server=https://xyz.net:8443 --namespace=x-team1 --insecure-skip-tls-verify=true --token **** apply --filename=my-deployment.yamlNote that "=" between parameter and value works with space as well e.g.
kubectl --server https://xyz.net:8443 --namespace x-team1 --insecure-skip-tls-verify true --token **** apply --filename my-deployment.yamlI would say Helm should support all or most of the options that kubectl supports . I can get all options using command -
kubectl optionsHope these examples would help to improve helm further.
jdolitsky commentedon Jan 11, 2019
@JTG2020 thanks for that. It sounds to me that Helm 3 will need to accept whatever options that kubectl provides for modifying auth context (
--insecure-skip-tls-verifyand--tokenat the least).If you have a moment, please open up an issue on Helm with brief summary and post it here. I will make sure it gets onto the Helm 3 backlog. Thank you!
JTG2020 commentedon Jan 13, 2019
@jdolitsky created issue in (helm/helm#5159)
jdolitsky commentedon Jan 13, 2019
@JTG2020 great thank you. lets continue the conversation there