-
Notifications
You must be signed in to change notification settings - Fork 719
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
Allow existingSecret parameter for initial 'elastic' superuser #5460
Comments
After speaking with Elastic support, it looks like this is possible by pre-creating a While this appears to work, it is sub-optimal for several reasons:
|
As you said yourself we discourage the use of the elastic user for any productive use. For some use cases it also no longer holds the necessary permissions (e.g. stack monitoring). We already have a declarative and predictable (and thus automatable) way to setup users through the file realm as documented here: https://www.elastic.co/guide/en/cloud-on-k8s/master/k8s-users-and-roles.html#k8s_file_realm I do understand however that the fact that you would have to provide the bcrypt hash of the passwords in the secret that we use as the source for creating these users poses a burden for the GitOps/ ExternalSecrets approach you have mentioned in your post. We discussed this a bit out of band and I am wondering that if we were to make the creation of users through the file realm easier by allowing you to specify simple key/value pairs in the secret where the key is the username and the value is the clear text password it would also address your use case. This was already discussed back in the day when we first implemented support for the file realm in the ECK operator as possible next step in building out that feature. Consider this example for how this could potentially look in YAML: apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch-sample
spec:
version: 8.1.0
auth:
fileRealm:
- secretName: es-users-file-realm
nodeSets:
- name: default
count: 1
---
kind: Secret
apiVersion: v1
metadata:
name: es-users-file-realm
stringData:
# any unknown key/value pair will be internally transformed into 'users' by ECK, with a hash of the provided passwords
# known key/value pairs are `users_roles` and `users` which contain raw file realm configuration as documented today.
my-user: cleartextpassword
users_roles: |-
admin:my-user |
@pebrc to be clear on something and close the loop here, the |
No, it is not. But you would be able to create your own users through that mechanism, with more restricted permissions than |
Coming back to the question of whether the There is an open question as to what should happen if the |
Coming back to my original point here, in my opinion the heart of the matter is "explicit is better than implicit". It's currently undocumented behavior and not part of IaC that ECK will use an existing Secret if it follows a specific naming convention. Making this relationship clearer by providing an |
We merged a new feature which allows setting up the The It is explicit rather than implicit. It will give users control over the initial password set for this user. As a side note the feature is not restricted to the It will be part of the next ECK operator release. I am closing this issue therefore for now. |
Chart such as https://github.com/bitnami/charts/tree/master/bitnami/elasticsearch offer an
existingSecret
parameter that can point to an existing secret containing credentials which, when specified, will take precedence and prevent an auto-generated secret.Does the ECK CRD expose this functionality for the initial
elastic
user in any way, and if so, what would a minimal example look like?I do realize It is not recommended to use elastic user credentials for production use cases - but, that aside, it would still be nice to control the initial credentials if possible. For example, a common pattern is to use
ExternalSecrets
that point to a ground source of truth in somewhere like AWS Secrets Manager.Environment
ECK 1.9.1, Elastic stack 7.17.1, K8s 1.21 on EKS
The text was updated successfully, but these errors were encountered: