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

Addresses changes made to security demo config install tool #214

Merged
merged 6 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 11 additions & 3 deletions helpers/personalized_search_ranking_quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,13 @@ if [ -n "${VOLUME_NAME:-}" ]; then
external: true"
fi
echo "Volume created"

# OpenSearch 2.12 onwards security plugins requires a password to be set to setup admin user
if [ "$(echo "${OPENSEARCH_VERSION} 2.12" | awk '{print ($1 >= $2)}')" -eq 1 ] && [ -z "${OPENSEARCH_INITIAL_ADMIN_PASSWORD}" ]; then
echo "OpenSearch 2.12 onwards, the Security Plugins requires initial admin password to be set for demo config setup"
exit 1
fi
DarshitChanpura marked this conversation as resolved.
Show resolved Hide resolved

#
# Create a docker-compose.yml file that will launch an OpenSearch node with the image we
# just built and an OpenSearch Dashboards node that points to the OpenSearch node.
Expand All @@ -269,6 +276,7 @@ services:
- cluster.name=opensearch-cluster
- node.name=opensearch-node
- discovery.type=single-node
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD}
ulimits:
memlock:
soft: -1
Expand Down Expand Up @@ -329,8 +337,8 @@ cat >README <<EOF
OpenSearch container launched, listening on port 9200.
OpenSearch Dashboards container launched, listening on port 5601.

Interact with OpenSearch using curl by authenticating as admin:admin like:
curl -ku "admin:admin" https://localhost:9200/
Interact with OpenSearch using curl by authenticating as admin like:
curl -ku "admin:<admin-password>" https://localhost:9200/

Index some data on OpenSearch by following instructions at
https://opensearch.org/docs/latest/opensearch/index-data/
Expand All @@ -343,7 +351,7 @@ search ranking and one with Personalized search Ranking.

To configure and setup Personalize search ranking, run a curl command as follows:

curl -X PUT "https://localhost:9200/_search/pipeline/intelligent_ranking" -u 'admin:admin' --insecure -H 'Content-Type: application/json' -d'
curl -X PUT "https://localhost:9200/_search/pipeline/intelligent_ranking" -u 'admin:<admin-password>' --insecure -H 'Content-Type: application/json' -d'
{
"description": "A pipeline to apply custom reranking",
"response_processors" : [
Expand Down
12 changes: 10 additions & 2 deletions helpers/search_processing_kendra_quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,13 @@ if [ -n "${VOLUME_NAME:-}" ]; then
external: true"
fi

# OpenSearch 2.12 onwards security plugins requires a password to be set to setup admin user
if [ "$(echo "${OPENSEARCH_VERSION} 2.12" | awk '{print ($1 >= $2)}')" -eq 1 ] && [ -z "${OPENSEARCH_INITIAL_ADMIN_PASSWORD}" ]; then
echo "OpenSearch 2.12 onwards, the Security Plugins requires initial admin password to be set for demo config setup"
exit 1
fi


#
# Create a docker-compose.yml file that will launch an OpenSearch node with the image we
# just built and an OpenSearch Dashboards node that points to the OpenSearch node.
Expand All @@ -379,6 +386,7 @@ services:
- kendra_intelligent_ranking.service.endpoint=${KENDRA_RANKING_ENDPOINT}
- kendra_intelligent_ranking.service.region=${AWS_REGION}
- kendra_intelligent_ranking.service.execution_plan_id=${EXECUTION_PLAN_ID}
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD}
ulimits:
memlock:
soft: -1
Expand Down Expand Up @@ -446,8 +454,8 @@ cat >README <<EOF
OpenSearch container launched, listening on port 9200.
OpenSearch Dashboards container launched, listening on port 5601.

Interact with OpenSearch using curl by authenticating as admin:admin like:
curl -ku "admin:admin" https://localhost:9200/
Interact with OpenSearch using curl by authenticating as admin like:
curl -ku "admin:<admin-password>" https://localhost:9200/

Index some data on OpenSearch by following instructions at
https://opensearch.org/docs/latest/opensearch/index-data/
Expand Down
Loading