Skip to content

Add request_excluded tag to appsec.waf.requests metric#11744

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits into
masterfrom
alejandro.gonzalez/APPSEC-62739-request-excluded-tag
Jul 1, 2026
Merged

Add request_excluded tag to appsec.waf.requests metric#11744
gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits into
masterfrom
alejandro.gonzalez/APPSEC-62739-request-excluded-tag

Conversation

@jandro996

@jandro996 jandro996 commented Jun 25, 2026

Copy link
Copy Markdown
Member

What Does This Do

  • Adds a new request_excluded tag to the appsec.waf.requests telemetry metric in WafMetricCollector
  • Expands WAF_REQUEST_COMBINATIONS from 128 (2^7) to 256 (2^8) to accommodate the new boolean dimension
  • Adds requestExcluded as the 8th parameter to wafRequest() and computeWafRequestIndex(), using bit 7 (1 << 7)
  • Emits request_excluded:full when a request was excluded, request_excluded:none otherwise (always explicit per team guidance)
  • Adds wafRequestExcluded field, setWafRequestExcluded(), and isWafRequestExcluded() to AppSecRequestContext, following the existing wafBlocked / wafTruncated pattern
  • Wires ctx.isWafRequestExcluded() as the 8th argument in GatewayBridge when calling wafMetricCollector.wafRequest() at end-of-request
  • Updates WafMetricPeriodicActionSpecification to pass the 8th argument and assert request_excluded:none in all expected tag lists

Implementation note

setWafRequestExcluded() is intentionally never called today: libddwaf 1.30.0 does not expose exclusion filter results in its output (ddwaf_result only carries events, actions, duration, timeout, attributes, keep). All requests therefore emit request_excluded:none as a baseline. The RFC itself acknowledges this: "At the time of writing, this information is not available, however the interface of libddwaf will be updated to propagate this information." The setter will be activated once libddwaf exposes that data.

Motivation

Implements the request_excluded tag defined in the In-App WAF Error Telemetry RFC for the appsec.waf.requests metric. The RFC changed this tag from a boolean to a string with values full (fully excluded) and partial (partially excluded). Per team guidance, tags must always be emitted explicitly rather than left implicit/undefined.

Jira ticket: APPSEC-62739

Additional Notes

Tag values defined by the RFC:

  • full — request was fully excluded by an exclusion filter (not yet emitted, pending libddwaf update)
  • partial — request was partially excluded (future use)
  • none — request was not excluded (current baseline for all requests)

All 256 boolean combinations of the 8 WAF request flags are covered by the parameterized test in WafMetricCollectorTest.

Contributor Checklist

Note: Once your PR is ready to merge, add it to the merge queue by commenting /merge. /merge -c cancels 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.

Adds the `request_excluded` tag to the `appsec.waf.requests` telemetry
metric as required by the ASM Tags RFC. The tag emits string values
`full`/`partial` (per RFC) with `none` as the baseline until libddwaf
exposes exclusion filter data in its result.

- WafMetricCollector: WAF_REQUEST_COMBINATIONS 128->256 (2^8), new
  requestExcluded boolean in bitmask (bit 7), tag emits "full"/"none"
- AppSecRequestContext: wafRequestExcluded field + getter/setter
- GatewayBridge: passes ctx.isWafRequestExcluded() as 8th arg
- WafMetricCollectorTest: 256 combinations, wafInit added to given block
- Add metric.value == 1 assertion in waf request metrics test
- Add requestMetrics.size() == 1 guard assertion
- Add placeholder comment on setWafRequestExcluded() (libddwaf blocker)
- Apply spotless formatting
Update wafRequest mock expectation from 7 to 8 wildcard arguments
to match the new requestExcluded parameter added in APPSEC-62739.
@jandro996

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8aadb97311

ℹ️ 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".

Add missing requestExcluded (false) 8th argument to all wafRequest calls
and add request_excluded:none to all expected tag lists.

Found by Codex review of PR #11744.
@jandro996

Copy link
Copy Markdown
Member Author

Fixed in b130f0d: updated all 18 wafRequest calls in WafMetricPeriodicActionSpecification to pass the 8th requestExcluded=false argument, and added request_excluded:none to all expected tag lists.

@dd-octo-sts

dd-octo-sts Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.06 s 13.99 s [-0.3%; +1.4%] (no difference)
startup:insecure-bank:tracing:Agent 13.01 s 13.07 s [-1.2%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 16.99 s 16.65 s [+0.9%; +3.1%] (maybe worse)
startup:petclinic:iast:Agent 16.93 s 16.94 s [-1.0%; +0.8%] (no difference)
startup:petclinic:profiling:Agent 16.93 s 16.89 s [-0.7%; +1.2%] (no difference)
startup:petclinic:sca:Agent 16.57 s 16.82 s [-5.9%; +3.0%] (no difference)
startup:petclinic:tracing:Agent 16.10 s 16.01 s [-0.4%; +1.5%] (no difference)

Commit: a0e6ae12 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@jandro996 jandro996 added type: feature Enhancements and improvements comp: asm waf Application Security Management (WAF) labels Jun 26, 2026
@jandro996
jandro996 marked this pull request as ready for review June 30, 2026 08:53
@jandro996
jandro996 requested a review from a team as a code owner June 30, 2026 08:53
@jandro996
jandro996 added this pull request to the merge queue Jul 1, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 1, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-01 08:05:50 UTC ℹ️ Start processing command /merge


2026-07-01 08:05:55 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 2h (p90).


2026-07-01 09:17:42 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 1, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 98481ff into master Jul 1, 2026
586 of 589 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the alejandro.gonzalez/APPSEC-62739-request-excluded-tag branch July 1, 2026 09:17
@github-actions github-actions Bot added this to the 1.64.0 milestone Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: asm waf Application Security Management (WAF) type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants