aws-solutions / centralized-logging-with-opensearch

Build your own log analytics platform on OpenSearch in 20 minutes
https://aws.amazon.com/solutions/implementations/centralized-logging-with-opensearch/
Apache License 2.0
108 stars 28 forks source link

Opensearch Proxy : Opensearch proxy configured with cognito auth gives 404 error #276

Open alejandromoncayo opened 6 months ago

alejandromoncayo commented 6 months ago

Describe the bug

This defect is related to the resources created by template: https://console.aws.amazon.com/cloudformation/home#/stacks/new?templateURL=https:%2F%2Fs3.amazonaws.com%2Fsolutions-reference%2Fcentralized-logging-with-opensearch%2Flatest%2FCentralizedLogging.template

I deployed the template above, created the opensearch domain, then attempted to create a proxy as per instructions on: https://docs.aws.amazon.com/solutions/latest/centralized-logging-with-opensearch/launch-with-cognito-user-pool.html

I registered a DNS domain and generated SSL cert for it, created the record to point to the auto created load balancer and I see the request makes it all the way to the proxy server:

panding 1.0 (+https://api.slack.com/robots)" "3.234.241.216"
10.255.0.56 - - [26/Mar/2024:18:25:08 +0000] "GET / HTTP/1.1" 302 145 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" "52.94.133.136"
10.255.0.56 - - [26/Mar/2024:18:25:08 +0000] "GET /_dashboards HTTP/1.1" 302 82 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" "52.94.133.136"
10.255.0.56 - - [26/Mar/2024:18:25:08 +0000] "GET /login?response_type=code&client_id=2t83cj7fm4f9pgh2ul0ppoibb0&redirect_uri=https://vpc-centralized-logging-btulbgbz7ndcxyhmmf2cnvgoai.us-east-1.es.amazonaws.com/_dashboards/app/home&state=7f5381e0-81d4-4e53-b133-1192389e7a7f HTTP/1.1" 404 555 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" "52.94.133.136"
10.255.1.242 - - [26/Mar/2024:18:25:15 +0000] "GET /login?response_type=code&client_id=2t83cj7fm4f9pgh2ul0ppoibb0&redirect_uri=https://vpc-centralized-logging-btulbgbz7ndcxyhmmf2cnvgoai.us-east-1.es.amazonaws.com/_dashboards/app/home&state=7f5381e0-81d4-4e53-b133-1192389e7a7f HTTP/1.1" 404 153 "-" "Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)" "3.94.86.239"

When the re-direct happens on the browser, it sends the user to a 404 page.

Expected Behavior

Opening the proxy link from the auto generated solution should send the user to the cognito login page

Current Behavior

Opening the proxy link from the auto generated solution sends the user to a 404 page

Reproduction Steps

follow the instructions listed under: https://docs.aws.amazon.com/solutions/latest/centralized-logging-with-opensearch/launch-with-cognito-user-pool.html and select the stack for "Launch with a new VPC"

Possible Solution

No response

Additional Information/Context

No response

Solution Version

v2.1.2

AWS Region. e.g., us-east-1

us-east-1

Other information

I have the repro case on my isengard account available for troubleshooting. my amazon alias is @espedy