Skip to content

feat: add AWS delegated authentication support#1112

Draft
jchrostek-dd wants to merge 3 commits intomainfrom
john/aws-auth
Draft

feat: add AWS delegated authentication support#1112
jchrostek-dd wants to merge 3 commits intomainfrom
john/aws-auth

Conversation

@jchrostek-dd
Copy link
Contributor

Summary

Add support for AWS delegated authentication, allowing Lambda functions to authenticate with Datadog using their IAM role instead of static API keys. This mirrors the implementation in the main Datadog agent (PR #46272).

How it works:

  1. Lambda function's IAM role signs an STS GetCallerIdentity request
  2. The signed request is sent to Datadog's /api/v2/intake-key endpoint as authentication proof
  3. If the role is configured in Datadog's intake mapping, a managed API key is returned
  4. Falls back to other API key methods (Secrets Manager, KMS, SSM, static) if delegated auth fails

Configuration:

  • DD_ORG_UUID - Datadog org UUID (auto-enables delegated auth when set)
  • DD_DELEGATED_AUTH_ENABLED - Explicit enable/disable (optional)
  • DD_DELEGATED_AUTH_REFRESH_INTERVAL - Key refresh interval (optional)

Changes

  • New module: bottlecap/src/delegated_auth/ - STS proof generation and intake-key client
  • Config: Added DD_ORG_UUID, DD_DELEGATED_AUTH_ENABLED, DD_DELEGATED_AUTH_REFRESH_INTERVAL
  • API key resolution: Integrated as Priority 1 with graceful fallback
  • Integration tests: Added CDK stack and tests for delegated auth flow

Test plan

  • All 513 unit tests pass (cargo test)
  • cargo fmt --check passes
  • cargo clippy -- -D warnings passes
  • Integration tests require intake mapping to be configured in Datadog

Note: Full integration testing requires configuring an intake mapping in Datadog for the Lambda's IAM role ARN.

🤖 Generated with Claude Code

jchrostek-dd and others added 3 commits March 18, 2026 09:11
- Move clippy allow attribute to correct position in auth_proof.rs
- Reorder functions in client.rs (public function first, helpers below)
- Consolidate site mapping examples into doc comment

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add support for AWS delegated authentication, allowing Lambda functions
to authenticate with Datadog using their IAM role instead of static
API keys.

Changes:
- Add delegated_auth module with STS proof generation and intake-key client
- Add config: DD_ORG_UUID, DD_DELEGATED_AUTH_ENABLED
- Integrate as Priority 1 in API key resolution with fallback
- Add integration tests for delegated auth flow

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Clippy was failing due to unwrap_used lint violations in test code.
Replaced all .unwrap() calls with .expect() with descriptive messages.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant