Skip to content

Add block ID to block & redirect action parameters & event#459

Merged
Anilm3 merged 4 commits into
masterfrom
anilm3/block_id
Sep 26, 2025
Merged

Add block ID to block & redirect action parameters & event#459
Anilm3 merged 4 commits into
masterfrom
anilm3/block_id

Conversation

@Anilm3

@Anilm3 Anilm3 commented Sep 25, 2025

Copy link
Copy Markdown
Collaborator

This PR introduces an ID to the block_request and redirect_request action parameters, as well as the underlying event. This allows the WAF caller to link an event which resulted in a blocking action to the response provided to the actual application user (.e.g by displaying the ID in the HTML).

The generated ID is a UUIDv4 and it'll be included in the result as follows:

events:
  - rule:
      ...
      on_match:
        - block
    rule_matches: ...
    block_id: cfe3688e-993d-11f0-b50d-c785d6db0d0e
actions:
  block_request:
    grpc_status_code: 10
    type: auto
    status_code: 403
    block_id: cfe3688e-993d-11f0-b50d-c785d6db0d0e

This feature is defined in RFC-1070.

Related Jiras: APPSEC-59279

@Anilm3
Anilm3 marked this pull request as ready for review September 25, 2025 09:05
@Anilm3
Anilm3 requested a review from a team as a code owner September 25, 2025 09:05

@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.

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

Comment thread src/serializer.cpp
@codecov-commenter

codecov-commenter commented Sep 25, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.87879% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.23%. Comparing base (5c5c376) to head (df178ae).

Files with missing lines Patch % Lines
src/configuration/actions_parser.cpp 81.25% 0 Missing and 3 partials ⚠️
src/serializer.cpp 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #459      +/-   ##
==========================================
- Coverage   85.23%   85.23%   -0.01%     
==========================================
  Files         186      186              
  Lines        9347     9366      +19     
  Branches     4138     4154      +16     
==========================================
+ Hits         7967     7983      +16     
  Misses        551      551              
- Partials      829      832       +3     
Flag Coverage Δ
waf_test 85.23% <87.87%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Sep 25, 2025

Copy link
Copy Markdown

Artifact Size Comparison 📦

Artifact Previous Release This PR Difference
darwin-arm64::libddwaf.a 89560336 89888872 0.00%
darwin-arm64::libddwaf.a.stripped 4545616 4571752 0.00%
darwin-arm64::libddwaf.dylib 1960784 1963024 0.00%
darwin-universal::libddwaf.a 180532808 181191448 0.00%
darwin-universal::libddwaf.a.stripped 9690824 9745872 0.00%
darwin-universal::libddwaf.dylib 4139856 4142096 0.00%
darwin-x86_64::libddwaf.a 90972424 91302528 0.00%
darwin-x86_64::libddwaf.a.stripped 5145160 5174072 0.00%
darwin-x86_64::libddwaf.dylib 2147776 2150888 0.00%
linux-aarch64::libddwaf.a 72647358 73040580 0.00%
linux-aarch64::libddwaf.a.stripped 11778162 11829000 0.00%
linux-aarch64::libddwaf.so 2453368 2458336 0.00%
linux-armv7::libddwaf.a 64279684 64608374 0.00%
linux-armv7::libddwaf.a.stripped 10783356 10828698 0.00%
linux-armv7::libddwaf.so 2138996 2143676 0.00%
linux-i386::libddwaf.a 62427430 62736054 0.00%
linux-i386::libddwaf.a.stripped 9321362 9360486 0.00%
linux-i386::libddwaf.so 2382908 2387828 0.00%
linux-x86_64::libddwaf.a 73129494 73523164 0.00%
linux-x86_64::libddwaf.a.stripped 11599138 11647736 0.00%
linux-x86_64::libddwaf.so 2649632 2655008 0.00%
windows-arm64::ddwaf.dll 4769280 4781056 0.00%
windows-arm64::ddwaf.lib 11698 11698 0.00%
windows-arm64::ddwaf_static.lib 57431616 57808332 0.00%
windows-win32::ddwaf.dll 3356160 3362816 0.00%
windows-win32::ddwaf.lib 11922 11922 0.00%
windows-win32::ddwaf_static.lib 49113786 49455380 0.00%
windows-x64::ddwaf.dll 4088832 4096512 0.00%
windows-x64::ddwaf.lib 11698 11698 0.00%
windows-x64::ddwaf_static.lib 56948354 57322904 0.00%
windows-x86_64::libddwaf.a 6464848 6517000 0.00%
windows-x86_64::libddwaf.dll 18860246 18875530 0.00%
windows-x86_64::libddwaf.dll.a 31948 31948 0.00%

@pr-commenter

pr-commenter Bot commented Sep 25, 2025

Copy link
Copy Markdown

Benchmarks clang

Benchmark execution time: 2025-09-26 13:27:34

Comparing candidate commit 7d29c2f in PR branch anilm3/block_id with baseline commit 5c5c376 in branch master.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 0 metrics, 0 unstable metrics.

scenario:global-benchmark.random.clang

  • 🟩 execution_time [-40.996ms; -40.984ms] or [-14.397%; -14.393%]

@pr-commenter

pr-commenter Bot commented Sep 25, 2025

Copy link
Copy Markdown

Benchmarks gcc

Benchmark execution time: 2025-09-26 13:28:47

Comparing candidate commit 7d29c2f in PR branch anilm3/block_id with baseline commit 5c5c376 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

@Anilm3 Anilm3 changed the title Add block ID to blocking event and blocking action parameters Add block ID to block & redirect action parameters & event Sep 25, 2025
@Anilm3

Anilm3 commented Sep 25, 2025

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

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

@pr-commenter

pr-commenter Bot commented Sep 25, 2025

Copy link
Copy Markdown

Benchmarks clang-pgo

Benchmark execution time: 2025-09-26 13:42:53

Comparing candidate commit 7d29c2f in PR branch anilm3/block_id with baseline commit 5c5c376 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

@Anilm3
Anilm3 merged commit bf56f8c into master Sep 26, 2025
109 checks passed
@Anilm3
Anilm3 deleted the anilm3/block_id branch September 26, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants