Dockerizing your computer
- Homebrew (installation instructions at https://brew.sh/)
- Docker Desktop for Mac (installation instructions at https://docs.docker.com/docker-for-mac/install/)
$ brew install git
|
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
|

Checkout the Code
$ git clone https://github.com/zeek/zeek-docker.git
|
Building your first Zeek Container
It’s time! Type in the commands below to build your first Zeek Container (in this case we are building a version 3.0.0 container):
$ cd zeek-docker
$ make build-stamp_3.0.0
|
That’s all you need to do! Now watch as the wonders of automation unfold, and your Zeek container is built. You should see something like this on your terminal console:
…
Step 24/24 : CMD /bin/bash -l
—> Running in c1263b7d2ea3
Removing intermediate container c1263b7d2ea3
—> 5bc774250a9a
Successfully built 5bc774250a9a
Successfully tagged broplatform/bro:3.0.0
touch build-stamp_3.0.0
$
|
$ docker images | grep -e broplatform -e REPO
REPOSITORY TAG IMAGE ID CREATED SIZE
broplatform/bro 3.0.0 5bc774250a9a 8 minutes ago 215MB
|
Hello Zeek!
We are ready to run our first Zeek container!
$ docker run -it -v `pwd`:/pcap broplatform/bro:3.0.0 /bin/bash
|
At this point we are inside the container. Type the command below and you can see there is a freshly built zeek executable ready to use!
root@3535953ccd99:/# which zeek
/zeek/bin//zeek
|
The /pcap directory inside the container corresponds to the host working directory (this can be anywhere on your computer, for me it happens to be the zeek-docker repo directory). You’ll probably want to put pcap files in here as well so you can process the data inside the container using zeek while storing the logs in the mounted directory for later access (e.g. after the container is gone!).
root@3535953ccd99:/zeek/bin# ls -1r /pcap
master.Dockerfile
master-dev.Dockerfile
common
build-stamp_3.0.0
Makefile
3.0.0.Dockerfile
…
|
Putting Zeek to Work
There are two ways we can use Zeek:
- Run it from the command line against a pre-captured PCAP file
- Run it against a live network interface
$ docker run -it -v `pwd`:/pcap broplatform/bro:3.0.0 /bin/bash
root@5ea58f4bb9be:/# cd /pcap
root@5ea58f4bb9be:/pcap# ls *.pcap
test.pcap
|
Time to run Zeek! Execute the following command.
root@5ea58f4bb9be:/pcap# zeek -r test.pcap
root@5ea58f4bb9be:/pcap#
|
root@5ea58f4bb9be:/pcap# ls *.log
conn.log dnp3.log packet_filter.log
|
So now we have the log files generated by Zeek using its default set of scripts, cool! If these logs are new to you, then you might want to head over to the official Zeek documentation which contains a deep dive on the various log files and fields: https://docs.zeek.org/en/stable/script-reference/log-files.html.
As an example, we’ll take a look at the contents of the conn.log file (https://docs.zeek.org/en/stable/scripts/base/protocols/conn/main.zeek.html#type-Conn::Info).
root@5ea58f4bb9be:/pcap# cat conn.log
#separator x09
#set_separator ,
#empty_field (empty)
#unset_field –
#path conn
#open 2019-12-04-04-38-26
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p proto service duration orig_bytes
resp_bytes conn_state local_orig local_resp missed_bytes history orig_pkts orig_ip_bytes
resp_pkts resp_ip_bytes tunnel_parents #types time string addr port addr port
enum string interval count count string bool bool count string count count
count count set[string] 1252963725.444796 Cn0OCi3r0R0aO5nAda 192.168.10.204
1413 192.168.10.140 20000 tcp dnp3_tcp 1.049805 15 17 SF — 0
ShADadFtf 8 343 7 322 – 1252963725.788546 CbSrUpY4Adua4a6Ad 192.168.10.204
1400 192.168.10.21 5450 tcp – 9.006836 60 140 OTH -0 DdA 10 460 5 340 –
#close 2019-12-04-04-38-26
|
Conclusiion
Dr. Lapsley has over 20 years of industry experience. Roughly a third of
that has been spent doing applied research for various government agencies,
a third working for large telecom vendors, and a third working at startup
companies. Dr. Lapsley’s expertise includes software development,
data analysis, distributed infrastructure, open source, cloud computing,
and forming and leading high performing teams.
Dr. Lapsley holds a Ph. D. in Electrical and Electronics Engineering from
the University of Melbourne, Australia. He also holds a B. S. (Computer
Science) and B. E. with Honours (Electrical and Computer Systems
Engineering) from Monash University, Australia.