detect: ban `replace` keyword for firewall mode

Ticket #8551
pull/15486/head
Juliana Fajardini 2 months ago committed by Victor Julien
parent 372cb8c692
commit edaa912ed9

@ -912,6 +912,9 @@ the reassembled stream.
The checksums will be recalculated by Suricata and changed after the
replace keyword is being used.
.. note:: ``replace`` cannot be used in firewall mode,
even if only in Threat Detection rules.
.. _pcre:
pcre (Perl Compatible Regular Expressions)

@ -58,14 +58,17 @@ static int DetectReplacePostMatch(DetectEngineThreadCtx *det_ctx,
void DetectReplaceRegister (void)
{
sigmatch_table[DETECT_REPLACE].name = "replace";
sigmatch_table[DETECT_REPLACE].desc = "only to be used in IPS-mode. Change the following content into another";
sigmatch_table[DETECT_REPLACE].desc =
"only to be used in IPS-mode. Change the following content into another"
"Banned from firewall rules & firewall mode usage.";
sigmatch_table[DETECT_REPLACE].url = "/rules/payload-keywords.html#replace";
sigmatch_table[DETECT_REPLACE].Match = DetectReplacePostMatch;
sigmatch_table[DETECT_REPLACE].Setup = DetectReplaceSetup;
#ifdef UNITTESTS
sigmatch_table[DETECT_REPLACE].RegisterTests = DetectReplaceRegisterTests;
#endif
sigmatch_table[DETECT_REPLACE].flags = (SIGMATCH_QUOTES_MANDATORY|SIGMATCH_HANDLE_NEGATION);
sigmatch_table[DETECT_REPLACE].flags =
(SIGMATCH_QUOTES_MANDATORY | SIGMATCH_HANDLE_NEGATION | SIGMATCH_BAN_FIREWALL_MODE);
}
static int DetectReplacePostMatch(DetectEngineThreadCtx *det_ctx,

Loading…
Cancel
Save