Skip to content

feat: add AWS IAM identity verification auth method#8

Draft
alukach wants to merge 2 commits intorefactor/new-architecturefrom
claude/cloudflare-proxy-auth-review-YpBKW
Draft

feat: add AWS IAM identity verification auth method#8
alukach wants to merge 2 commits intorefactor/new-architecturefrom
claude/cloudflare-proxy-auth-review-YpBKW

Conversation

@alukach
Copy link
Member

@alukach alukach commented Mar 6, 2026

Summary

  • Adds AssumeRoleWithAWSIdentity STS action, allowing AWS services (Lambda, EC2, ECS) to authenticate with the proxy using their existing IAM credentials — no OIDC provider or long-lived secrets needed
  • Follows the same pattern as HashiCorp Vault's AWS auth method: client signs a GetCallerIdentity request, sends the signed headers to the proxy as base64-encoded query params, and the proxy forwards them to AWS STS for cryptographic identity verification
  • The verified ARN/account is checked against the role's trusted_aws_accounts and subject_conditions, then temporary credentials are minted via the existing pipeline

Changes

  • crates/core/src/types.rs — Add trusted_aws_accounts to RoleConfig
  • crates/core/src/config/static_file.rs — Relax validation: roles need OIDC issuers OR AWS accounts (3 new tests)
  • crates/sts/src/aws_identity.rs (new) — STS URL allowlist validation, GetCallerIdentity XML parsing, request forwarding (12 new tests)
  • crates/sts/src/lib.rs — Add assume_role_with_aws_identity(), update try_handle_sts() for both auth flows
  • crates/sts/src/route_handler.rs — Pass HTTP client through to handler
  • crates/sts/src/jwks.rs — Add http_client() accessor on JwksCache
  • docs/auth/aws-iam-auth.md (new) — Full docs with sequence diagrams, config examples, Python client example
  • docs/auth/proxy-auth.md — Updated auth modes table

Test plan

  • cargo build succeeds
  • cargo test — all 111 tests pass (15 new tests)
  • Config validation tests
  • STS URL validation tests
  • XML parsing tests
  • Request parsing tests
  • Manual integration test with real AWS credentials

Allow AWS services (Lambda, EC2, ECS) to authenticate with the proxy
using their existing IAM credentials via AssumeRoleWithAWSIdentity,
without needing an OIDC provider or long-lived secrets.

The flow follows HashiCorp Vault's aws auth pattern: the client signs
a GetCallerIdentity request, sends the signed headers to the proxy as
base64-encoded query parameters, and the proxy forwards them to AWS
STS for cryptographic identity verification. The verified ARN is then
checked against the role's trusted_aws_accounts and subject_conditions
before minting temporary credentials via the existing pipeline.

Changes:
- Add trusted_aws_accounts field to RoleConfig
- Relax validation: roles need OIDC issuers OR AWS accounts
- New aws_identity module: STS URL validation, request forwarding,
  GetCallerIdentity XML parsing
- Wire AssumeRoleWithAWSIdentity into try_handle_sts()
- Expose JwksCache HTTP client for reuse
- Add docs/auth/aws-iam-auth.md with flow diagrams and Python examples

https://claude.ai/code/session_01DeybF37mu27EMVd4kR57Xh
@github-actions github-actions bot added the feat label Mar 6, 2026
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🚀 Latest commit deployed to https://multistore-proxy-pr-8.alukach.workers.dev

  • Date: 2026-03-06T03:01:25Z
  • Commit: 65f316c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants