-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for accepting cloud-provider credentials as EnvVar's #123
Comments
Wouldn't the appropriate fix for that scenario be to put the credentials into a secret that is exposed to the machine-controller but not the users? |
This would mean the end user would get a admin account with access to everything except that secret. |
That is not complicated at all, the user gets an account that has a clusterrole with And that is the exact way Kubernetes assumes to solve this kind of problems:
Ref: https://kubernetes.io/docs/concepts/configuration/secret/ |
In scenarios like Loodse's kubermatic or SAP's gardener (and even RedHats OpenShift Operator), the user has no access to the control plane. |
The only thing we should probably change is to add events and/or conditions to machines whenever we do something |
Ah. So this is primarily about storing credentials in a different cluster than the one that contains the machines, not about getting them from the environment |
Its about the machine-controller running in a different environment (Kubernetes or even Systemd for example). |
I see. So how would you name these env vars? Does something like that look fine to you?
Just as a sidenote, this opens a potential attack vendor when someone configures a server he or she controls as api endpoint for the cloudprovider, then tries random We could probably lock that down by having a whitelist and/or only allowing a combination of credentials and api endpoint to be used that way in the relevant providers (just Openstack I think). |
I would not add this to the The resolver accepts 3 parameters:
Via Reflection we iterate over all fields of the RawConfig:
This way we then also could eliminate missing resolve code within the cloud providers. Though this might be a bit non obvious? If its too magic, an implementation with something like |
A global
The latter could be solved by adding the Also we must be able to have constraints on field combinations, e.G. if you take user from the env you must also take password and api endpoint |
True, preferable over risking security issues IMO
When using the provider name as prefix, that should not occur. But i haven't considered the downsides here completely. It might be simple adding support for a second kube-client? |
A possible way would be to extend the cloudProviderSpec:
accessKeyId:
staticRef:
envVarName: "MACHINE_AWS_ACCESS_KEY_ID" Though all env vars must begin with the prefix |
The Machine object accepts multiple sources for cloudProviderSpec fields:
It should also be possible to pass in the secret values implicitly as environment variable.
The secret values differ from cloud provider.
Each secret field needs to have one specific environment key. Like
AWS_ACCESS_KEY_ID
.During the processing of the
cloudProviderSpec
we would need to check if the environment variable is set, and if so we need to use this value.Reason: In scenarios where the master components is managed by an external entity (Loodse kubermatic/ SAP Gardener) it might not be possible to expose the cloud provider specific secrets to the users.
The text was updated successfully, but these errors were encountered: