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

feat: Add support for detecting AWS as a cloud provider when IMDSv2 is in use #55

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

rileydakota
Copy link
Contributor

This PR adds support for AWS IMDSv2.
Screenshot 2024-04-28 at 11 40 27 AM

I am not in love with the abstraction and would be willing to alter based on suggestions. I had to change the implementation of GetRequests to return the statusCode, as with IMDSv2, the successful response body ends up being the token used for interacting with IMDSv2, so it felt hacky to rely on just trying to verify it via the body with something like a regex.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-metadata-v2-how-it-works.html

@rileydakota
Copy link
Contributor Author

I also just realized I didn't implement this for getting AWS credentials from IMDSv2, only the detection, ill take a look at adding that too

@JayBeale
Copy link
Member

This is wonderful - thank you, Riley!

Merging and adding you to credits too!

Looking forward to anything you can do on fetching credentials.

@JayBeale JayBeale merged commit b3507bc into inguardians:main Apr 29, 2024
4 checks passed
@JayBeale
Copy link
Member

Can I put a Twitter handle in the credits file for you?

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.

2 participants