Skip to content

feat(waf): run phase 5 on blocked transactions (barbacane-waf 0.1.1) - #161

Merged
ndreno merged 1 commit into
mainfrom
feat/waf-phase5-audit-on-block
Sep 12, 2026
Merged

ndreno merged 1 commit into
mainfrom
feat/waf-phase5-audit-on-block

Conversation

@ndreno

@ndreno ndreno commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Completes #158 by wiring the parapet#10 engine change into the audit log.

What

barbacane-waf 0.1.1 (parapet#10) runs phase 5 (logging and correlation) after a disruptive verdict, matching ModSecurity. A blocked transaction is now logged and correlated the same as one that passed, so CRS 980xxx correlation rules contribute to the audit record on blocks.

Changes

  • Bump barbacane-waf 0.1.0 → 0.1.1.
  • The response path already calls process_logging in inspect_response; with 0.1.1 it now takes effect after a response-phase block.
  • A request-phase block calls WafInspection::run_logging() before the audit record is written, so request-phase blocks are correlated too (the request path returns before response inspection, so it needs the explicit call).
  • inspect_response doc and the phase-ordering unit test updated: a phase-3 block still skips phase 4 but now runs phase 5.

Tests

  • a_phase_three_block_skips_phase_four_but_runs_phase_five (flipped from the old engine behaviour).
  • Existing audit and response-phase tests unchanged and green: 25 bin unit, 27 integration.
  • clippy (both gates) and fmt clean.

Bump the engine to barbacane-waf 0.1.1, which runs phase 5 (logging and
correlation) after a disruptive verdict (parapet#10). A blocked transaction is
now logged and correlated the same as one that passed, so CRS 980xxx
correlation rules contribute to the audit record.

- The response path already runs phase 5 through inspect_response; it now takes
  effect after a response-phase block.
- A request-phase block calls WafInspection::run_logging() before the audit
  record is written, so the request-block path is correlated too.
- inspect_response doc and the phase-ordering test updated: a phase-3 block
  still skips phase 4 but now runs phase 5.

Closes #158.
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a3a9c029-c139-4a6c-baff-e14896112c26

📥 Commits

Reviewing files that changed from the base of the PR and between 4c840f5 and 9cea8f5.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !**/*.lock, !**/Cargo.lock
📒 Files selected for processing (3)
  • Cargo.toml
  • crates/barbacane/src/main.rs
  • crates/barbacane/src/waf.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ndreno
ndreno merged commit 7dfc39b into main Sep 12, 2026
20 checks passed
@ndreno
ndreno deleted the feat/waf-phase5-audit-on-block branch September 12, 2026 17:39
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.

1 participant