OpenNSM's Docker image collection of NSM tools and software to effectively utilize them. We have 100's of images...
./containnsm
git clone https://github.com/open-nsm/ContainNSM && cd ContainNSM
sudo make install
Directory structure is dead simple: tool_directory/version_directory/Dockerfile
.
...
|-- argus
| |-- 3.0.6.1
| | |-- Dockerfile
| |-- 3.0.8.1
| |-- Dockerfile
|-- bro
| |-- 2.4
| | |-- Dockerfile
| |-- 2.4.1
| |-- Dockerfile
|-- daemonlogger
| |-- 1.0.1
| | |-- Dockerfile
| |-- 1.2.0
| | |-- Dockerfile
...
Options:
Pull down an existing image from Docker Hub (recommended)
docker pull opennsm/bro:2.4.1
Build a new one from the repository.
./containnsm build bro/2.4.1
./containnsm list
./containnsm listinstalled
./containnsm list bro
./containnsm listinstalled bro
Tools are executed in containers with results passed to the host.
Using ./containnsm
we can easily do things like:
Notes: If a version tag e.g. :2.8.1
is not specified the latest version of the image
will be used.
Options and arguments passed after --
are run inside the container.
When using options such as -r
, -w
, -C
an absolute path must be the argument.
-r
and -w
can take multiple directories or files as arguments when delimited by a comma.
By default, without a colon signifying src_mount:dst_mount a path will be
evaluated to be the same path on the host as in the container. For example,
-r /pcap/test.pcap
will mount the same path in the container which allows you
to then read from the path in the container via tcpdump -nr /pcap/test.pcap
. Any
directories not available in container but in the path will be created on the fly
to match the path (this is behavior of Docker) and works to our advantage.
./containnsm run ... -r /pcap/test.pcap,~/.config:/home/opennsm/.config -- tcpdump -nr /pcap/test.pcap
./containnsm run ... -w /test,/input:/pcaps -- tcpdump -ni -w /pcaps/example.pcap
Informational messages are written to stderr, if they're bothering you
send them to bitbucket with 2>/dev/null
or use quiet mode with -q
.
./containnsm run -I bro -- bash
./containnsm run -I bro -- ip link
./containnsm run -I tcpdump -- tcpdump -ni eth0
./containnsm run -I tcpdump -i -- tcpdump -ni eth0
./containnsm run -r /pcaps/ctf.pcap -I tcpdump:4.7.4 -- tcpdump -nr ctf.pcap
./containnsm run -r $PWD/test.pcap -I argus -- argus -r test.pcap -w test.argus
./containnsm run -w $PWD -I bro -- bro -r test.pcap
./containnsm grouprun -r $PWD/nitroba.pcap -I tcpdump -- tcpdump -nnr nitroba.pcap -c 1 udp
Graph throughput on Docker host's physical eth0 interface while downloading a Docker image of Bro 2.4.
./containnsm run -I speedometer:2.8 -i -- speedometer -rx eth0