I need some assistance getting BPF working.
We’re streaming from a MikroTik RouterOS firewall to Suricata 7.0.7 using trafr and -r /dev/stdin sudo /bin/sh -c '/usr/bin/trafr -s | /usr/bin/suricata -c /etc/suricata/suricata.yaml --pidfile /run/suricata.pid -r /dev/stdin -v not host 10.10.111.200 -l /var/log/suricata/'
I’m trying to exclude our monitoring system which is scanning the networking via SNMP.
Even a simple filter like this seems to be ignored completely - I still see all traffic in the Suricata logs. -v not host 10.10.111.200
Specifying the filter in file /etc/suricata/capture-filter.bpf also doesn’t work: sudo /bin/sh -c '/usr/bin/trafr -s | /usr/bin/suricata -c /etc/suricata/suricata.yaml --pidfile /run/suricata.pid -r /dev/stdin -F /etc/suricata/capture-filter.bpf -l /var/log/suricata/'
What am I doing wrong, is this not supported for reading from pacp (-r) or is it even a BUG?
The BPF is supposed to the last part of the suricata commandline, so you could try moving it there. Alternatively you can put the filter in a file and load it from the commandline with -F <file path>.
I already tried that by using a pbf file which also didn’t work (see my initial post above).
Even when I move it at the end, the filter is completely ignored: sudo /bin/sh -c '/usr/bin/trafr -s | /usr/bin/suricata -c /etc/suricata/suricata.yaml --pidfile /run/suricata.pid -r /dev/stdin -l /var/log/suricata/ -v not host 10.10.111.200'
Same if I put -F /path/to/file.bpf at the end of the command: sudo /bin/sh -c '/usr/bin/trafr -s | /usr/bin/suricata -c /etc/suricata/suricata.yaml --pidfile /run/suricata.pid -r /dev/stdin -l /var/log/suricata/ -F /etc/suricata/capture-filter.bpf'