Skip to content

Expand macro functionality #215

Open
@rcbarnett-zz

Description

@rcbarnett-zz

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}

Metadata

Metadata

Assignees

Labels

2.xRelated to ModSecurity version 2.x3.xRelated to ModSecurity version 3.xTBF by libmodsecenhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions