Skip to content

Commit

Permalink
exceptions: error out when invalid policy is used
Browse files Browse the repository at this point in the history
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 OISF#5504
  • Loading branch information
jufajardini authored and victorjulien committed Aug 25, 2022
1 parent 61b7341 commit 58ef3cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/util-exception-policy.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 58ef3cd

Please sign in to comment.