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

host header not set correctly in automatic endpoint discovery for aws connector #1369

Closed
doodlesbykumbi opened this issue Jan 26, 2021 · 0 comments · Fixed by #1370
Closed

Comments

@doodlesbykumbi
Copy link
Contributor

doodlesbykumbi commented Jan 26, 2021

Summary

A clear and concise description of what the bug is.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Setup a Secretless service with an AWS connector at 8080, with automatic endpoint discovery (--endpoint-url http://secretless.empty in the alias below) .
alias aws="AWS_ACCESS_KEY_ID=x AWS_SECRET_ACCESS_KEY=x HTTP_PROXY=http://localhost:8080 aws --endpoint-url http://secretless.empty"
  1. Run aws s3 ls to list all buckets. You'll likely get
An error occurred (NoSuchBucket) when calling the ListObjectsV2 operation: The specified bucket does not exist

NOTE: This bug doesn't show up for aws sts get-caller-identity, maybe this endpoint doesn't care about the Host header.

This bug does not show up when you manually set the endpoint. So aws --endpoint-url http://s3.us-east-1.amazonaws.com s3 ls works perfectly fine.

Expected Results

It should just work. The AWS-CLI should return the list of buckets on the AWS account in question.

Actual Results (including error logs, if applicable)

  1. We get an error from AWS-CLI.
    An error occurred (NoSuchBucket) when calling the ListObjectsV2 operation: The specified bucket does not exist
    
  2. Upon inspection of debug logs from Secretless we see that the host header for the request to the AWS endpoint is not the right value
    2021/01/26 23:29:00 [DEBUG] HTTP Proxy on tcp://0.0.0.0:8080: Making request: 
    GET /?delimiter=%2F&encoding-type=url&list-type=2&prefix= HTTP/1.1
    Host: secretless.empty
    Accept-Encoding: identity
    

Additional Information

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant