Zeek cluster fails with pcap_error: socket: Operation not permitted (pcap_activate)

2.2k Views Asked by At

I'm trying to setting up a Zeek IDS cluster (v.3.2.0-dev.271) on 3 Ubuntu 18.04 LTS hosts to no avail - running zeek deploy command fails with the following output:

fatal error: problem with interface ens3 (pcap_error: socket: Operation not permitted (pcap_activate))

I have followed the official documentation (which is pretty generic at best) and set up passwordless SSH authentication between the zeek nodes.

I also preemptively created the /usr/local/zeek path on all hosts and gave the zeek user full permissions on that directory. The documentation says The Zeek user must be able to either create this directory or, where it already exists, must have write permission inside this directory on all hosts.

The documentation also says that on the worker nodes this user must have access to the target network interface in promiscuous mode.

My zeek user is a sudoer AND a member of netdev group on all 3 nodes. Yet, the cluster deployment fails. Apparently, when zeekctl establishes the SSH connection to the workers it cannot get a hold of the network interfaces and set caps.

Eventually I was able to successfully run the cluster by following this article - however it requires you to set up the entire cluster as root, which I would like to avoid if at all possible.

So my question is, is there anything blatantly obvious that I am missing? To the best of my knowledge this setup should work, otherwise I don't know how to force zeekctl to run 'sudo' in front of every SSH command it is supposed to run on the workers, or how to satisfy this requirement.

Any guidance will be greatly appreciated, thanks!

3

There are 3 best solutions below

0
On BEST ANSWER

So, just in case someone else stumbles upon the same issue - I figured out what was happening. I streamlined the cluster deployment with Ansible (using 'become' directive at task level) and did not elevate when running the handlers responsible for issuing the zeekctl deploy command. Once I did, the Zeek Cluster deployment succeeded.

1
On

I was experiencing the same error for my standalone setup. Found this question from googling it. More googling the error brought me to a few blogs including one in which the comments mentioned the same error. The author mentioned giving the binaries permissions using setcap:

$sudo setcap cap_net_raw,cap_net_admin=eip /usr/local/zeek/bin/zeek

$sudo setcap cap_net_raw,cap_net_admin=eip /usr/local/zeek/bin/zeekctl

After running them both, my instance of zeek is now running successfully.

Source: https://www.ericooi.com/zeekurity-zen-part-i-how-to-install-zeek-on-centos-8/#comment-1586

0
On

Actually, if you see crates of pcap pkg https://crates.io/crates/pcap they've mentioned providing certain permission for the build file.

Note: If not running as root, you need to set capabilities like so:

sudo setcap cap_net_raw,cap_net_admin=eip path/to/bin