Hi Andreas,
The requested log files are attached.
The sequence of steps is as follows:
- Suricata 7.0.8 RELEASE was build from source at Debian 12.6
$ suricata -V
This is Suricata version 7.0.8 RELEASE
$ cat /etc/*release
PRETTY_NAME=“Debian GNU/Linux 12 (bookworm)”
NAME=“Debian GNU/Linux”
VERSION_ID=“12”
VERSION=“12 (bookworm)”
VERSION_CODENAME=bookworm
ID=debian
HOME_URL=“https://www.debian.org/”
SUPPORT_URL=“Debian -- User Support”
BUG_REPORT_URL=“https://bugs.debian.org/”
-
Nflog support is enabled in Suricata:
$ suricata --build-info | grep NFLOG
NFLOG support: yes
-
Iptables config: (I’m using nflog-group 5 for incoming and outgoing icmp packets)
$ iptables -L -nv
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 NFLOG 1 – * * 0.0.0.0/0 0.0.0.0/0 nflog-group 5
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 NFLOG 1 – * * 0.0.0.0/0 0.0.0.0/0 nflog-group 5
- Checking (prior to Suricata start) that packets are getting into nflog-group 5 when pinging from another machine on the same LAN:
$ tcpdump -n -i nflog:5
tcpdump: verbose output suppressed, use -v[v]… for full protocol decode
listening on nflog:5, link-type NFLOG (Linux netfilter log messages), snapshot length 262144 bytes
07:39:51.863233 IP 192.168.196.2 > 192.168.196.7: ICMP echo request, id 2, seq 1, length 64
07:39:51.863517 IP 192.168.196.7 > 192.168.196.2: ICMP echo reply, id 2, seq 1, length 64
07:39:51.863556 IP 192.168.196.2 > 192.168.196.7: ICMP echo request, id 2, seq 2, length 64
07:39:51.863568 IP 192.168.196.7 > 192.168.196.2: ICMP echo reply, id 2, seq 2, length 64
07:39:53.879228 IP 192.168.196.2 > 192.168.196.7: ICMP echo request, id 2, seq 3, length 64
07:39:53.879346 IP 192.168.196.7 > 192.168.196.2: ICMP echo reply, id 2, seq 3, length 64
-
Stopping tcpdump….
-
Starting Suricata (since there is no explicit start option for NFLOG option, I’m starting the daemon with «-q 0» option which seems to be the closest one and then I can control what I would like to feed towards Suricata):
$ suricata -D -q 0 -c /usr/local/etc/suricata/suricata.yaml
stats.log (13.1 KB)
suricata.log (1.7 KB)
suricata.yaml (84.4 KB)
Intermediate test already showing that the construction does not work: I’m trying to start tcpdump for nflog group 5 after I started Suricata and assuming Suricata is already listening on nflog group 5 (as per suricata.yaml config).
The expected behaviour for tcpdump is to terminate with error (since two processes can’t listen the same nflog group simultaneously), but in my case tcpdump starts OK:
$ tcpdump -n -i nflog:5
tcpdump: verbose output suppressed, use -v[v]… for full protocol decode
listening on nflog:5, link-type NFLOG (Linux netfilter log messages), snapshot length 262144 bytes
This means that Suricata does not listen on nflog group 5.
Just as a proof running e.g. ulogd2 to listen to nflog group 5 and then trying to run tcpdump on the same group returns an error.
Summarizing:
- I’ve used the original template suricata.yaml config with the following custom changes: A) HOME_NET set to self-ip/32; B) nflog group set to 5; C) eve-log is disabled;
- I’ve started Suricata with «-D -q 0» options and confirmed that it does not listen expected nflog-group.