I forgot to post this question in the barnyard/ssh tunnel thread, but thought it wasn't exactly related and might warrant a new topic.
In attempting to ignore all unnecessary traffic to reduce dropped packets and spare disk space, I have applied a common BPF filter to Snort and Daemonlogger, using:
# UTC specific options
if [ "$SENSOR_UTC" == "Y" ]
then
SNORT_OPTIONS="-U ${SNORT_OPTIONS}"
SNORT_BPF="/etc/nsm/bpf.filter"
DAEMONLOGGER_BPF="/etc/nsm/bpf.filter"
BARNYARD2_OPTIONS="-U ${BARNYARD2_OPTIONS}"
DATE_OPTIONS="-u"
fi
and then:
[ -z "$SKIP_SNORT_ALERT" ] && process_start "snort" "-u $SENSOR_USER -g $SENSOR_GROUP
-c $SNORT_CONFIG --daq afpacket -i $SENSOR_INTERFACE_SHORT -F $SNORT_BPF -l $SENSOR_LOG_DIR $SNORT_OPT
IONS" "$PROCESS_PID_DIR/$SENSOR/snortu.pid" "$PROCESS_LOG_DIR/$SENSOR/snortu.log" "snort (alert data)"
and
[ -z "$SKIP_DAEMONLOGGER" ] && process_start "daemonlogger" "-u $SENSOR_USER -g $SENSOR_GROUP -i $SENSOR_INTERFACE_SHORT -f $DAEMONLOGGER_BPF -l $SENSOR_LOG_DIR/dailylogs/$TODAY -n snort.log -s 13
4217728" "$PROCESS_PID_DIR/$SENSOR/daemonlogger.pid" "$PROCESS_LOG_DIR/$SENSOR/daemonlogger.log" "daem
onlogger (full packet data)"
For reference, I'm trying to ignore all traffic to and from the specified IPs, so the filter file looks like:
!(host firewall.ip.to.ignore) &&
!(host firewall.ip.to.ignore) &&
!(host firewall.ip.to.ignore) &&
!(host firewall.ip.to.ignore)
The seen traffic still seems high compared to pre-BPF numbers and I was wondering if you knew of a way to verify that the filters are working properly?
Thanks for any insight.
- Philip
Hope that helps!
Thanks,
Doug
--
Doug Burks
Security Onion | http://securityonion.blogspot.com
President, Greater Augusta ISSA | http://augusta.issa.org
SANS Augusta 6/11 - 6/16 | http://www.sans.org/augusta-2012-cs/
--
Shane Castle
Data Security Mgr, Boulder County IT
CISSP GSEC GCIH
Thanks for the reply.
Would putting a BPF filter on my PC IP, then executing 'curl http://testmyids.com' and looking for the alert, before and after restarting the nsm scripts, also be a valid test?
If that test is valid and the script syntax is correct, is it safe to assume that the filters are working and the disk filling is at the correct rate, or might there be other processes logging large amounts of data?
Thanks.
- Philip
Doug
--
Thanks for the replies and tools to look at.
Initially my main concern was not only the traffic being processed by Snort, but the pcaps from daemonlogger filling the HDD.
My other response seems to have come in a little late, but I figured the curl test was a very rudimentary way to test Snort, but I wasn't sure how to verify what exactly daemonlogger was writing to the drive.
With the script additions I made and past experience with the BPF filters reducing traffic much more, the high traffic I was seeing compelled me to think I had mis-scripted something and only gotten half the solution in place.
I guess I wanted a way to search the pcaps independent of Snort/Sguil. Actually, in thinking about it, I guess the pcaps could be opened with Wireshark or something...
Ultimately, the answer was much more simple than all of this. In my absence, the enterprise team had installed multiple backup appliances that were replicating data in real time and they had not been accounted for in the BPF filters. In the end, I went from 360 Mbps all day down to 20 Mbps.
Thanks again for the insight and pointers on tracking this down.
- Philip