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

AWS Metadata is only for v1 metadata service, needs to be modified for v2 metadata service #1

Open
SoloDefend opened this issue Jan 10, 2022 · 0 comments

Comments

@SoloDefend
Copy link

SoloDefend commented Jan 10, 2022

The AWS metadata checks will only work on v1 endpoints, which are becoming harder to find. You will need to request a token with a PUT request, and then use that token in subsequent metadata requests.

Excuse the formatting, far too lazy today to deal with escaping backticks.

Example:

get a valid token for use / refresh the token

TOKEN=curl -X PUT http://169.254.169.254/latest/api/token -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" && curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/

get the key materials

curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/iam/security-credentials/

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

No branches or pull requests

1 participant