lyft / metadataproxy

A proxy for AWS's metadata service that gives out scoped IAM credentials from STS
Other
456 stars 69 forks source link

Return correct status code for proxied requests #73

Closed cloetzi closed 6 years ago

cloetzi commented 6 years ago

After the update to the latest datadog agent (v6), we discovered that metadataproxy would not forward the correct status code for proxied requests. In our specific case, the datadog agent would use the metadata API for Azure and GCE to detect hostnames. Azure and GCE use the same endpoint as AWS does (169.254.169.254) but different routes. The way datadog implemented the code is: if status code 404 discard response, if not, use response without further validation. So we ended up having hosts named after a 404 page which would break the Datadog UI. Forwarding the status code as well for proxied requests fixed the issue for us.

I am happy to open an issue if further discussion is required.

ryan-lane commented 6 years ago

Ah, this change totally makes sense. Thanks for the PR!

ryan-lane commented 6 years ago

Just released this fix as 1.6.0. Should be in dockerhub and pypi shortly.