Update default AppSec ruleset to release 1.18.2 - #12099
Conversation
Sync dd-java-agent's bundled default_config.json with the upstream ASM_DD 1.18.2 ruleset (merged by rule id, preserving the two tracer-only rules dog-920-100 and dog-942-001). Adds rules_compat, new fingerprint/JWT processors, and the password credentials scanner. APPSEC-69446
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
🎯 Code Coverage (details) 🔗 Commit SHA: dc1ce33 | Docs | Datadog PR Page | Give us feedback! |
🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)
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. |
Ruleset 1.14.1 made fingerprint processors evaluate unconditionally, so every ordinary request now returns MATCH with no data, breaking system-tests' no-unexpected-logs check. dd-trace-py/dd-trace-go don't log in this case either (both gate on non-empty events, not on the WAF return code).
There was a problem hiding this comment.
More details
The bundled ruleset passed adversarial checks for newly added exploit detections, file-upload extensions, zipslip paths, scanner matching, compatibility gates, and preservation of tracer-only rules. The focused Java test suite could not start because this environment lacks the repository's required Java 25 toolchain and cannot download Gradle.
📊 Validated against 9 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 0700a5b · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0700a5bcda
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
These two rule IDs were leftovers from old commits (#11093 and the 1.5.2 sync) that predate the switch to runtime test-rule injection via smoke test helpers. They were never part of the official ASM ruleset and had no reason to keep diverging from upstream. default_config.json is now an exact copy of the 1.18.2 recommended.json.
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What Does This Do
Syncs
dd-java-agent/appsec/src/main/resources/default_config.json(the bundled AppSec/WAF ruleset) with the upstream ASM_DD 1.18.2 release, as an exact copy of the upstreamrecommended.json.metadata.rules_versionfrom1.13.3to1.18.2.recommended.json.rules_compatkey (17 entries, gated bymin_version: "1.25.0") — covers new JWT/API-security business-logic rules withoutput.attributesderivative tags such as_dd.appsec.api.jwt.no_expiry.processors[](8 entries, addsdecode-auth-jwtandextract-auth) andscanners[](37 entries, adds aPasswordcredentials scanner) wholesale.http-network-fingerprint,http-endpoint-fingerprint,http-header-fingerprint,session-fingerprint) switch fromevaluate: false+ login-gated conditions toevaluate: true+conditions: [], matching upstream — they now run on every request instead of only on login events.dog-920-100("File upload with double extension") anddog-942-001("Blind XSS callback domains"), two stale rule IDs left over from old commits (Add file upload WAF rules from appsec-event-rules#277 #11093 and the 1.5.2 sync) that predate the current test-rule injection strategy (runtime helpers in the smoke tests). They were never part of the official ASM ruleset and had no reason to keep diverging from it.crs-944-140, previously added the same way asdog-920-100, is now upstream with new content and is treated as a normal synced rule.default_config.jsonis now byte-for-byte deep-equal to the officialrecommended.jsonfor release 1.18.2.AppSecConfigServiceImpldeserializes this file generically via Moshi into aMap<String, Object>with no typed schema, so the new top-level key and per-rulemin_version/max_versionfields require no Java-side changes.Follow-up fix: noisy debug log
Because the fingerprint processors above now evaluate on every request,
WAFModule.buildEvents()started hitting itsactionWithData.data == nullbranch on ordinary traffic instead of only in rare edge cases, logging"WAF result data is null"at DEBUG on every request and breaking system-tests'Test_NoExceptions::test_java_telemetry_logs(unexpected-log assertion) on several end-to-end CI jobs.log.debug(...)call (and the now-unusedSEND_TELEMETRYimport), replacing it with a comment explaining why a MATCH-with-no-data result is expected now.dd-trace-pyanddd-trace-godon't log in this case either — both separate real rule "events"/"data" from fingerprint "attributes"/"derivatives" and gate their equivalent debug log on non-empty events, never on the raw WAF return code (MATCH/OK). This change brings dd-trace-java's behavior in line with the other two tracers.Motivation
Keeps the bundled default ruleset current with the latest published ASM event rules release, closing the gap between the tracer's
1.13.3and the current1.18.2.Additional Notes
The always-on fingerprint processors are a real behavior change inherited from upstream (not introduced by this PR) — flagged for
/perf-reviewsince they now evaluate on every request rather than only login events. That same behavior change is what surfaced the pre-existing noisy debug log fixed in the second commit.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: APPSEC-69446
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.