Skip to content

Add CrowdSec AppSec mode to reverse proxy access control - #734

Open
lixmal wants to merge 1 commit into
mainfrom
reverse-proxy-appsec
Open

Add CrowdSec AppSec mode to reverse proxy access control#734
lixmal wants to merge 1 commit into
mainfrom
reverse-proxy-appsec

Conversation

@lixmal

@lixmal lixmal commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Adds the CrowdSec AppSec (WAF) mode selector to reverse proxy access control, alongside the existing IP reputation control. Backend PR: netbirdio/netbird#6917.

  • Add an AppSec mode selector (disabled/enforce/observe) to the Access Control tab, shown only on clusters that advertise the capability
  • Surface AppSec on the cluster feature list and in the per-service access control summary
  • Render AppSec verdicts in the events table, including the observe-mode badge

Issue ticket number and link

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

netbirdio/docs#889

E2E tests

Optional: override the image tags used by the Playwright e2e workflow.
Defaults to main when omitted.

management-cloud-tag: main
reverse-proxy-tag: main


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features
    • Added AppSec (WAF) support to reverse proxy access controls.
    • Introduced AppSec modes: Off, Enforce, and Observe.
    • Added AppSec capability indicators for domains and clusters, plus new AppSec rule details in access-control summaries.
  • UI Improvements
    • Added an AppSec mode selector with descriptions and icons.
    • Enhanced access-control counts/hover details to include active AppSec rules.
  • Bug Fixes
    • Updated event reason and auth-method displays to correctly surface AppSec verdicts, ban/captcha, and unavailable outcomes.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2aeb417e-0594-4dc0-a074-83cddb7eacfb

📥 Commits

Reviewing files that changed from the base of the PR and between 0e98c0e and a0f4a35.

📒 Files selected for processing (8)
  • src/interfaces/ReverseProxy.ts
  • src/modules/reverse-proxy/ReverseProxyAccessControlRules.tsx
  • src/modules/reverse-proxy/ReverseProxyAppSecInspection.tsx
  • src/modules/reverse-proxy/ReverseProxyModal.tsx
  • src/modules/reverse-proxy/clusters/ClustersFeaturesCell.tsx
  • src/modules/reverse-proxy/events/ReverseProxyEventsAuthMethodCell.tsx
  • src/modules/reverse-proxy/events/ReverseProxyEventsReasonCell.tsx
  • src/modules/reverse-proxy/table/ReverseProxyAccessControlCell.tsx
🚧 Files skipped from review as they are similar to previous changes (8)
  • src/modules/reverse-proxy/clusters/ClustersFeaturesCell.tsx
  • src/modules/reverse-proxy/ReverseProxyAppSecInspection.tsx
  • src/modules/reverse-proxy/table/ReverseProxyAccessControlCell.tsx
  • src/modules/reverse-proxy/events/ReverseProxyEventsAuthMethodCell.tsx
  • src/modules/reverse-proxy/ReverseProxyModal.tsx
  • src/interfaces/ReverseProxy.ts
  • src/modules/reverse-proxy/ReverseProxyAccessControlRules.tsx
  • src/modules/reverse-proxy/events/ReverseProxyEventsReasonCell.tsx

📝 Walkthrough

Walkthrough

Adds AppSec mode contracts and capability flags, a supported-domain configuration selector, AppSec restriction summaries, cluster feature badges, and AppSec event method and verdict displays.

Changes

Reverse proxy AppSec support

Layer / File(s) Summary
AppSec contracts and capabilities
src/interfaces/ReverseProxy.ts
Defines AppSecMode, adds appsec_mode to access restrictions, and adds AppSec capability flags to domains and clusters.
AppSec configuration flow
src/modules/reverse-proxy/ReverseProxyAppSecInspection.tsx, src/modules/reverse-proxy/ReverseProxyAccessControlRules.tsx, src/modules/reverse-proxy/ReverseProxyModal.tsx
Adds the controlled AppSec mode selector and propagates supported-domain AppSec settings into AccessRestrictions.
AppSec status and event rendering
src/modules/reverse-proxy/clusters/ClustersFeaturesCell.tsx, src/modules/reverse-proxy/table/ReverseProxyAccessControlCell.tsx, src/modules/reverse-proxy/events/*
Displays AppSec capabilities and restriction modes, and renders AppSec authentication methods and verdict sources.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ReverseProxyModal
  participant ReverseProxyAccessControlRules
  participant ReverseProxyAppSecInspection
  participant ReverseProxyAccessControlCell
  ReverseProxyModal->>ReverseProxyAccessControlRules: pass supported-domain AppSec capability
  ReverseProxyAccessControlRules->>ReverseProxyAppSecInspection: render selected AppSec mode
  ReverseProxyAppSecInspection->>ReverseProxyAccessControlRules: return selected mode
  ReverseProxyAccessControlRules->>ReverseProxyModal: emit restrictions with appsec_mode
  ReverseProxyAccessControlCell->>ReverseProxyAccessControlCell: summarize AppSec restriction state
Loading

Possibly related PRs

  • netbirdio/dashboard#730: Both changes modify the reverse proxy access-restrictions conversion path and its AccessRestrictions fields.

Poem

A rabbit toggles WAF modes bright,
Observe by day, enforce by night.
Shields now bloom where clusters stand,
Verdicts hop across the dashboard land.
AppSec joins the proxy trail—
Soft ears cheer the guarded tale! 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: adding CrowdSec AppSec mode to reverse proxy access control.
Description check ✅ Passed The description mostly matches the template and includes docs and E2E details, but it omits the issue ticket number and link.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch reverse-proxy-appsec

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/interfaces/ReverseProxy.ts

Oops! Something went wrong! :(

ESLint: 9.39.3

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'configs' -> object with constructor 'Object'
| property 'flat' -> object with constructor 'Object'
| ...
| property 'plugins' -> object with constructor 'Object'
--- property 'react' closes the circle
Referenced from: /.eslintrc.json
at JSON.stringify ()
at /node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2255:45
at Array.map ()
at ConfigValidator.formatErrors (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2246:23)
at ConfigValidator.validateConfigSchema (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2277:84)
at ConfigArrayFactory._normalizeConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3123:19)
at ConfigArrayFactory._loadConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3088:21)
at ConfigArrayFactory._loadExtendedShareableConfig (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3393:21)
at ConfigArrayFactory._loadExtends (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3261:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3199:25)
(node:2) ESLintRCWarning: You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.
(Use node --trace-warnings ... to show where the warning was created)

src/modules/reverse-proxy/ReverseProxyAccessControlRules.tsx

Oops! Something went wrong! :(

ESLint: 9.39.3

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'configs' -> object with constructor 'Object'
| property 'flat' -> object with constructor 'Object'
| ...
| property 'plugins' -> object with constructor 'Object'
--- property 'react' closes the circle
Referenced from: /.eslintrc.json
at JSON.stringify ()
at /node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2255:45
at Array.map ()
at ConfigValidator.formatErrors (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2246:23)
at ConfigValidator.validateConfigSchema (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2277:84)
at ConfigArrayFactory._normalizeConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3123:19)
at ConfigArrayFactory._loadConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3088:21)
at ConfigArrayFactory._loadExtendedShareableConfig (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3393:21)
at ConfigArrayFactory._loadExtends (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3261:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3199:25)
(node:2) ESLintRCWarning: You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.
(Use node --trace-warnings ... to show where the warning was created)

src/modules/reverse-proxy/ReverseProxyAppSecInspection.tsx

Oops! Something went wrong! :(

ESLint: 9.39.3

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'configs' -> object with constructor 'Object'
| property 'flat' -> object with constructor 'Object'
| ...
| property 'plugins' -> object with constructor 'Object'
--- property 'react' closes the circle
Referenced from: /.eslintrc.json
at JSON.stringify ()
at /node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2255:45
at Array.map ()
at ConfigValidator.formatErrors (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2246:23)
at ConfigValidator.validateConfigSchema (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2277:84)
at ConfigArrayFactory._normalizeConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3123:19)
at ConfigArrayFactory._loadConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3088:21)
at ConfigArrayFactory._loadExtendedShareableConfig (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3393:21)
at ConfigArrayFactory._loadExtends (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3261:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3199:25)
(node:2) ESLintRCWarning: You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.
(Use node --trace-warnings ... to show where the warning was created)

  • 5 others

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.

@lixmal
lixmal changed the base branch from reverse-proxy-allow-match-toggle to main July 27, 2026 13:15
@lixmal
lixmal force-pushed the reverse-proxy-appsec branch from b2b9a5d to 0e98c0e Compare July 27, 2026 13:15

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/modules/reverse-proxy/ReverseProxyModal.tsx`:
- Line 817: Update the supportsAppSec prop in ReverseProxyModal to enable AppSec
only when the selected service protocol is HTTP, while preserving the existing
selectedDomain?.supports_appsec capability check for HTTP services.

In `@src/modules/reverse-proxy/table/ReverseProxyAccessControlCell.tsx`:
- Around line 56-58: Update the supportsAppSec lookup in
ReverseProxyAccessControlCell to match the selected service against either the
domain field or target_cluster, so reverseProxy.proxy_cluster values from
ReverseProxyModal resolve the correct capability and preserve the existing
AppSec summary behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3b824167-cd9b-4776-bde5-26c7b4d524c7

📥 Commits

Reviewing files that changed from the base of the PR and between 6ca9128 and 0e98c0e.

📒 Files selected for processing (8)
  • src/interfaces/ReverseProxy.ts
  • src/modules/reverse-proxy/ReverseProxyAccessControlRules.tsx
  • src/modules/reverse-proxy/ReverseProxyAppSecInspection.tsx
  • src/modules/reverse-proxy/ReverseProxyModal.tsx
  • src/modules/reverse-proxy/clusters/ClustersFeaturesCell.tsx
  • src/modules/reverse-proxy/events/ReverseProxyEventsAuthMethodCell.tsx
  • src/modules/reverse-proxy/events/ReverseProxyEventsReasonCell.tsx
  • src/modules/reverse-proxy/table/ReverseProxyAccessControlCell.tsx

Comment thread src/modules/reverse-proxy/ReverseProxyModal.tsx Outdated
Comment thread src/modules/reverse-proxy/table/ReverseProxyAccessControlCell.tsx Outdated
@lixmal
lixmal force-pushed the reverse-proxy-appsec branch from 0e98c0e to a0f4a35 Compare July 27, 2026 13:56
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