Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions etc/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4350,6 +4350,21 @@
"type": "string",
"description": "Date of the end of the flow"
},
"exception_policy": {
"type": "array",
"properties": {
"policy": {
"type": "string",
"description": "Which exception policy was applied"
},
"target": {
"type": "string",
"description": "What triggered the exception"
}
},
"description":
"The exception policy(ies) triggered by the flow. Not logged if none was triggered"
},
"max_ttl": {
"type": "integer",
"description": "Maximum observed Time-To-Live (TTL) value"
Expand Down
2 changes: 1 addition & 1 deletion src/output-json-flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void EveAddFlow(Flow *f, SCJsonBuilder *js)
SCJbSetString(js, "start", timebuf1);
}

static void EveExceptionPolicyLog(SCJsonBuilder *js, uint16_t flag)
void EveExceptionPolicyLog(SCJsonBuilder *js, uint16_t flag)
{
if (flag & EXCEPTION_TARGET_FLAG_DEFRAG_MEMCAP) {
SCJbStartObject(js);
Expand Down
1 change: 1 addition & 0 deletions src/output-json-flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
void JsonFlowLogRegister(void);
void EveAddFlow(Flow *f, SCJsonBuilder *js);
void EveAddAppProto(Flow *f, SCJsonBuilder *js);
void EveExceptionPolicyLog(SCJsonBuilder *js, uint16_t flag);

#endif /* SURICATA_OUTPUT_JSON_FLOW_H */
13 changes: 13 additions & 0 deletions src/output-json-netflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "util-logopenfile.h"
#include "util-time.h"
#include "output-json.h"
#include "output-json-flow.h"
#include "output-json-netflow.h"

#include "stream-tcp-private.h"
Expand Down Expand Up @@ -211,6 +212,12 @@ static void NetFlowLogEveToServer(SCJsonBuilder *js, Flow *f)
}
}

if (f->applied_exception_policy != 0) {
SCJbOpenArray(js, "exception_policy");
EveExceptionPolicyLog(js, f->applied_exception_policy);
SCJbClose(js); /* close array */
}

/* Close netflow. */
SCJbClose(js);

Expand Down Expand Up @@ -264,6 +271,12 @@ static void NetFlowLogEveToClient(SCJsonBuilder *js, Flow *f)
}
}

if (f->applied_exception_policy != 0) {
SCJbOpenArray(js, "exception_policy");
EveExceptionPolicyLog(js, f->applied_exception_policy);
SCJbClose(js); /* close array */
}

/* Close netflow. */
SCJbClose(js);

Expand Down
Loading