security icon indicating copy to clipboard operation
security copied to clipboard

[BUG] install_demo_configuration.[sh|bat] assumeyes behavior not working as expected

Open cwperks opened this issue 2 years ago • 6 comments

What is the bug?

The install_demo_configuration scripts are not actually setting all prompts to y when using the -y option as you would expect. This issue was initially uncovered in this PR: https://github.com/opensearch-project/security/pull/2308

In addition to the behavior of -y, there is no command line option available to only install the demo certificates and leave initsecurity and cluster_mode as false.

The install_demo_configuration scripts should be updated with a -y option that actually accepts all prompts and a new option should be added to only install the demo certificates.

cwperks avatar Jan 13 '23 16:01 cwperks

It looks like opensearch build makes use of the -y command in opensearch-docker-entrypoint.sh, opensearch-tar-install, opensearch-onetime-setup.sh, and the two build templates for rpm and debian post-installation.

stephen-crawford avatar Jan 13 '23 17:01 stephen-crawford

Bugs like this are a good reason to migrate away from our current command line scripts.

  • https://github.com/opensearch-project/security/issues/1755

peternied avatar Jan 13 '23 17:01 peternied

[Triage] @scrawfor99 add documentation change to address that the code will not be corrected / follow up with the build team about desired change for the behavior.

stephen-crawford avatar Jan 17 '23 20:01 stephen-crawford

@cwperks updates on this issue?

davidlago avatar Aug 21 '23 18:08 davidlago

assumeyes is being handled in the updated installer: https://github.com/opensearch-project/security/blob/main/src/main/java/org/opensearch/security/tools/democonfig/Installer.java#L198-L218

Closing this issue.

cwperks avatar Jan 04 '24 21:01 cwperks

This bug fix touches a number of different repositories as they already use -i with -y option.

Proposed Fix:

  • Introduce a new option to generate demo certs : -d
  • Modify the tool to assume -d, -i, -c as yes when -y is passed. Else individual options need to be passed
  • Modify different distributions and integ tests across different repositories.

DarshitChanpura avatar Jan 10 '24 20:01 DarshitChanpura