If you were at Suricon, you saw me mentioning a project called Bellini, where you could use Suricata from a rust application, by sharing packets using IPC. Here’s the related code for that:
I’m trying to add flow events from suricata as an output in suricata-ipc. When I shutdown suricata, I get flow messages out, but while suricata is running, I’m not getting flow messages out. Alerts and stats work like normal.
Recyclers is set to 3, managers is set to 2.
2020-04-03T20:45:23Z DEBUG broker_poc::process] Stats { decoder: Decoder { pkts: 7675, bytes: 1672792, invalid: 0, ipv4: 7659, ipv6: 0, ethernet: 7675, tcp: 6236, udp: 1423, sctp: 0, icmpv4: 0, icmpv6: 0, vxlan: 0, avg_pkt_size: 217, max_pkt_size: 1506 }, flow: Flow { tcp: 119, udp: 277, emerg_mode_entered: 0, emerg_mode_over: 0, memuse: 8048640 }, tcp: Tcp { sessions: 118, midstream_pickups:
2:48 PM 25, stream_depth_reached: 2, memuse: 6451280, reassembly_memuse: 1716268 } }
I’m also sending in a udp tracer once per minute, so would figure if nothing else, that should generate a flow message, since an alert is being generated. I’m guessing there’s something I’m missing in my source that is preventing the flow manager from seeing an appropriate timestamp for flows being expired.
The source is at src/source-ipc.c