iam auth
Vault validates a signed GetCallerIdentity request.
Chapter 12 of 16 · Application/workload user · orders-api
Authenticate an AWS workload by proving IAM identity through a signed request instead of distributing a Vault login secret.
AWS CLI and a named learning profile for identity inspection; the lab itself stays offline.
An AWS workload-auth role is bound to the intended account and exact IAM principal without static keys.
| Owner | Consumer-facing responsibility |
|---|---|
| You own | Defines consumption, validation, reload, and stop-using behavior. |
| Platform team owns | Provides trusted runtime identity, protected delivery, network, and telemetry. |
| Vault owns | Operates auth mounts, policies, engines, audit, and recovery. |
Vault validates a signed GetCallerIdentity request.
Vault validates instance identity with different trade-offs.
The SDK's ordered sources for temporary credentials.
The AWS identity or attributes a Vault role accepts.
aws sso login --profile vault-learning
aws sts get-caller-identity \
--profile vault-learning \
--query '{Account:Account,Arn:Arn}' --output json
aws configure get region --profile vault-learning
AWS_PROFILE=vault-learning AWS_REGION=us-east-2 \
vault login -method=aws -no-print role=lockbox-orders-api
vault token lookup -format=json \
| jq '{policies:.data.policies,ttl:.data.ttl}'
The AWS auth client signs the request through the standard provider chain. The signed URL, headers, and body never need to be copied into shell variables or logs. Use the region approved for the platform-supplied Vault role.
| Symptom | Vault rejects AWS login or maps the wrong role. |
|---|---|
| Likely causes | Wrong provider identity, role binding, STS endpoint, clock, X-Vault-AWS-IAM-Server-ID header mismatch, or server-side AWS permission. |
| Inspect safely | Run get-caller-identity; record account, ARN, role, region, server ID configuration, and time. |
| Do not print | Access keys, session token, signed fields, metadata response, or Vault token. |
Break it: Use a wildcard IAM principal in the role worksheet.
Fix it: Bind the intended account and exact application role after get-caller-identity verification.
Escalate with time, endpoint, auth path, role, mount, namespace when relevant, status code, request ID, and sanitized error class. Never attach a credential or response body.
Platform-supplied external configuration is represented by reserved example inputs; this lab applies nothing.
$0; offline validation with no external resource changes
Use the tracked example and offline validator; real GitLab, AWS, and Kubernetes configuration remains platform-owned.
Complete the offline role worksheet with redacted identity metadata and validate the role contract; no AWS or Vault changes occur.
cd learn-vault/labs/aws-iam
cp role-input.example.json ../../.runtime/aws-role-input.json
python3 validate_role_input.py ../../.runtime/aws-role-input.json
rm -f ../../.runtime/aws-role-input.json
Complete every item in the Verify section using metadata-only evidence; no secret value appears in terminal output or tracked files.
Use the Failure drill and Break it / fix it evidence fields. Stop before broadening policy, weakening identity or TLS checks, or copying secret-bearing diagnostics.
Remove the runtime worksheet. This offline lab creates no external resources.
EC2 orders-api uses its instance role; the Vault role is bound to the intended account and app role.
No. The client sends a signed request for validation.
It proves the selected provider identity.
It would defeat workload isolation.
When pod service-account identity is the intended trust model.
AWS auth removes a distributed Vault secret; the narrow role binding remains the real security boundary.