tempesta icon indicating copy to clipboard operation
tempesta copied to clipboard

Implementation multi pattern regular expressions

Open biathlon3 opened this issue 1 year ago • 3 comments

biathlon3 avatar Jul 05 '24 14:07 biathlon3

For deployment see file install.txt. Description will be expanded.

biathlon3 avatar Jul 05 '24 14:07 biathlon3

This PR works on Kernel 6.8.9

Description of using hscollider - http://intel.github.io/hyperscan/dev-reference/tools.html

Description of regular expression syntax - https://perldoc.perl.org/perlre It is supported in Hyperscan not fully, constraints described here - http://intel.github.io/hyperscan/dev-reference/compilation.html

Now regex implemented in tempasta config as fallows: for locations, added keyword "regex" and regex started with "^"; for httptables, regex started with "^".

for example:

location regex "^/new/" {
    frang_limits {
	http_body_len 5;
	http_strict_host_checking true;
    }
}

http_chain {
  uri == "^/html/" -> default;
  -> default;
}

biathlon3 avatar Jul 08 '24 05:07 biathlon3

I squashed it into one commit so it can be reviewed.

biathlon3 avatar Jul 26 '24 13:07 biathlon3