diff --git a/src/detect-engine-register.c b/src/detect-engine-register.c index a339aaa55b..b62a6173ca 100644 --- a/src/detect-engine-register.c +++ b/src/detect-engine-register.c @@ -331,6 +331,12 @@ static void PrintFeatureList(const SigTableElmt *e, char sep) DEBUG_VALIDATE_BUG_ON(flags & (SIGMATCH_INFO_MULTI_UINT | SIGMATCH_INFO_ENUM_UINT | SIGMATCH_INFO_BITFLAGS_UINT)); } + if (flags & SIGMATCH_BAN_FIREWALL_RULE) { + if (prev == 1) + printf("%c", sep); + printf("banned from firewall rules"); + prev = 1; + } if (e->Transform) { if (prev == 1) printf("%c", sep); diff --git a/src/detect-engine-register.h b/src/detect-engine-register.h index 516dc5b288..910394ffd4 100644 --- a/src/detect-engine-register.h +++ b/src/detect-engine-register.h @@ -350,6 +350,8 @@ extern int DETECT_TBLSIZE_IDX; #define SIGMATCH_INFO_ENUM_UINT (1UL << (19)) /** keyword is an uint with bitflags */ #define SIGMATCH_INFO_BITFLAGS_UINT (1UL << (20)) +/** keyword cannot be used in firewall rules */ +#define SIGMATCH_BAN_FIREWALL_RULE (1UL << (21)) int SigTableList(const char *keyword); void SigTableCleanup(void); diff --git a/src/detect-parse.c b/src/detect-parse.c index 05e7cc0b5c..98afa1e843 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -968,6 +968,11 @@ static int SigParseOptions(DetectEngineCtx *de_ctx, Signature *s, char *optstr, #undef URL } + if (s->init_data->firewall_rule && (st->flags & SIGMATCH_BAN_FIREWALL_RULE) != 0) { + SCLogError("keyword \'%s\' is not allowed with firewall rules", optname); + goto error; + } + int setup_ret = 0; /* Validate double quoting, trimming trailing white space along the way. */