Skip to content

docs: blog - crs migration part 3#491

Open
fzipi wants to merge 3 commits intomainfrom
blog/crs-migration-part-3
Open

docs: blog - crs migration part 3#491
fzipi wants to merge 3 commits intomainfrom
blog/crs-migration-part-3

Conversation

@fzipi
Copy link
Copy Markdown
Member

@fzipi fzipi commented Apr 2, 2026

No description provided.

fzipi and others added 3 commits April 2, 2026 11:45
Covers the plugin architecture change, introduces the plugin registry,
maps all CRS 3 application exclusion packages to their CRS 4 plugin
equivalents with rule ID ranges, installation methods, multi-app
scoping, and new capability plugins.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The author is already shown from the front matter. Adds the
related-pages shortcode to cross-link migration series posts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@fzipi fzipi requested a review from theseion April 2, 2026 14:46
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: aec151e
Status: ✅  Deploy successful!
Preview URL: https://d286f75b.website-1u6.pages.dev
Branch Preview URL: https://blog-crs-migration-part-3.website-1u6.pages.dev

View logs

Include crs/plugins/*-after.conf
```

This load order matters. Rules in `*-before.conf` run before CRS has processed the request — this is where exclusion rules go, so they can suppress matching before CRS rules fire. Rules in `*-after.conf` run after CRS — this is where scoring rules that need to know the CRS result go.
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.

Suggested change
This load order matters. Rules in `*-before.conf` run before CRS has processed the request — this is where exclusion rules go, so they can suppress matching before CRS rules fire. Rules in `*-after.conf` run after CRS — this is where scoring rules that need to know the CRS result go.
This load order matters. Rules in `*-before.conf` run before CRS has processed the request — this is where exclusion rules go, so they can suppress matching before CRS rules fire. Rules in `*-after.conf` run after CRS — this is where rules go that need to know the CRS scoring result.

/path/to/crs/plugins/wordpress-rule-exclusions-plugin-config.conf
```

Review the config file for any options to set, then reload your WAF.
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.

Suggested change
Review the config file for any options to set, then reload your WAF.
Review the config and README files of the plugin for any options to set, then reload your WAF.


# Symlink each file into the CRS plugins directory
for f in /opt/crs-plugins/wordpress-rule-exclusions-plugin/plugins/*; do
ln -s "$f" /path/to/crs/plugins/
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.

Suggested change
ln -s "$f" /path/to/crs/plugins/
ln -s "${f}" /path/to/crs/plugins/

Comment on lines +159 to +162
SecRule &TX:wordpress-rule-exclusions-plugin_enabled "@eq 0" \
"id:9507010,phase:1,pass,nolog,chain"
SecRule WebAppID "!@streq wordpress" \
"t:none,setvar:'tx.wordpress-rule-exclusions-plugin_enabled=0'"
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.

This wouldn't work if the plugin was enabled explicitly, i.e., <plugin>_enabled=1.

Suggested change
SecRule &TX:wordpress-rule-exclusions-plugin_enabled "@eq 0" \
"id:9507010,phase:1,pass,nolog,chain"
SecRule WebAppID "!@streq wordpress" \
"t:none,setvar:'tx.wordpress-rule-exclusions-plugin_enabled=0'"
SecRule WebAppID "!@streq wordpress" \
"id:9507011,t:none,setvar:'tx.wordpress-rule-exclusions-plugin_enabled=0'"


## Using Plugins on Multi-Application Reverse Proxies

If your WAF fronts multiple applications, you likely do not want WordPress exclusion rules to apply to requests going to your API or your phpBB forum. CRS 4 plugins support per-virtual-host scoping via `SecWebAppID` (ModSecurity) or the `Host` header (Coraza):
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.

Suggested change
If your WAF fronts multiple applications, you likely do not want WordPress exclusion rules to apply to requests going to your API or your phpBB forum. CRS 4 plugins support per-virtual-host scoping via `SecWebAppID` (ModSecurity) or the `Host` header (Coraza):
If your WAF fronts multiple applications, you likely do not want WordPress exclusion rules to apply to requests going to your API or your phpBB forum. CRS 4 plugins support per-virtual-host scoping via [`SecWebAppID`](https://github.com/owasp-modsecurity/ModSecurity/wiki/Reference-Manual-%28v2.x%29#secwebappid) (and [`WEBAPPID`](https://github.com/owasp-modsecurity/ModSecurity/wiki/Reference-Manual-%28v2.x%29#webappid) or the `Host` header (Coraza):

"t:none,setvar:'tx.wordpress-rule-exclusions-plugin_enabled=0'"
```

Most official plugins include this pattern commented out in their config file. Review each plugin's `*-config.conf` for the scoping example.
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.

Not true. Only the rule to conditionally disable a plugin is present in most plugins, not the scoping part.

Suggested change
Most official plugins include this pattern commented out in their config file. Review each plugin's `*-config.conf` for the scoping example.

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.

2 participants