Zeek container startup is slow when using HDD and non-default UID/GID #743
-
Describe the bug I have customized some zeek plugins and placed them under /Malcolm/zeek/custom. Every time I modify the monitored network card, I need to restart the zeek live container using the But after restarting the zeek live container, it has been unhealthy for a long time. After entering the container, check the process My purpose is to modify the packet capture port. The configuration of the packet capture port is written when the container is first created. Currently, I can only regenerate 'zeek-live' through this method to make it effective. To Reproduce
Expected behavior **Screenshots and/or Logs ** ![]() Malcolm Version:
How are you running Malcolm?
Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
-
So what you've discovered is that as part of Malcolm's containers' startup, certain files/directories need to be chowned to be owned by the non-root user that the Zeek processes will be run as. If it so happens that the UID/GID on the host (specified in process.env) match the defaults the Zeek container was built with (which is Normally it's not that slow though, I run Malcolm on a machine that uses different UID/GID (1001/1001) and it doesn't take nearly that long. However, I am using pretty fast storage for the storage device Linux is using for the container overlays (NVMe or fast SSD). What kind of storage is on the system we're talking about? Is it a rotational drive or something? The only way I could see to avoid the chown completely would be to rebuild the Zeek container (e.g., |
Beta Was this translation helpful? Give feedback.
The way to set those permissions up in advance is to build the Zeek image with the default UID/GID set to what it's going to be at runtime. So, essentially:
git clone -b v25.08.0 https://github.com/cisagov/Malcolm
id -u
andid -g
) and edit./Dockerfiles/zeek.Dockerfile
and put those values in there forDEFAULT_UID
andDEFAULT_GID
. Those are also the values that would have been put into./config/process.env
when you ranconfigure
./scripts/build.sh zeek
(this will take probably…