-
Notifications
You must be signed in to change notification settings - Fork 77
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
Remove references to default admin creds #430
Conversation
Signed-off-by: Derek Ho <dxho@amazon.com>
@IanHoang @gkamat can you folks take a look/ I am expecting this to fail security integration tests, but would be needed to fix the CI after 2.12.0 docker image gets released. I also have some questions if I made the changes correctly, since I didn't fully understand how this repo is using some files. I am assuming some docker files with reference to 1.x line don't need changes/have no plans to be changed in the near future. |
@@ -39,7 +39,7 @@ services: | |||
networks: | |||
- opensearch-net | |||
healthcheck: | |||
test: curl -f http://localhost:{{http_port}} -u admin:admin --insecure | |||
test: curl -f http://localhost:{{http_port}} -u admin:myStrongPassword123! --insecure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command would fail if os_version < 2.12.0. Not sure how this file is used/how we can conditionally switch this password. Can maintainers help out here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@derek-ho Off the top of my head, there's a couple ways that we could get around this. Others might have better ideas
- You can add an additioonal method that checks the
os_version
variable that's being passed through and if it's < 2.12.0, useadmin
. You'll need to make that additional check in this section of provisioner.py and this section of docker_installer.py - I believe you could also leverage a library such as
yq
https://stackoverflow.com/questions/76526508/replace-a-block-of-yaml but that would require upkeep with this library and adding it insetup.py
@@ -25,7 +25,7 @@ printf "Waiting for clusters to get ready " | |||
ALL_CLUSTERS_READY=false | |||
|
|||
while ! $ALL_CLUSTERS_READY; do | |||
(curl -ks -u admin:admin https://localhost:9200 -o /dev/null && curl -ks -u admin:admin https://localhost:9201 -o /dev/null && ALL_CLUSTERS_READY=true) || (printf "." && sleep 5) | |||
(curl -ks -u admin:myStrongPassword123! https://localhost:9200 -o /dev/null && curl -ks -u admin:admin https://localhost:9201 -o /dev/null && ALL_CLUSTERS_READY=true) || (printf "." && sleep 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure where the second cluster is coming from, I think the first cluster is coming from docker-compose-metricstore
, which is on the latest release. This change will fail CI until 2.12.0 docker image is released, at which point it would fix the CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can maintainers help out here in understanding if the second cluster needs similar changes/where those that cluster's password should be set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not believe this script is being used anymore. @gkamat can you confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Derek Ho <dxho@amazon.com>
@derek-ho You made the correct changes but also need to make changes to the unittests. Can you update the following tests so that the assertions pass?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments
Signed-off-by: Derek Ho <dxho@amazon.com>
I tried to add some logic around versioning in the PR. I will put it into draft for now, since it will be easier to take care of once 2.12.0 is released and we can really test the difference between the logic spitting out different health checks based on the version. In any case, the current CI is in a good state and will be so until after the release. @IanHoang let me know if that makes sense for you. |
@IanHoang I just went through this PR once more. Are the dockerfiles that I touched only used to assert that they are read correctly? If that is the case then this PR may not be necessary. Can you point me to the versions of opensearch you are testing against? Does that matrix have 2.12 added to it after the release? I couldn't find it |
The dockerfiles that you touched are used in the integration tests and when users want to specifically run OSB against a Docker version of OpenSearch. These are the distributions that OpenSearch Benchmark tests against:
To test if your changes in
In the logs, you can see if any errors occur related to |
@derek-ho are you still working on this? If not, can we close this? |
Description
With 2.12.0 release, the security plugin is making a change that requires an initial admin password to be set via an environment variable. This PR makes this change in CI/code/documentation.
Issues Resolved
[List any issues this PR will resolve]
Testing
[Describe how this change was tested]
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.