Skip to content
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 reference to default credentials #217

Merged
merged 8 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/actions/opensearch/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ do
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
--env "http.port=${port}" \
--env "action.destructive_requires_name=false" \
--env "OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123!" \
--env "plugins.security.disabled=${DISABLE_SECURITY}" \
--ulimit nofile=65536:65536 \
--ulimit memlock=-1:-1 \
Expand All @@ -55,6 +56,19 @@ if [[ $DISABLE_SECURITY = true ]]; then
--silent \
http://os1:$PORT
else
# Starting in 2.12.0, security demo configuration script requires an initial admin password which is set to
# myStrongPassword123!
OPENSEARCH_REQUIRED_VERSION="2.12.0"
if [ "$CLUSTER_VERSION" == "latest" ]; then
CREDENTIAL="admin:myStrongPassword123!"
else
COMPARE_VERSION=`echo $OPENSEARCH_REQUIRED_VERSION $CLUSTER_VERSION | tr ' ' '\n' | sort -V | uniq | head -n 1`
if [ "$COMPARE_VERSION" != "$OPENSEARCH_REQUIRED_VERSION" ]; then
CREDENTIAL="admin:admin"
else
CREDENTIAL="admin:myStrongPassword123!"
fi
fi
Comment on lines +59 to +71
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ported this same logic from the build repo

docker run \
--network cluster \
--rm \
Expand All @@ -66,7 +80,7 @@ else
--show-error \
--silent \
--insecure \
https://admin:admin@os1:$PORT
https://$CREDENTIAL@os1:$PORT
fi

sleep 10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- name: lychee Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1.0.8
uses: lycheeverse/lychee-action@v1.9.0
with:
args: --accept=200,403,429 "**/*.html" "**/*.md" "**/*.txt" "**/*.json" --exclude "https://github.com/\[your*" --exclude "https://localhost:9200" --exclude "http://localhost:9200" --exclude "git://github.com/opensearch-project/*" --exclude "file:///github/workspace/*" --exclude ".*api.server.org:4430/search" --exclude ".*example.com:9200" --exclude ".*myhost:8080" --exclude ".*localhost:9200/" --exclude-mail
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:

test-opensearch-security:
env:
TEST_OPENSEARCH_SERVER: https://admin:admin@localhost:9200
TEST_OPENSEARCH_SERVER: https://admin:myStrongPassword123!@localhost:9200
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok to hard code this here since from now on, "latest" will be > 2.12

PORT: 9200
strategy:
fail-fast: false
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Added
- Pass in an initial admin password, required by security after 2.12.0 release ([#217](https://github.com/opensearch-project/opensearch-ruby/issues/217))
### Changed
### Deprecated
### Removed
Expand Down
Loading