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: 56c4831 | 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).
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, merged by ruleidrather than a wholesale file replace to avoid dropping tracer-only rules.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 — no tracer-only entries in either array.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").crs-944-140, previously tracer-added, is now upstream with new content and is treated as a normal synced rule.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.