Skip to content

Improve AWS metadata retrieval by supporting IMDSv1 fallback #2214

@jinmay

Description

@jinmay

Is your feature request related to a problem? Please describe.
Currently, when retrieving AWS metadata, only IMDSv2 is supported. While IMDSv2 is more secure, it would be beneficial to also support IMDSv1 as an option.

Describe the solution you'd like
Attempt to request IMDSv2 first, and if it fails, fallback to IMDSv1. This approach ensures compatibility with environments where IMDSv2 is not enabled.

Describe alternatives you've considered
To request IMDSv2, an API token is required. The implementation will first request a token, and if it receives a 401 Unauthorized response, it will assume that IMDSv2 is disabled and proceed with an IMDSv1 request instead.
All requests will include up to five retries with exponential backoff.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions