feat: optimize DSL rule phases and refactor zone types#3878
feat: optimize DSL rule phases and refactor zone types#3878LaurenceJJones wants to merge 10 commits intocrowdsecurity:masterfrom
Conversation
LaurenceJJones
commented
Sep 10, 2025
- Auto-optimize rules to phase 1 when possible (headers, method, URI, GET args)
- Maintain phase 2 for body-dependent zones (POST args, files, raw body)
- Enforce same-phase constraint for chained (AND) rules
- Allow independent phase optimization for OR rules
- Replace string maps with typed Zone struct for better maintainability
- Add comprehensive tests for mixed-phase scenarios
- Auto-optimize rules to phase 1 when possible (headers, method, URI, GET args) - Maintain phase 2 for body-dependent zones (POST args, files, raw body) - Enforce same-phase constraint for chained (AND) rules - Allow independent phase optimization for OR rules - Replace string maps with typed Zone struct for better maintainability - Add comprehensive tests for mixed-phase scenarios
|
@LaurenceJJones: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
|
@LaurenceJJones: There are no area labels on this PR. You can add as many areas as you see fit.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
|
/kind feature |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3878 +/- ##
==========================================
- Coverage 63.39% 62.89% -0.51%
==========================================
Files 451 468 +17
Lines 32543 33317 +774
==========================================
+ Hits 20632 20954 +322
- Misses 9833 10240 +407
- Partials 2078 2123 +45
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Manually run hub tests, results below 100% coverage, which makes sense since we changing phases should not impact effectiveness of rules. phase 2 rules: phase 1 rules: You can see most rules will optimize into |
Removed OR handling from determineOptimalPhase and determineChainPhase as OR cases within AND chains are not currently feasible to implement correctly with ModSecurity's chain directive.