[Feature request] Expose Modsecurity variables to ngx/LUA

Open
#234 3 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
nginx
Domain
security

Research direction

Start by tracing how the connector exposes variables to ngx.var and how the ModSecurity transaction is represented. Determine whether $modsecurity_tx, $modsecurity_env, and $modsecurity_geo, plus matched-rule metadata, are available to expose. Done means the requested transaction data and matched-rule information can be accessed from ngx/LUA.

Written by the indexing model from the issue text.

Description

It would be nice to have the variables of Modsecurity exposed to ngx/LUA (ngx.var).
So we can do some treatment on the transaction (eg. increment a Prometheus counter, set headers, ...)
Something like having the variables $modsecurity_tx, $modsecurity_env, $modsecurity_geo available.
Also having the possibility to get all the rules that matched and their metadata (I'm not sure in which var they are stored).
Do you think that's feasible ?

Dominant language
Perl
Stars
1.9k
Forks
312
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from owasp-modsecurity/ModSecurity-nginx

All issues in owasp-modsecurity/ModSecurity-nginx

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.