Skip to content

ec2-metadata: bypass proxy for IMDS requests - #57

Open
reginaldalfret wants to merge 1 commit into
amazonlinux:mainfrom
reginaldalfret:fix/issue-52-ec2-metadata-noproxy
Open

reginaldalfret wants to merge 1 commit into
amazonlinux:mainfrom
reginaldalfret:fix/issue-52-ec2-metadata-noproxy

Conversation

@reginaldalfret

Copy link
Copy Markdown

Summary

When http_proxy or HTTP_PROXY is defined in the environment, ec2-metadata routes requests through the proxy server, failing or returning incorrect metadata from the proxy host rather than the local EC2 instance.

This PR adds --noproxy '*' to the curl calls in set_imds_token and get_meta, ensuring that IMDS requests always connect directly to the instance metadata service regardless of proxy configuration.

Fixes #52

Signed-off-by: reginaldalfret reginaldalfret@gmail.com

When http_proxy or HTTP_PROXY is configured in the environment, curl attempts to route instance metadata requests through the proxy server. Add --noproxy '*' to curl invocations in ec2-metadata so that local metadata requests are always sent directly to IMDS.

Fixes amazonlinux#52

Signed-off-by: reginaldalfret <reginaldalfret@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ec2-metadata honors HTTP_PROXY environment variable

1 participant