]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
exceptions: error out when invalid policy is used
authorJuliana Fajardini <jufajardini@oisf.net>
Wed, 24 Aug 2022 20:36:47 +0000 (17:36 -0300)
committerVictor Julien <vjulien@oisf.net>
Thu, 1 Sep 2022 08:39:36 +0000 (10:39 +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

(cherry picked from commit 58ef3cde7a01166a1ae56b814156e2cad02e1251)

src/util-exception-policy.c

index 9b828c69255adc6775d4caddc9b5d382b9c50150..5ec66ea90f4d4b7f94e3d8040d5be9c17c541fdf 100644 (file)
@@ -87,7 +87,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) {