Repository navigation
JULIO-11: cross-component prototype (do not merge) - #885
Draft
Julio-Guerra wants to merge 2 commits into
Draft
Julio-Guerra wants to merge 2 commits into
Julio-Guerra wants to merge 2 commits into
Conversation
Cross-component prototype for JULIO-11 (CADR for AWS Lambda). Do not merge.
Behind DD_APPSEC_AWS_ACCESS_KEY_ID_ENABLED (default false), when tracer
AppSec monitors an HTTP invocation, set aws.lambda.access_key_id on the
aws.lambda span. AWS_ACCESS_KEY_ID is read once, at the first monitored
invocation, and kept only if it matches ^(ASIA|AKIA)[A-Z0-9]{16}$.
AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN are never read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
…_ID_TAG_ENABLED Design change from Julio on JULIO-10 (2026-11-12). The old name was DD_APPSEC_AWS_ACCESS_KEY_ID_ENABLED. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Behind
DD_APPSEC_AWS_ACCESS_KEY_ID_TAG_ENABLED(defaultfalse), when tracer AppSec monitors an HTTP invocation, setaws.lambda.access_key_idon theaws.lambdaspan to the execution environment'sAWS_ACCESS_KEY_ID.datadog_lambda/config.py: newappsec_aws_access_key_id_enabledkey.datadog_lambda/asm.py:_get_aws_access_key_id()readsAWS_ACCESS_KEY_IDonce, at the first monitored invocation (after a SnapStart restore, never before the snapshot), and keeps it only if it matches^(ASIA|AKIA)[A-Z0-9]{16}$.asm_start_requestsets the tag on the span it already receives.AWS_SECRET_ACCESS_KEYandAWS_SESSION_TOKENare never read.Motivation
Every CADR correlation starts from a Workload Protection signal, and Workload Protection does not run on Lambda. The access key ID is constant for an execution environment's life and CloudTrail records it as
userIdentity.accessKeyId, so it can join AAP signals on Lambda to Cloud SIEM signals. This PR checks that the RFC design core (D1 to D8) can be built in the reference component.Testing Guidelines
pytest tests/: 1006 passed, including 17 new cases intests/test_asm.py: tag set on Function URL, API Gateway REST and HTTP, and ALB events (S1); off when unset,falseor0(S2); no tag and no log above debug for empty, missing and malformed values (S5); read once (S6); no tag on SQS; the secret and the token are never read (the test fails if they are, checked by mutation).black --checkclean;flake8clean on the changed files (the other E231 hits are pre-existing).APPSEC_LAMBDA_AWS_ACCESS_KEY_ID,..._DEFAULT) with a v8.130.0 layer with these two modules recompiled in: tag present on the backend payload next to thecrs-930-120event, absent by default, no canary in any payload or log.set_tag), 0.31 µs for the first read, measured locally withtimeit.Additional Notes
AWS_ACCESS_KEY_ID; the runtime usesAWS_CONTAINER_CREDENTIALS_FULL_URIinstead (AWS docs). This code then emits no tag, which is safe, but SnapStart functions are not covered. Raised as an RFC addendum on the Multica issue.DD_SERVERLESS_APPSEC_ENABLEDis set. This code then tags too (same key, same value, same span).Types of Changes
Check all that apply
🤖 Generated with Claude Code