|
|
@ -60,7 +60,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
#define MODULE_NAME "JsonDropLog"
|
|
|
|
#define MODULE_NAME "JsonDropLog"
|
|
|
|
|
|
|
|
|
|
|
|
#define LOG_DROP_ALERTS 1
|
|
|
|
#define LOG_DROP_ALERTS BIT_U8(1)
|
|
|
|
|
|
|
|
#define LOG_DROP_VERDICT BIT_U8(2)
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct JsonDropOutputCtx_ {
|
|
|
|
typedef struct JsonDropOutputCtx_ {
|
|
|
|
uint8_t flags;
|
|
|
|
uint8_t flags;
|
|
|
@ -158,6 +159,10 @@ static int DropLogJSON (JsonDropLogThread *aft, const Packet *p)
|
|
|
|
/* Close drop. */
|
|
|
|
/* Close drop. */
|
|
|
|
jb_close(js);
|
|
|
|
jb_close(js);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (aft->drop_ctx->flags & LOG_DROP_VERDICT) {
|
|
|
|
|
|
|
|
EveAddVerdict(js, p);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (aft->drop_ctx->flags & LOG_DROP_ALERTS) {
|
|
|
|
if (aft->drop_ctx->flags & LOG_DROP_ALERTS) {
|
|
|
|
int logged = 0;
|
|
|
|
int logged = 0;
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
@ -273,7 +278,7 @@ static OutputInitResult JsonDropLogInitCtxSub(ConfNode *conf, OutputCtx *parent_
|
|
|
|
const char *extended = ConfNodeLookupChildValue(conf, "alerts");
|
|
|
|
const char *extended = ConfNodeLookupChildValue(conf, "alerts");
|
|
|
|
if (extended != NULL) {
|
|
|
|
if (extended != NULL) {
|
|
|
|
if (ConfValIsTrue(extended)) {
|
|
|
|
if (ConfValIsTrue(extended)) {
|
|
|
|
drop_ctx->flags = LOG_DROP_ALERTS;
|
|
|
|
drop_ctx->flags |= LOG_DROP_ALERTS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
extended = ConfNodeLookupChildValue(conf, "flows");
|
|
|
|
extended = ConfNodeLookupChildValue(conf, "flows");
|
|
|
@ -287,6 +292,12 @@ static OutputInitResult JsonDropLogInitCtxSub(ConfNode *conf, OutputCtx *parent_
|
|
|
|
"'flow' are 'start' and 'all'");
|
|
|
|
"'flow' are 'start' and 'all'");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extended = ConfNodeLookupChildValue(conf, "verdict");
|
|
|
|
|
|
|
|
if (extended != NULL) {
|
|
|
|
|
|
|
|
if (ConfValIsTrue(extended)) {
|
|
|
|
|
|
|
|
drop_ctx->flags |= LOG_DROP_VERDICT;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
drop_ctx->eve_ctx = ajt;
|
|
|
|
drop_ctx->eve_ctx = ajt;
|
|
|
|