大网数据广告活动
服务器运维问答

Suricata, Docker, and host networking: No non-docker traffic

· 52CE 我爱测

I've created a docker container with Suricata and Evebox on it. On my host I start with: ifconfig enp2s0:1 192.168.0.111 netmask 255.255.255.0 up This sets up a new interface off my existing one. I then run the docker container l…

问题原文

原帖链接 · Fmstrat · CC BY-SA 4.0

I've created a docker container with Suricata and Evebox on it. On my host I start with:

ifconfig enp2s0:1 192.168.0.111 netmask 255.255.255.0 up

This sets up a new interface off my existing one. I then run the docker container like so:

docker run --privileged --network host --cap-add NET_ADMIN --cap-add NET_RAW --rm suricata-evebox

I then fire up suricata/evebox with:

mkdir -p /data/evebox
suricata -i enp2s0:1 -D
evebox -v -D /data/evebox --datastore sqlite --input /var/log/suricata/eve.json

Here are the scenarios when running curl http://testmyids.com from machines:

  • Inside a docker container: DETECTS ALERT
  • On the docker host: DETECTS ALERT
  • On a machine on the local network: DOESN'T SEE IT

Is there a way to get Suricata to see all traffic traveling over the network, not just that of the host and the containers?

已采纳解答

原帖链接 · Nico I · CC BY-SA 4.0

First here's a possible solution that could either be set up on the router itself or on any machine you'd like monitored: https://superuser.com/questions/853077/iptables-duplicate-traffic-to-another-ip

If that's not possible for your use case, there's another option in the form of a switch that can be set up between your router and all the clients, the switch should support port mirroring. You'd then add another NIC to your ids/docker host which would receive all the traffic from the mirrored switch's "WAN" port, which can be passed through to your suricata container.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-06-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。