detect/parse: allow banning keywords from fw rules

Related to
Ticket #8551
pull/15486/head
Juliana Fajardini 2 months ago committed by Victor Julien
parent e089ac9775
commit 04a7674512

@ -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);

@ -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);

@ -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. */

Loading…
Cancel
Save