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

Update CI and docs to remove references to default admin creds #365

Merged
merged 8 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
11 changes: 10 additions & 1 deletion .ci/run-opensearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ environment=($(cat <<-END
--env cluster.name=$cluster_name
--env discovery.type=single-node
--env discovery.seed_hosts=$master_node_name
--env OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123!
--env cluster.routing.allocation.disk.threshold_enabled=false
--env bootstrap.memory_lock=true
--env node.attr.testattr=test
Expand Down Expand Up @@ -62,10 +63,18 @@ END
local_detach="true"
if [[ "$i" == "$((NUMBER_OF_NODES-1))" ]]; then local_detach=$DETACH; fi

password="admin"
IFS='.' read -ra version_array <<< "$OPENSEARCH_VERSION"

# Starting in 2.12.0, security demo configuration script requires an initial admin password
if (( ${version_array[0]} > 2 || (${version_array[0]} == 2 && ${version_array[1]} >= 12) )); then
password="myStrongPassword123!"
fi

set -x
healthcmd="curl -vvv -s --fail http://localhost:9200/_cluster/health || exit 1"
if [[ "$SECURE_INTEGRATION" == "true" ]]; then
healthcmd="curl -vvv -s --insecure -u admin:admin --fail https://localhost:9200/_cluster/health || exit 1"
healthcmd="curl -vvv -s --insecure -u admin:$password --fail https://localhost:9200/_cluster/health || exit 1"
fi

CLUSTER_TAG=$CLUSTER
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Add support for train api functionality by @rawwar in ([#310](https://github.com/opensearch-project/opensearch-py-ml/pull/310))
- Add support for Model Access Control - Register, Update, Search and Delete by @rawwar in ([#332](https://github.com/opensearch-project/opensearch-py-ml/pull/332))
- Add support for model connectors by @rawwar in ([#345](https://github.com/opensearch-project/opensearch-py-ml/pull/345))
- Support for security default admin credential changes in 2.12.0 in ([#365](https://github.com/opensearch-project/opensearch-py-ml/pull/365))

### Changed
- Modify ml-models.JenkinsFile so that it takes model format into account and can be triggered with generic webhook by @thanawan-atc in ([#211](https://github.com/opensearch-project/opensearch-py-ml/pull/211))
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ $ make html
```yml
opensearch.hosts: ["https://localhost:9200"]
opensearch.username: "admin" # Default username
opensearch.password: "admin" # Default password
opensearch.password: "< admin password >" # Password set during setup
```

## Code guidelines
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/demo_deploy_cliptextmodel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"# Connect to OpenSearch cluster\n",
"host = 'localhost'\n",
"port = 9200\n",
"auth = ('admin', 'admin') # For testing only. Don't store credentials in code.\n",
"auth = ('admin', '< admin password >') # For testing only. Don't store credentials in code.\n",
"\n",
"def get_os_client(host = host, port = port, auth = auth):\n",
" '''\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/demo_metrics_correlation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"\n",
"def get_os_client(cluster_url = CLUSTER_URL,\n",
" username='admin',\n",
" password='admin'):\n",
" password='< admin password >'):\n",
" \"\"\"\n",
" Get OpenSearch client\n",
" :param cluster_url: cluster URL like https://ml-te-netwo-1s12ba42br23v-ff1736fa7db98ff2.elb.us-west-2.amazonaws.com:443\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/demo_ml_commons_integration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"source": [
"def get_os_client(cluster_url = CLUSTER_URL,\n",
" username='admin',\n",
" password='admin'):\n",
" password='< admin password >'):\n",
" '''\n",
" Get OpenSearch client\n",
" :param cluster_url: cluster URL like https://ml-te-netwo-1s12ba42br23v-ff1736fa7db98ff2.elb.us-west-2.amazonaws.com:443\n",
Expand Down
8 changes: 4 additions & 4 deletions docs/source/examples/demo_notebook.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"source": [
"def get_os_client(cluster_url = CLUSTER_URL,\n",
" username='admin',\n",
" password='admin'):\n",
" password='< admin password >'):\n",
" '''\n",
" Get OpenSearch client\n",
" :param cluster_url: cluster URL like https://ml-te-netwo-1s12ba42br23v-ff1736fa7db98ff2.elb.us-west-2.amazonaws.com:443\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"source": [
"def get_os_client(cluster_url = CLUSTER_URL,\n",
" username='admin',\n",
" password='admin'):\n",
" password='< admin password >'):\n",
" '''\n",
" Get OpenSearch client\n",
" :param cluster_url: cluster URL like https://ml-te-netwo-1s12ba42br23v-ff1736fa7db98ff2.elb.us-west-2.amazonaws.com:443\n",
Expand Down
8 changes: 4 additions & 4 deletions docs/source/examples/online_retail_analysis.ipynb

Large diffs are not rendered by default.

Loading