Skip to content

Commit

Permalink
Remove references to default admin creds (#3869)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <dxho@amazon.com>
  • Loading branch information
derek-ho committed Jan 17, 2024
1 parent e0ed91c commit a64f409
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion data-prepper-plugins/opensearch/opensearch_security.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sink:
- opensearch:
...
username: "admin"
password: "admin"
password: "<admin password>"
```

or by using user credential assigned with a role that has the below required permissions.
Expand Down
2 changes: 1 addition & 1 deletion docs/log_analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ log-pipeline:
hosts: [ "https://localhost:9200" ]
# Change to your credentials
username: "admin"
password: "admin"
password: "<admin password>"
# Add a certificate file if you are accessing an OpenSearch cluster with a self-signed certificate
#cert: /path/to/cert
# If you are connecting to an Amazon OpenSearch Service domain without
Expand Down
6 changes: 3 additions & 3 deletions docs/trace_analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ raw-pipeline:
hosts: [ "https://localhost:9200" ]
# Change to your credentials
username: "admin"
password: "admin"
password: "<admin password>"
# Add a certificate file if you are accessing an OpenSearch cluster with a self-signed certificate
#cert: /path/to/cert
# If you are connecting to an Amazon OpenSearch Service domain without
Expand All @@ -137,7 +137,7 @@ raw-pipeline:
index_type: trace-analytics-raw
# Change to your credentials
username: "admin"
password: "admin"
password: "<admin password>"
# Add a certificate file if you are accessing an OpenSearch cluster with a self-signed certificate
#cert: /path/to/cert
# If you are connecting to an Amazon OpenSearch Service domain without
Expand Down Expand Up @@ -174,7 +174,7 @@ service-map-pipeline:
index_type: trace-analytics-service-map
# Change to your credentials
username: "admin"
password: "admin"
password: "<admin password>"
# Add a certificate file if you are accessing an OpenSearch cluster with a self-signed certificate
#cert: /path/to/cert
# If you are connecting to an Amazon OpenSearch Service domain without
Expand Down
1 change: 1 addition & 0 deletions examples/dev/trace-analytics-sample-app/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ services:
- "9600:9600"
environment:
- discovery.type=single-node
- "OPENSEARCH_INIITAL_ADMIN_PASSWORD=myStrongPassword123!"
networks:
- my_network

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: Apache-2.0
#

until [[ $(curl --write-out %{http_code} --output /dev/null --silent --head --fail https://node-0.example.com:9200 -u admin:admin --insecure) == 200 ]]; do
until [[ $(curl --write-out %{http_code} --output /dev/null --silent --head --fail https://node-0.example.com:9200 -u admin:myStrongPassword123! --insecure) == 200 ]]; do
echo "Waiting for OpenSearch to be ready"
sleep 1
done
Expand Down
6 changes: 3 additions & 3 deletions release/smoke-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ data-prepper_1 | 2021-12-03T19:57:31,925 [grok-pipeline-prepper-worker-7
```
### 3. Confirm Open Search is running
```
curl -s -k -u 'admin:admin' 'https://localhost:9200/_cat/indices'
curl -s -k -u 'admin:<admin password>' 'https://localhost:9200/_cat/indices'
```
If indicies are displayed Open Search is running.
```
Expand All @@ -90,14 +90,14 @@ yellow open otel-v1-apm-span-000001 3pN9V1YNSjSMY5ggHa2TfA 1 1 12 0 28.3k
**To confirm if Open Search is receiving log data run**
Use the following cURL command to query the index `test-grok-index` for any documents. **Note**: The results may not show all documents received.
```
curl -k -u 'admin:admin' https://localhost:9200/test-grok-index/_search
curl -k -u 'admin:<admin password>' https://localhost:9200/test-grok-index/_search
```
If in your results the JSON path `.hits.total.value` has a value of 0 Open Search is not receiving log data. Confirm with the Data Prepper logs records are being processed from the buffer and no error messages are displayed.

**To confirm if Open Search is receiving trace data run**
Use the following cURL command to query the `otel-v1-apm-span-000001` index for documents containing **PythonService**. These documents will be generated by the **otel-span-exporter**, sent to **otel-collector**, then sent to **data-prepper**, then sent to **opensearch**.
```
curl -k -u 'admin:admin' https://localhost:9200/otel-v1-apm-span-000001/_search?q=PythonService
curl -k -u 'admin:<admin password>' https://localhost:9200/otel-v1-apm-span-000001/_search?q=PythonService
```
If in your results the JSON path `.hits.total.value` has a value of 0 Open Search is not receiving trace data. Confirm OTel opentelemetry-collector logs are continueally displaying metrics and no errors are printing. Next confirm with the Data Prepper logs records are being processed from the buffer and no error messages are displayed.

Expand Down
6 changes: 3 additions & 3 deletions release/smoke-tests/data-prepper/config/pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ grok-pipeline:
- opensearch:
hosts: [ "https://node-0.example.com:9200" ]
username: "admin"
password: "admin"
password: "myStrongPassword123!"
index: "test-grok-index"

entry-pipeline:
Expand All @@ -32,7 +32,7 @@ raw-pipeline:
- opensearch:
hosts: [ "https://node-0.example.com:9200" ]
username: "admin"
password: "admin"
password: "myStrongPassword123!"
index_type: trace-analytics-raw

service-map-pipeline:
Expand All @@ -46,5 +46,5 @@ service-map-pipeline:
- opensearch:
hosts: ["https://node-0.example.com:9200"]
username: "admin"
password: "admin"
password: "myStrongPassword123!"
index_type: trace-analytics-service-map
4 changes: 2 additions & 2 deletions release/smoke-tests/run-smoke-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function usage() {
function query_hits_gt_zero () {
local URL=$1
local SEARCH_RESPONSE
SEARCH_RESPONSE=$(curl -s -k -u 'admin:admin' "${URL}")
SEARCH_RESPONSE=$(curl -s -k -u 'admin:myStrongPassword123!' "${URL}")
local LOG_COUNT=0

if command -v jq &> /dev/null
Expand Down Expand Up @@ -138,7 +138,7 @@ WAITING_FOR_DATAPREPPER=true
echo -n "Waiting for Data Prepper to start "
while ${WAITING_FOR_DATAPREPPER}
do
if curl -s -k -u 'admin:admin' 'https://localhost:9200/_cat/indices' > /dev/null && curl -s -k -H "Content-Type: application/json" -d '[{"log": "smoke test log "}]' 'http://localhost:2021/log/ingest' > /dev/null
if curl -s -k -u 'admin:myStrongPassword123!' 'https://localhost:9200/_cat/indices' > /dev/null && curl -s -k -H "Content-Type: application/json" -d '[{"log": "smoke test log "}]' 'http://localhost:2021/log/ingest' > /dev/null
then
WAITING_FOR_DATAPREPPER=false
else
Expand Down

0 comments on commit a64f409

Please sign in to comment.