Skip to content

Add initial admin password prompt to OpenSearch service #370

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

Merged
merged 3 commits into from
Apr 4, 2025

Conversation

tcampbPPU
Copy link
Contributor

Spinning up OpenSearch running takeout enable opensearch using all the default prompts results in the following crash from docker:

snapshot of logs:

Enabling OpenSearch Security Plugin
Enabling execution of install_demo_configuration.sh for OpenSearch Security Plugin 
OpenSearch 2.12.0 onwards, the OpenSearch Security Plugin a change that requires an initial password for 'admin' user. 
Please define an environment variable 'OPENSEARCH_INITIAL_ADMIN_PASSWORD' with a strong password string. 
If a password is not provided, the setup will quit. 
 For more details, please visit: https://opensearch.org/docs/latest/install-and-configure/install-opensearch/docker/
### OpenSearch Security Demo Installer
### ** Warning: Do not use on production or public reachable systems **
OpenSearch install type: rpm/deb on Linux 6.12.10-orbstack-00297-gf8f6e015b993 aarch64
OpenSearch config dir: /usr/share/opensearch/config/
OpenSearch config file: /usr/share/opensearch/config/opensearch.yml
OpenSearch bin dir: /usr/share/opensearch/bin/
OpenSearch plugins dir: /usr/share/opensearch/plugins/
OpenSearch lib dir: /usr/share/opensearch/lib/
Detected OpenSearch Version: 3.0.0-alpha1
Detected OpenSearch Security Version: 3.0.0.0-alpha1
No custom admin password found. Please provide a password via the environment variable OPENSEARCH_INITIAL_ADMIN_PASSWORD.

According to their docs

Note for OpenSearch 2.12 or later: Fresh installs of 2.12 or later require that you define an admin password — using the OPENSEARCH_INITIAL_ADMIN_PASSWORD environment variable — when configuring the security demo. For more information, see Setting up a demo configuration.

This PR just introduces another additional prompt to set that environment variable on the docker compose setup script.

Running takeout enable opensearch post update allows opensearch to properly run: http://localhost:9200/
image

@@ -49,7 +49,7 @@ function it_sorts_the_versions_naturally()
$tags = collect($dockerTags->getTags());

$this->assertEquals('latest', $tags->shift());
$this->assertEquals('17.2', $tags->shift());
$this->assertEquals('17.4', $tags->shift());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattstauffer
Copy link
Member

Briliant, thanks!

@mattstauffer mattstauffer merged commit 65cd741 into tighten:main Apr 4, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants