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

Feature request: IMDSv2 support for fetching AWS User data #61

Open
tvanhl opened this issue Oct 28, 2024 · 1 comment
Open

Feature request: IMDSv2 support for fetching AWS User data #61

tvanhl opened this issue Oct 28, 2024 · 1 comment

Comments

@tvanhl
Copy link

tvanhl commented Oct 28, 2024

Hi,

The distribution is wanted to be kept minimal, but I would be suggesting adding Instance Metadata Service version 2 (IMDSv2) support for ucd-data-fetch.

Motivation

If IMDSv2 cannot be enabled, it causes a critical / high open security recommandation "EC2 instances should use Instance Metadata Service Version 2 (IMDSv2)" on AWS. At some point, this maybe needs to be implemented anyway (if e.g. IMDSv1 would be deprecated).

Current behavior

When I set instance metadata option for IMDSv2 from "Optional" to "Required", it seems that the systemd service [email protected] fails with an error:

systemd[1]: Starting [email protected]...
ucd-data-fetch[155]: parse_headers(): Network is unreachable
systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
systemd[1]: [email protected]: Failed with result 'exit-code'.
systemd[1]: Failed to start [email protected].

Suggestion

Support for IMDSv2 could be the default behavior for the ucd-data-fetch in case of AWS. As with a quick testing it looks for me that also IMDSv1 works even if the token (from http://169.254.169.254/latest/api/token) is provided with the instance metadata request.

--

Thank you.

@tvanhl
Copy link
Author

tvanhl commented Dec 27, 2024

Hi @ahkok @bwarden,
Would you have a chance to have a quick look at this ticket?

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