How does Suricata PCAP retention work? #15626
-
Version2.4.211 Installation MethodSecurity Onion ISO image Descriptionconfiguration Installation TypeDistributed Locationon-prem with Internet access Hardware SpecsExceeds minimum requirements CPU20 physical, 80 logical RAM132 Gig Storage for /293G Storage for /nsm1.5T Network Traffic Collectionspan port Network Traffic SpeedsLess than 1Gbps StatusYes, all services on all nodes are running OK Salt StatusNo, there are no failures LogsNo, there are no additional clues DetailI'm trying to figure out how Suricata pcap retentions works (stenographer is disabled). I have 2 search nodes configured the same but they do collect different amounts of traffic on each. secionionfwd1 is holding steady at 90% NSM partition usage and secionionfwd 2 is at 71%. Config -> Suricata -> pcap -> maxsize is at 1164G for both, but that does not appear to be what is keeping the NSM volumes in-check. If I do a du -h --max-depth=1 from fwd1 /nsm I see the suripcap has 806G, which is less than 1164, so it seems some other mechanism is helping to keep the fwd1 /nsm to stay at 90%. Guidelines
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Update: If I reduce maxsize the overall /nsm volume does drop so that does appear to be the correct mechanism, however, I'm still confused about the numbers. Perhaps the du -h --max-depth=1 command is missing some files that maxsize is including in the calculation? |
Beta Was this translation helpful? Give feedback.
-
|
Suricata has its own cleanup mechanism based on the maxsize setting but it then does some math. The code looks like this: Suricata cleans up based on file counts and not size. "max-files" is the number of pcap files per thread to keep. So if you have it set to 100GB in the pillar, pcap.filesize set to 5GB and then threads set to 5, your maxfiles would be set to 4. 5 threads x 4 files that are 5GB is 100GB. It's not exact and can be tweaked. If you have a sensor that sees a lot of traffic then this number is pretty accurate. If you have a sensor that doesn't see a lot of traffic this could be less accurate since it might not fill the pcap file before roll over. It;s cleanup mechanism is just counting files and doesn't care about their sizes which can cause this to happen. |
Beta Was this translation helpful? Give feedback.
Suricata has its own cleanup mechanism based on the maxsize setting but it then does some math. The code looks like this:
Suricata cleans up based on file counts and not size. "max-files" is the number of pcap files per thread to keep. So if you have it set to 100GB in the pillar, pcap.filesize set to 5GB and then threads set to 5, your maxfiles would be set to 4. 5 threads x 4 files that are 5GB is 100GB.
It's not exact and can be tweake…