Collect, Filter, and Replay. Yep, exactly what you read! #660
MuriloChianfa
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello @phaag and hello people,
I bring an idea for integrate the collection with nfcapd, then filtering with nfdump, and later replay the filtered records. This would allows us to use the existing option -R from nfcapd but with a filter before forwarding with the repeater.
Background
I have some customers that want replay just some specific flows for other systems, and I think we could make an workflow integrating the three nfcapd collecting -> nfdump filtering and saving into another file -> nfreplay sending the filtered data. The problem here is that the minimum nfcapd rotation time is 2 seconds (I have a branch trying to lower it to 1 sec, btw 💅🏼), thus introducing a big delay on the replay process, which wouldn't be good for time sensitive systems, so that Idea started.
Previous Mentions
I searched in the repo about some mentions of it and I just found a pretty old mentioning on #253, where he suggests to run:
Therefore, replaying the received data, but just from some subnets (placed into the nfdump.filter file), not all data received.
Just that would be good to replay the filtered data, but we would introduce the delay as mentioned before (and would need the implementation of the filter on nfreplay).
Turning the Idea Feasible
I was thinking on integrate it directly into the -R replay option on nfcapd. I started to implement and test with some data.
Firstly, I start a new nfcapd collector listening for NetFlow v9 from my exporter on port 2055, with the repeater exporting to another local port, but with an additional parameter "-F", where it will filter the flows before forwarding to this repeater instance:
Next, I start a "standard" nfcapd listening on port 9997, where it all receive just the data for in if 222:
Note
Note that would be possible to have multiple repeaters, each one with a unique filter, example
-R 127.0.0.1/9997 -F 'in if 222' -R 127.0.0.1/662 -F 'in if 10' -R 192.168.0.100/9995 -F 'src net 100.64.0.0/10'
in if 222in if 10src net 100.64.0.0/10Results so far
The original data collected by the first nfcapd, without any filter:
Filtered data collected by the second nfcapd:
Discussion
Perceive the exporter is losing some flows when repeating the filtered flows, I still working on it, but that prove that would be possible to implement that idea. 😀 I would like to know what you guys say about it, would be useful for anyone more? More ideas and suggestions are welcome. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions