Hi guys,
so I would like to use suricata on an small IoT with balena. The docker.compose file looks like this
services:
main:
network_mode: host
labels:
io.balena.features.dbus: "1"
And here is the dockerfile.template:
FROM balenalib/%%BALENA_MACHINE_NAME%%-node:8
FROM ubuntu
RUN apt-get update && apt-get install suricata net-tools iproute2 -y
WORKDIR /usr/src/app
COPY src/ ./src/
COPY index_yaml/index.yaml /var/lib/suricata/update/cache/index.yaml
RUN ifconfig
RUN suricata --pcap -c /usr/src/app/src/suricata.yaml
The problem I’m facing is that if I start suricata here it wont work because the network adapters from the host aren’t available yet, I get an error message that suricata can’t find the network device in question and yes, as I can see via ifconfig, it is not available yet. (only eth0 and lo)
If I remove the suricata command from the dockerfile.template, push it and open a terminal session with ‘main’ the network device is there. (enp4s0)
So how can I start suricata after the network devices are ready, please?
Thanks in advance and Kind Regards,
Filisimus