-
Notifications
You must be signed in to change notification settings - Fork 275
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
[RFC] Rework initial password and certificates setup #4344
Comments
Thank you for the detailed RFC @smortex. I brought up similar concerns before as well: #3632 (comment) There are still many hardcoded secrets in the demo configuration and only changing the |
+1 to the concerns raised. Demo configuration tools is a long way to go from being completely secure, and changing the admin password was first step. There should be no default credentials or certificates provided. The |
[Triage] @smortex thank you for raising these concerns. +1 to all the concerns that you raised. I will mark this as triaged because we would love a contribution to make the demo configuration more usable! Maybe we can break this down into smaller tasks that can be done in parallel instead of one big issue. |
I like this very much. |
Add some of my previous suggestions of the password handle here:
Thanks. |
There are multiple drawbacks to this, but I did not gave much context about the reasoning of why not providing any internal accounts, so please allow me to do so here:
My proposal is to not ship default internal user accounts. If at startup the internalusers database is loaded and is found to be empty, a warning is output telling the user about the situation and recommending to either not use this authentication backend or setup internal user accounts using the internal user initial setup tool mentioned above to bootstrap the configuration with system user accounts or the internal user accounts management tools to customize which accounts are managed.
Generation being out of scope for the reason above, the check part of course have to happen before starting the service. Installation should really just install files, and not attempt to generate anythings unless that does not require any user interaction (including providing but also reading a password). This was definitively a bad move. Regarding checks, this is the goal of my proposal: the certificate verification tool can be used as a pre-start check for the service, and it allows administrators to use the same tool to check the files they are working on when setting up TLS for the first time or when renewing certificates. |
Context
Initially, OpenSearch shipped with a bunch of hard-coded default user and passwords (i.e.
admin:admin
,anomalyadmin:anomalyadmin
,kibanaserver:kibanaserver
,kibanaro:kibanaro
,logstash:logstash
,readall:readall
,snapshotrestore:snapshotrestore
) and a hard-coded demo certification authority, server and client certificates.Version 2.12 intended to improve the security posture of the project and now require to pass a
OPENSEARCH_INITIAL_ADMIN_PASSWORD
environment variable on first start or while installing. Concerns where raised when this was proposed and an extensive list of drawbacks of this approach where listed in this issue.The current situation is that for running the server, the user SHALL provide a strong password for the admin user, making them think that their setup is not open to the wild. In fact, their setup still have half a dozen hard-coded user accounts with default passwords, and admin access is still possible using the demo user certificate of the kirk user which is hard-coded.
What this RFC wants to improve
Proposal
At installation time, do not setup any hard-coded configuration: no internal users and passwords, no default certificates.
When the service is started, if the security plugin is installed but no certificate is found, generate a self-signed node certificate, use it to secure the communication to OpenSearch, but do not write it to disk. Restarting the service would generate a new certificate. With this absence of TLS material, no client certificate can be used to have admin access to OpenSearch, but the service is able to start, and can be operated the usual way providing HTTP Basic authentication when configured.
With no internal users by default, all request will be denied until some accounts are added.
The above behavior allows to install a package without the need to rely on non-standard environment variables, and if the service is started (some systems to this by default during installation and installation fail if the service does not start properly, e.g. Debian), it is not exposed to all abuses using default credentials: the service start, use generated TLS certificate, and all requests are denied.
At this stage, additional tooling would be welcome:
Expectations
With all the above, the setup of a development instance has a few more steps:
OPENSEARCH_INITIAL_ADMIN_PASSWORD
But the setup of a production instance has no pitfall:
OPENSEARCH_INITIAL_ADMIN_PASSWORD
The installation instructions for a development and a production site can therefore be merged in a single list:
You can generate a self-signed certification chain suitable for development running xxx, or you can provide your own server and client certificates by storing them in xxx. Run xxx to verify your TLS configuration;
Use xxx to setup internal users.
The text was updated successfully, but these errors were encountered: