[nodejs@ugaitz/fix-possible-memory-leak] Add API10 system tests for downstream response body limits#7046
Draft
uurien wants to merge 3 commits into
Draft
[nodejs@ugaitz/fix-possible-memory-leak] Add API10 system tests for downstream response body limits#7046uurien wants to merge 3 commits into
uurien wants to merge 3 commits into
Conversation
Exercise content-type, content-length, and max-bytes guards on Node
Express via dedicated /external_request/{failure_reason} routes backed by
internal_server mocks. Enable tests on express4/express5 with dd-trace
>=5.106.0 and set DD_API_SECURITY_MAX_DOWNSTREAM_BODY_BYTES=128 in APPSEC_RASP.
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
|
Contributor
|
0d47d61 to
767304f
Compare
Avoid route conflict with /external_request/redirect in Express. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Motivation
Add end-to-end coverage for API10 downstream HTTP response body collection limits in Node.js (Express). These guards are implemented in dd-trace-js (
DD_API_SECURITY_MAX_DOWNSTREAM_BODY_BYTES, content-type, and content-length checks) and need system-tests to validate that skipped collection is reflected in span metrics and thatres_bodyis not attached when collection is ignored.Changes
internal_server: addGET /downstream_response/{profile}with controlled responses forinvalid_content_type,content_length_missing(chunked), andcontent_length_too_big.GET /external_request/{failure_reason}mapping to internal-server profiles (keep/external_requestand/external_request/redirectunchanged).APPSEC_RASPscenario: setDD_API_SECURITY_MAX_DOWNSTREAM_BODY_BYTES=128so limits are easy to trigger in CI.test_api10.py: add three tests assertingresponse_body_ignored.*metrics and absence of_dd.appsec.trace.res_bodyfor each failure reason.manifests/nodejs.yml: enable new tests onexpress4/express5withdd-trace >= 5.106.0.config_norm_rules.json: registerDD_API_SECURITY_MAX_DOWNSTREAM_BODY_BYTES./external_request/{failure_reason}in the end-to-end weblog spec.Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present