Skip to content
Draft
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
4 changes: 4 additions & 0 deletions doc/userguide/output/eve/eve-json-format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,10 @@ It can also contain information about Source and Target of the attack in the
``alert.source`` and ``alert.target`` field if target keyword is used in
the signature.

In firewall mode, the ``alert.engine`` field identifies which rule engine
generated the alert: ``fw`` for firewall rules and ``td`` for threat detect
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
generated the alert: ``fw`` for firewall rules and ``td`` for threat detect
generated the alert: ``fw`` for firewall rules and ``td`` for threat detection

rules. This field is omitted outside of firewall mode.

This event will also have the ``pcap_cnt`` field, when running in pcap mode, to
indicate which packet triggered the signature.

Expand Down
8 changes: 8 additions & 0 deletions etc/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
"additionalProperties": true,
"description": "Extra context data created by keywords such as dataset with JSON"
},
"engine": {
"type": "string",
"enum": [
"fw",
"td"
],
"description": "Engine that generated the alert in firewall mode: fw for firewall rules, td for threat detect rules."
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "Engine that generated the alert in firewall mode: fw for firewall rules, td for threat detect rules."
"description": "Engine that generated the alert in firewall mode: fw for firewall rules, td for threat detection rules."

},
"gid": {
"type": "integer"
},
Expand Down
3 changes: 3 additions & 0 deletions src/output-json-alert.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ void AlertJsonHeader(const Packet *p, const PacketAlert *pa, SCJsonBuilder *js,
SCJbOpenObject(js, "alert");

SCJbSetString(js, "action", action);
if (EngineModeIsFirewall()) {
SCJbSetString(js, "engine", (pa->s->flags & SIG_FLAG_FIREWALL) ? "fw" : "td");
}
SCJbSetUint(js, "gid", pa->s->gid);
SCJbSetUint(js, "signature_id", pa->s->id);
SCJbSetUint(js, "rev", pa->s->rev);
Expand Down
Loading