As an incident responder, threat hunter, or detection engineer, getting quickly
to your analytics is key for productivity. For network-based visibility and
detection, Zeek and Suricata are the
bedrock for many security teams. But operationalizing these tools can take a
good chunk of time.
So we asked ourselves: How can we make it super easy to work with Zeek and
Suricata logs?
eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1a21LbSFx1MDAxMH3nK1xc3tegzP2SNyDJxqGKODhcdTAwMWKSbKVSwlx1MDAxYWxcdTAwMDVZ8kqygaTy79sjg0aSbTDEXHUwMDFivLtcdTAwMTZcdTAwMDVYc9H0TJ9zumfk7zutVju/XHUwMDFhm/azVttcXPb9KFxmUv+i/cSWT02ahUlcZlWkuM+SSdovWlx1MDAwZfN8nD17+tRcdTAwMWaPPdfL6yejWU9cdTAwMTOZkYnzXGba/lx0963W9+JvZazU9HM/XHUwMDFlRKboUFS54Vx1MDAxONLN0qMkLoYmXGJRgpGkomxcdTAwMTFmz2G83Fx1MDAwNFB95keZcTW2qK3FXHUwMDAxOTn+a/dIPD9O1eH+i4PX6JNcdTAwMWL2LIyiXn5cdTAwMTXNJub3h5O0YlSWp8m5OVx0g3xcYvW4UV72y1x1MDAxMlhcdTAwMDLXK00mg2FssqzWJ1x1MDAxOfv9ML+yZVxilaWzVXjWciWXdp7C3V9cdTAwMTVL4mEtpFx1MDAxMJRcdKEpYlxyS1x1MDAwZZIoSa0lv6Hicrac+v3zXHUwMDAxXHUwMDE4XHUwMDE0XHUwMDA3ro3Rpm/OXFybi+v5UeJGXHUwMDFkmnAwzKFQubLMXHUwMDE0q6xcdTAwMTAnWklBy1xuO8C4XHUwMDEzXHUwMDE0XHUwMDBl/+yWNvVHpmN7xJMoqq5OXHUwMDFjXFyvTq3i1Fa8aGKnip9cdTAwMWGGcnOZl3OoOPztqX/E33Y/Zu8/RVNNXHUwMDE1uVx1MDAxYWS0Xbb7cf3J2TlcdTAwMTlcdTAwMDf+XGY/WCi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MDE3XzqbrpxcdTAwMWOUUzPYYCtAinXIvHBcIixhXHUwMDE5XHUwMDE0XHUwMDAxbSWaNix7TOXEgGtILsGsrXRupXMrnb9WOtXS19ZSYIk1usdr69dcdTAwMWTqk9eXyYfDV1x1MDAxZlx1MDAwZXpR/yRcYshfmy6du1J64FwizShkluBcZuRCRUU7sVwiWlx1MDAxMqYopHibpJ2aUKo1f0zpXHUwMDA0XHUwMDBlc7aVzvnWW+lcXDbX/4R0SjR3SFO+SWRgOFx1MDAwN16srp3HUzlcdTAwMTm9y875y73u4TTF73a/fHy76dopi7RcdTAwMTNcdTAwMTI4XCJcdTAwMDCQXHUwMDE0OX0qpVNcblwiXHUwMDA0ZJxMK6GWf2fgXHUwMDExpFx1MDAxM4FB9qztMd9AYIyk2GrnfOutdi6b62Zq5851/7Y/XHUwMDFl93JcdTAwMDA54GCmpO1paC72XHUwMDE3vk+0l/0qZ6G8VuKMhc/3XHUwMDFmOz/+XHUwMDA2NFx1MDAwZVOsIn0= Child Process shell
Purring like a Suricat In our previous blog post we adapted Zeek to
behave like a good ol' Unix tool, taking input via stdin and producing output
via stdout. Turns out you can do the same fudgery with Suricata:
#!/bin/sh
suricata -r /dev/stdin \
--set outputs.1.eve-log.filename=/dev/stdout \
--set logging.outputs.0.console.enabled=no
Let's break this down:
The --set
option take a name=value
parameter that overrides the settings
in your suricata.yaml
config file. The key outputs.1.eve-log.filename
refers to the outputs
array, takes
element at index 1
, treats that as object and goes to the nested field
eve-log.filename
. Setting /dev/stdout
as filename makes Suricata write to
stdout. We must set logging.outputs.0.console.enabled
to no
because Suricata
writes startup log messages to stdout. Since they are not valid JSON, we
would otherwise create an invalid JSON output stream. User-defined Operators Now that we have both Zeek and Suricata at our fingertips, how can we work with
their output more easily? This is where Tenzir comes into play—easy
pipelines for security teams to acquire,
shape , and route event data.
Here are two examples that count the number of unique source IP addresses per
destination IP address, on both Zeek and Suricata data:
# Zeek
zcat pcap.gz | zeekify | tenzir \
'read zeek-json
| where #schema == "zeek.conn"
| summarize n=count_distinct(id.orig_h) by id.resp_h
| sort n desc'
# Suricata
zcat pcap.gz | suricatify | tenzir \
'read suricata
| where #schema == "suricata.flow"
| summarize n=count_distinct(src_ip) by dst_ip
| sort n desc'
It's a bit unwieldy to write such a command line that requires an external shell
script to work. This is where user-defined
operators come into play. In combination
with the shell
operator, you can write a custom
zeek
and suricata
operator and ditch the shell script:
tenzir.yaml tenzir :
operators :
zeek :
shell "zeek -r - LogAscii::output_to_stdout=T
JSONStreaming::disable_default_logs=T
JSONStreaming::enable_log_rotation=F
json-streaming-logs"
| read zeek-json
suricata:
shell "suricata -r /dev/stdin
--set outputs.1.eve-log.filename=/dev/stdout
--set logging.outputs.0.console.enabled=no"
| read suricata
The difference stands out when you look now at the pipeline definition:
zeek
| where #schema == "zeek.conn"
| summarize n=count_distinct(id.orig_h) by id.resp_h
| sort n desc
suricata
| where #schema == "suricata.flow"
| summarize n=count_distinct(src_ip) by dst_ip
| sort n desc
It's pretty convenient to drop packets into a Tenzir pipeline, process them with
our favorite tools, and then perform fast in-situ analytics on them. The nice
thing is that operators compose: a new operator automatically works with all
existing ones.
How does it work? First, let's take a look at the standard approach where one process pipes the
output into the next:
eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nOVbbVPqyFx1MDAxMv7ur6C4XHUwMDFm9ssxO+8vW1u3SlHPQfb4XG6C3tqyXCJcdTAwMDSIQIJJQGCv/30nUUlcYlx0oFx1MDAxMjfe66k6ysxkpjPTTz/dPc1fO4VC0ZtcdTAwMGWN4m+FojFp6n2z5eiPxW9++9hwXFzTtlRcdTAwMTdcbj679shpXHUwMDA2I7ueN3R/+/VXfTjUwqe0pj14ftLoXHUwMDFiXHUwMDAzw/JcXDX2P+pzofBX8H9kLc+YeMHYoDVcXEkgXHUwMDE4bz2xrWBViFx1MDAwMeCIYY7nI0z3QC3lXHUwMDE5LdXd1vu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YbakfPGbbdcXKtcdTAwMTJ63Zk1LjclttVZkIX180psNEJbS2khXCJcdTAwMTjFnG1e8Ja8m3knNqGoXHUwMDBiXHUwMDAySKBIXHUwMDA0UGbEXHUwMDA2XHUwMDAx1VxiS47LllhNqoidXHUwMDAw9PXDss1Jbf7F84yIbY2tT/qefEycN5Hbzlx1MDAwYtyL+nB46amdLb5muYpj03jcT9CcdvDjm41cdTAwMDDXPoCMIGv3tPP0N0rgubIifQ==zeek -r - <args> | tenzir 'read zeek-json' Zeek Packets JSON logs stdin stdout Tenzir Events stdin zeek-json
When using the shell
operator, the tenzir
process spawns zeek
or
suricata
as child process. The operator then forwards the bytes from stdin of
the tenzir
process to the child's stdin, and uses the child's stdout as input
to the subsequent read
operator.
eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1cXGtT4shcdTAwMWH+Pr+C8nzYL0O275etrVOliFx1MDAwMo732+jZLStAgGhIMFx0Orpn/vt2MkpCSCBcYtHM2YNVKt1Jd9P9Ps/zvt1v+OtTpbLhP42Mjd8qXHUwMDFixreObpldV3/c+Fx1MDAxY5Q/XHUwMDE4rmc6tqpC4XvPXHUwMDE5u53wyoHvj7zffv1VXHUwMDFmjbToLq3jXGZ/3GlYxtCwfU9d+1x1MDAxZvW+Uvkr/Fx1MDAxZOvLN7754bVhadSTXHUwMDEwOFl64Nhhr1BIXHUwMDAxJaA4usL0tlVXvtFV1T3d8oyoJijaOPm6tUf6zzu9nXr3/KpHZY1IXHUwMDEyddszLevUf7LCXHUwMDExeY76XHUwMDE0UZ3nu86dcWl2/UHQd6I86y7XXHUwMDE591x1MDAwN7bheVP3OCO9Y/pPQVx1MDAxOVx1MDAwMJNS3e6HbUQl39S7KoveXHUwMDA3d1RcdEj0XXMsx1xy+v5cdTAwMTdcYl9R7229c9dXQ7C70TVcdTAwMWSjS7p6dM3j6ydcdTAwMDKUaExwOqlcdTAw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MDbFR8RcdTAwMTNDWirLwtpcdTAwMWO0zi92XHUwMDBmycHRjVx1MDAxY+DLu4fzLZI3y2K+Sk31X9YsXHUwMDBiyjL3m1x1MDAxNCtgpdwwfziUPplvUu33zLKgTKOQsnd7Jlx1MDAwYlx1MDAwMqqR9K9cdTAwMTaeTbQgysfnjH7oNze9c57F5Nt3XHUwMDBiSrVYQOzJY6GU4awj21wi+2yWJEsnfjRQQVx1MDAxNFx1MDAxNUtsULT547et64fGPW088U3jdOztX9KSXHUwMDFmzaaIXHUwMDE4WvFhrMyEJ+WwMy5cdFx1MDAwZrJYglxc4Vx1MDAxNESmSJryliiSxee+XHUwMDE3XHLJ/OexrdPDg4rl9N/5RDal26XOZD+9KOyGPlx1MDAxYZ36alx1MDAwNidBwMaDaTxupZhKL3xcdTAwMDVKXHUwMDFkXHUwMDAyN4CIXHUwMDExZsJ8//T9b1jKgVx1MDAwNyJ9tenzir 'shell "zeek -r - <args>" | read zeek-json' Tenzir Events pipe pipe stdin Zeek stdin stdout Packets zeek-json JSON logs
In the above example, shell
acts as a source operator, i.e., it does not
consume input and only produces output. The shell
operator can also act as
transformation , i.e., additionally accept input. This makes it possible to use
it more flexibly in combination with other operators, e.g., the
load
operator emitting bytes from a
loader :
load file trace.pcap | zeek | where 6.6.6.6 | write json
Got a PCAP trace via Kafka? Just exchange the file
loader with the
kafka
loader:
load kafka -t artifact | zeek | where 6.6.6.6 | write json
You may not always sit in front of a command line and are able to pipe data from
a Unix tool into a Tenzir pipeline. For example, when you use our
app or the REST API . This is where the
shell
operator shines. The diagram above shows how shell
shifts the entry
point of data from a tool to the Tenzir process. You can consider shell
your
escape hatch to reach deeper into a specific Tenzir node, as if you had a native
shell.
Conclusion In this blog post we showed you the shell
operator
and how you can use it to integrate third-party tooling into a Tenzir pipeline
when coupled with user-defined
operators .
Using Zeek or Suricata? Tenzir makes 'em fun to work with. Check out our other
blogs tagged with #zeek
and
#suricata
, and give it a shot yourself.