Skip to main content

gnat_rule_file

Synopsis

Definition of JSON file for defining patterns to trigger actions.

Description

Tag rules are used to define and match patterns to rule flow record. The rule is used to identify patterns that match a flow record and can be used for triggering actions. The rule patterns are defined in a JSON file and the location designated with the --options rule argument of the gnat_rule command line interface.

Json File Format

The JSON file is composed of an array of JSON objects, each object representing a rule pattern. Each object contains a set of key-value pairs, where the key is the name of the field. The value is the value to match against. The following fields are available for matching:


fieldtyperequiredmatch type
actionstryesn/a
tagintyesexact match
observestrnoprefix match
protostrnoprefix match
saddrstrnoprefix match
sportintnoexact match
daddrstrnoprefix match
dportintnoexact match
ndpi_appidstrnoprefix match
orientstrnoprefix match
risk_severityintnoexact match
hbos_severityintnoexact match
info

risk_severity and hbos_severity are used to define the severity of the rule. The severity is defined as an integer value from 0 to 5, where 0 is the lowest severity and 5 is the highest severity.

Examples

[
{ "action":"trigger","tag":"dns","observe":"lan1","ndpi_appid":"dns" },
{ "action":"ignore","observe":"lan1","daddr":"8.8.8","ndpi_appid":"dns" },
{ "action":"trigger","proto":"tcp","orient":"oi"},
{ "action":"trigger","tag":"tls","proto":"tcp","ndpi_appid":"tls"},
{ "action":"trigger","proto":"tcp","saddr":"10.0.4.240","daddr":"10.1.1.81","dport":8181},
]

See Also