Added
- A dead exclusion tag logs a warning. A tag-scoped exclusion is a silent no-op when no loaded rule carries its tag (e.g. a CRS 3 tag like
OWASP_CRS/WEB_ATTACK/SQL_INJECTIONagainst the CRS 4 snapshot, whose tags areattack-sqliand friends); with a PSR-3 logger onCoreRuleSetMatchersuch a tag now logs awarningonce the rules are loaded. CoversexcludeTargetByTag()and the tag-scoped CRS exclusion directives andctl:actions. - Conditional target exclusions. Every
excludeTarget*method onCoreRuleSetandCoreRuleSetMatcheraccepts awhen:condition (TargetExclusionConditionInterfaceor a closurefn (string $variable, ?string $name, string $value, ServerRequestInterface $request): bool- the manipulator argument order plus the request; a closure declaring fewer parameters ignores the rest): the selected entry is only excluded while the condition approves its value - e.g. skip SQLi inspection ofARGS:tokenonly when the value is a signature-verified JWT. The request parameter enables context-dependent validation (per-host issuers, path-scoped rules). The condition runs only for entries the selector matches; exceptions it throws propagate like manipulator exceptions and follow the failure policy. - Closure manipulators receive the request.
addManipulator()/addManipulatorById()closures get the request as an additional fourth argument(string $variable, ?string $name, string $value, ServerRequestInterface $request)for context-dependent transformations; existing closures with fewer parameters are unaffected, and the three-parameterRequestValueManipulatorInterfaceis unchanged. - CRS rule-exclusion syntax.
applyRuleExclusions()/applyRuleExclusionsFromFile()onCoreRuleSetandCoreRuleSetMatcher(queued until the rules load, validated eagerly) parse the CRS tuning subset: the configure-time directivesSecRuleRemoveById(ids and ranges),SecRuleRemoveByTag(exact tag),SecRuleUpdateTargetById/SecRuleUpdateTargetByTag(negated!TARGETremovals), and runtime exclusion rules (SecRule ... "...,ctl:..."withruleRemoveById,ruleRemoveByTag,ruleRemoveTargetById,ruleRemoveTargetByTag) evaluated before the scoring rules on every request. Forms the engine cannot evaluate faithfully fail eagerly (chained rules, unsupported operators or variables, target additions); unknown directives and otherctl:options are skipped. Exclusions remain runtime tuning and never enter the compiled-data cache.
Released together with the other Phirewall packages, see the release in flowd/phirewall-src. This repository is a read-only mirror.