Skip to content

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

Merged
JayBeale merged 2 commits intoinguardians:mainfrom
rileydakota:main
Apr 29, 2024
Merged

feat: Add support for detecting AWS as a cloud provider when IMDSv2 is in use#55
JayBeale merged 2 commits intoinguardians:mainfrom
rileydakota:main

Conversation

@rileydakota
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@JayBeale
Copy link
Copy Markdown
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