]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
exceptions: error out when invalid policy is used 7773/head
authorJuliana Fajardini <jufajardini@oisf.net>
Wed, 24 Aug 2022 20:36:47 +0000 (17:36 -0300)
committerVictor Julien <vjulien@oisf.net>
Thu, 25 Aug 2022 20:30:54 +0000 (22:30 +0200)
Before, if an invalid value was passed as exception policy, Suricata
would log a warning and set the exception policy to "ignore". This is a
very different result, than, say, dropping or bypassing a midstream flow.

Task #5504

src/util-exception-policy.c

index a81f7660b12f91076144608e2c3cf557b633831b..a646c5e33ac825d7d1d4cd3cc33a9111c6537c9c 100644 (file)
@@ -88,7 +88,10 @@ enum ExceptionPolicy ExceptionPolicyParse(const char *option, const bool support
             policy = EXCEPTION_POLICY_IGNORE;
             SCLogConfig("%s: %s", option, value_str);
         } else {
-            SCLogConfig("%s: ignore", option);
+            FatalErrorOnInit(SC_ERR_INVALID_ARGUMENT,
+                    "\"%s\" is not a valid exception policy value. Valid options are drop-flow, "
+                    "pass-flow, bypass, drop-packet, pass-packet or ignore.",
+                    value_str);
         }
 
         if (!support_flow) {