Skip to content

Commit bc6d94f

Browse files
authored
Update CI and docs to remove references to default admin creds (#365)
* Update CI and docs to remove references to default admin creds Signed-off-by: Derek Ho <[email protected]> * Add changelog line Signed-off-by: Derek Ho <[email protected]> * Echo opensearch version Signed-off-by: Derek Ho <[email protected]> * Update logic in determining version Signed-off-by: Derek Ho <[email protected]> * Change variable ref Signed-off-by: Derek Ho <[email protected]> * Modify version logic to be same as build repo Signed-off-by: Derek Ho <[email protected]> --------- Signed-off-by: Derek Ho <[email protected]> Signed-off-by: Derek Ho <[email protected]>
1 parent 9b2f686 commit bc6d94f

10 files changed

+29
-15
lines changed

.ci/run-opensearch.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ environment=($(cat <<-END
2020
--env cluster.name=$cluster_name
2121
--env discovery.type=single-node
2222
--env discovery.seed_hosts=$master_node_name
23+
--env OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123!
2324
--env cluster.routing.allocation.disk.threshold_enabled=false
2425
--env bootstrap.memory_lock=true
2526
--env node.attr.testattr=test
@@ -62,10 +63,21 @@ END
6263
local_detach="true"
6364
if [[ "$i" == "$((NUMBER_OF_NODES-1))" ]]; then local_detach=$DETACH; fi
6465

66+
OPENSEARCH_REQUIRED_VERSION="2.12.0"
67+
68+
password="admin"
69+
# Starting in 2.12.0, security demo configuration script requires an initial admin password
70+
COMPARE_VERSION=`echo $OPENSEARCH_REQUIRED_VERSION $OPENSEARCH_VERSION | tr ' ' '\n' | sort -V | uniq | head -n 1`
71+
if [ "$COMPARE_VERSION" != "$OPENSEARCH_REQUIRED_VERSION" ]; then
72+
password="admin"
73+
else
74+
password="myStrongPassword123!"
75+
fi
76+
6577
set -x
6678
healthcmd="curl -vvv -s --fail http://localhost:9200/_cluster/health || exit 1"
6779
if [[ "$SECURE_INTEGRATION" == "true" ]]; then
68-
healthcmd="curl -vvv -s --insecure -u admin:admin --fail https://localhost:9200/_cluster/health || exit 1"
80+
healthcmd="curl -vvv -s --insecure -u admin:$password --fail https://localhost:9200/_cluster/health || exit 1"
6981
fi
7082

7183
CLUSTER_TAG=$CLUSTER

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1212
- 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))
1313
- Add support for model connectors by @rawwar in ([#345](https://github.com/opensearch-project/opensearch-py-ml/pull/345))
1414
- Add support for model profiles by @rawwar in ([#358](https://github.com/opensearch-project/opensearch-py-ml/pull/358))
15+
- Support for security default admin credential changes in 2.12.0 in ([#365](https://github.com/opensearch-project/opensearch-py-ml/pull/365))
16+
1517

1618
### Changed
1719
- 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))

DEVELOPER_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ $ make html
159159
```yml
160160
opensearch.hosts: ["https://localhost:9200"]
161161
opensearch.username: "admin" # Default username
162-
opensearch.password: "admin" # Default password
162+
opensearch.password: "< admin password >" # Password set during setup
163163
```
164164
165165
## Code guidelines

docs/source/examples/demo_deploy_cliptextmodel.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"# Connect to OpenSearch cluster\n",
6060
"host = 'localhost'\n",
6161
"port = 9200\n",
62-
"auth = ('admin', 'admin') # For testing only. Don't store credentials in code.\n",
62+
"auth = ('admin', '< admin password >') # For testing only. Don't store credentials in code.\n",
6363
"\n",
6464
"def get_os_client(host = host, port = port, auth = auth):\n",
6565
" '''\n",

docs/source/examples/demo_metrics_correlation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"\n",
9595
"def get_os_client(cluster_url = CLUSTER_URL,\n",
9696
" username='admin',\n",
97-
" password='admin'):\n",
97+
" password='< admin password >'):\n",
9898
" \"\"\"\n",
9999
" Get OpenSearch client\n",
100100
" :param cluster_url: cluster URL like https://ml-te-netwo-1s12ba42br23v-ff1736fa7db98ff2.elb.us-west-2.amazonaws.com:443\n",

docs/source/examples/demo_ml_commons_integration.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
"source": [
122122
"def get_os_client(cluster_url = CLUSTER_URL,\n",
123123
" username='admin',\n",
124-
" password='admin'):\n",
124+
" password='< admin password >'):\n",
125125
" '''\n",
126126
" Get OpenSearch client\n",
127127
" :param cluster_url: cluster URL like https://ml-te-netwo-1s12ba42br23v-ff1736fa7db98ff2.elb.us-west-2.amazonaws.com:443\n",

docs/source/examples/demo_notebook.ipynb

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

docs/source/examples/demo_tracing_model_torchscript_onnx.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
"source": [
110110
"def get_os_client(cluster_url = CLUSTER_URL,\n",
111111
" username='admin',\n",
112-
" password='admin'):\n",
112+
" password='< admin password >'):\n",
113113
" '''\n",
114114
" Get OpenSearch client\n",
115115
" :param cluster_url: cluster URL like https://ml-te-netwo-1s12ba42br23v-ff1736fa7db98ff2.elb.us-west-2.amazonaws.com:443\n",

docs/source/examples/demo_transformer_model_train_save_upload_to_openSearch.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
"source": [
146146
"def get_os_client(cluster_url = CLUSTER_URL,\n",
147147
" username='admin',\n",
148-
" password='admin'):\n",
148+
" password='< admin password >'):\n",
149149
" '''\n",
150150
" Get OpenSearch client\n",
151151
" :param cluster_url: cluster URL like https://ml-te-netwo-1s12ba42br23v-ff1736fa7db98ff2.elb.us-west-2.amazonaws.com:443\n",

docs/source/examples/online_retail_analysis.ipynb

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)