Add HTTP span tags, content-type body parsing, and unsupported-event marking to AWS Lambda AppSec - #12078
Draft
claponcet wants to merge 1 commit into
Draft
Add HTTP span tags, content-type body parsing, and unsupported-event marking to AWS Lambda AppSec#12078claponcet wants to merge 1 commit into
claponcet wants to merge 1 commit into
Conversation
…marking to AWS Lambda AppSec Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🎯 Code Coverage (details) 🔗 Commit SHA: a2816e4 | Docs | Datadog PR Page | Give us feedback! |
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
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 Do
Extends the AWS Lambda AppSec request/response handling (
LambdaAppSecHandler) to close milestone-1 gaps against the Python (datadog-lambda-python) and extension implementations:http.url(query-less, soQueryObfuscatorcan redact and re-append it),http.route,http.useragent,http.method, andhttp.query.stringfrom the event at request-end, mirroringHttpServerDecorator(which Lambda has no equivalent of).http.routefrom API Gateway v1resourceand v2routeKey(method prefix stripped;$defaultand Function-URL routes omitted).application/x-www-form-urlencoded→ structured map, JSON content-types → parsed (malformed JSON dropped, matching the extension), missing content-type → best-effort JSON with raw-string fallback, everything else (incl. multipart) → raw string.extractLowercasedStringMaphelper._dd.appsec.unsupported_event_typemarker: set on the serverless span for non-HTTP events (parsed-but-unknown triggers and non-ByteArrayInputStream/POJO events), mutually exclusive with_dd.appsec.enabled— matching the cross-tracer system-test contract.domainNameon anhttp-shaped event now resolves toAPI_GATEWAY_V2_HTTPrather than defaulting toLAMBDA_URL(consistent with the Rust extension and Python layer).Motivation
Aligns Java Lambda AppSec behavior with the reference implementations so the
java_lambdasystem-test suite can close gaps currently markedmissing_featurerelative topython_lambda.Additional Notes
Behavior verified by unit tests in
LambdaAppSecHandlerTest(127 tests). Multipart bodies are intentionally forwarded as the raw string rather than structurally decomposed (the raw payload stays scannable by string-based WAF rules); structured multipart parsing is noted as follow-up work.Jira ticket: [APPSEC-XXXX]