Course contentsShow
← Security
Lesson 1933 of 3,05239. Cloud Security - Compute and ServerlessFree lesson

IMDS Endpoints and Access Patterns

Learn the standard IMDS endpoint (169.254.169.254), API structure, and how instances query metadata programmatically.

IMDS Endpoints and Access Patterns

You'll learn how cloud instances communicate with the metadata service and the technical details that underpin secure metadata retrieval.

The Standard IMDS Endpoint

The Instance Metadata Service lives at a special IP address: 169.254.169.254. This is a link-local address—meaning it's only accessible from within the instance itself, never from the internet or even other instances in your network. Think of it like an internal intercom system that only works inside one building.

This endpoint is identical across AWS, Azure (also uses 169.254.169.254), and GCP, making it a cloud standard for metadata retrieval.

How Instances Query IMDS

Applications and scripts running on your instance make HTTP requests to this endpoint to retrieve metadata. The API follows a hierarchical structure:

  • Base path: http://169.254.169.254/latest/meta-data/
  • Specific queries: Add paths like iam/security-credentials/role-name or instance-id

For example, to get instance identity information:

GET http://169.254.169.254/latest/meta-data/instance-id

To retrieve IAM credentials:

GET http://169.254.169.254/latest/meta-data/iam/security-credentials/[role-name]

Access Pattern Considerations

Any process running on the instance can query IMDS by default. This includes:

  • Your applications
  • System services
  • Containers
  • Malicious code that has gained access

This "open by default" behavior is why IMDS security matters—compromised applications can potentially query sensitive data like temporary credentials.

Key Takeaway: The IMDS endpoint (169.254.169.254) is a link-local HTTP API accessible only from within an instance, using structured paths to retrieve metadata including sensitive IAM credentials—and by default, any process on the instance can query it.