Open
Description
MODSEC-64: Some ideas for making macros more useful:
- %{&COLLECTION} -- count of COLLECTION variables
- %{t(lowercase,ARGS)} -- Allow transformations in macros
- %{rand(N)} -- Allow other functions like random values (should be extendible via API)
- Allow defining macros -- SecMacro FOO "foo"
These are config time macros vs runtime. Maybe use %{{CONFIG_MACRO}}? - Allow defining macros with parameters -- SecMacro FOO(bar) "foo%{bar}"
- Allow macro expansion in TARGETS (at least config-time) -- ARGS|%{{CUSTOM_FIELDS}}
{noformat}
SecMacro CUSTOM_TARGETS "ARGS|!ARGS:description"
...
SecRule %{{CUSTOM_TARGETS}} "foo" "..."
{noformat}