Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 30 guests and 1 member online
 
Advertisement

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Otherarrow Fun with pfSense and Splunk
EH-Net
May 22, 2013, 12:09:58 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Fun with pfSense and Splunk  (Read 5111 times)
0 Members and 1 Guest are viewing this topic.
3xban
Hero Member
*****
Offline Offline

Posts: 608


View Profile WWW
« on: January 13, 2013, 10:12:11 PM »

So I was able to take some time during a company shutdown week and do some network redesign in the home.  I took an Atom based "Shoebox" system and finally built myself a pfSense firewall.  I added Snort as well (built-in version to pfSense).  More on my adventure here.  I then spent a couple days just staring at the new found wonders of real logs!!!  I used some of the built-in look-ups and seeing who was scanning my IP.  I also threw Snort on but due to some frustrations, I placed it in detection mode. I will eventually go back to and turn up the prevention setting. 

So I had all this new logging capability, but really didn't have anything in place to collect it for analysis.  That was where Splunk came, pretty cool product if you have never used it.  It is primarily a log collection/reporting tool with a number of 3rd party applications that can be loaded in.  One in particular that I found useful, was the Google Maps App.  I then configured pfSense to Syslog the Firewall logs and configure Snort to send it's alerts to the System Log.  Then I setup the UDP listener in Splunk to pull the pfSense logs in.  Now for the fun part, Google Maps setups up Geo_IP plotting.  The simple search rule was basically showing all pfsense-firewall block activity.  I still haven't written this up, but I will eventually. 

This information is nifty but I am much more interested in the Snort data.  Unfortunately the Snort data was not being completely parsed in Splunk like the Firewall data.  I have been trying to find information on how to do this, but I have not had any real luck.  Splunk does have an app for Snort, but it seems it may be designed for the stand-alone.  I was thinking there may be much more I can configure for Snort behind pfSense but haven't gone down that route. If any one has any ideas on parsing out the Snort data, I'd be interested in hearing them.
Logged

Certs: GCWN
(@)Dewser
ajohnson
Recruiters
Hero Member
*
Offline Offline

Posts: 1057


aka dynamik


View Profile WWW
« Reply #1 on: January 15, 2013, 09:51:35 PM »

How do you have Snort logging at the moment? It can log to syslog. I assume Splunk can work with syslog data...
Logged

WIP: GCFA | www.infosiege.net | @infosiege

The day you stop learning is the day you start becoming obsolete.
3xban
Hero Member
*****
Offline Offline

Posts: 608


View Profile WWW
« Reply #2 on: January 17, 2013, 09:11:30 PM »

Currently I have the logs being sent to the pfsense system log.  I haven't been able to find any splunk docs properly parsing out the snort data.  Before I configured splunk to sort out the firewall data, I had to edit 2 files, which are (I imagine) instructions on how to parse the data properly:

props.conf
Code:
[source::udp:514]
TRANSFORMS-pfsense-firewall = pfsense-firewall
SHOULD_LINEMERGE = true
TRUNCATE = 0
MUST_NOT_BREAK_AFTER = pf: .* rule ([-\d]+\/\d+)\(.*?\):
MUST_BREAK_AFTER = pf: .* (<|>) +(\d+\.\d+\.\d+\.\d+)\.?(\d*)\:
REPORT-pfsense-firewall = pfsense-firewall

transforms.conf
Code:
[pfsense-firewall]
REGEX = .* (?<action>pass|block) .* (?<protocol>TCP|UDP|IGMP|ICMP) .* (?<src_ip>(\d+\.\d+\.\d+\.\d+))\.?(?<src_port>(\d*)) [<|>] (?<dest_ip>(\d+\.\d+\.\d+\.\d+))\.?(?<dest_port>(\d*)): (.*)
CLEAN_KEYS = 1
MV_ADD = 0

This then formats the reports in Splunk.  I imagine I can do something similar with the snort rules.  The snort logs come in looking like this:

Code:
Jan 17 20:54:15 192.168.0.254 Jan 17 20:54:14 snort[61858]: [1:2500006:2752] ET COMPROMISED Known Compromised or Hostile Host Traffic TCP (4) [Classification: Misc Attack] [Priority: 2] {TCP} SRCIP:PORT -> DESTIP:PORT

I may just have to read up on the use of the transforms and props files. 
Logged

Certs: GCWN
(@)Dewser
UKSecurityGuy
Newbie
*
Offline Offline

Posts: 25


View Profile
« Reply #3 on: April 17, 2013, 05:05:53 AM »

Sorry to Necro this thread, but did you ever get this working for you?

I use Splunk heavily so if you get stuck, give me a shout and I might be able to help.
Logged
3xban
Hero Member
*****
Offline Offline

Posts: 608


View Profile WWW
« Reply #4 on: April 17, 2013, 07:21:24 AM »

Hey no problem, no I never did get this piece working.  Haven't had a chance to revisit it but if you have some thoughts, I'd be interested in hearing them.
Logged

Certs: GCWN
(@)Dewser
UKSecurityGuy
Newbie
*
Offline Offline

Posts: 25


View Profile
« Reply #5 on: April 17, 2013, 08:08:12 AM »

I was going to do some extractions myself based on your sample, but there appears to be a Splunk app for this already:

http://splunk-base.splunk.com/apps/22369/splunk-for-snort-splunk-4x

The app seems to suggest that you've got just got to change the source types

Code:
Snort expects full alert logs to have a sourcetype of "snort_alert_full" and fast alert logs to have a sourcetype of "snort_alert_fast"

So assuming that you've only got one of the two input methods coming in, and assuming that only Snort is being pumped in via syslog on port 514, you could simply add one of these lines to the relevant inputs.conf

sourcetype = snort_alert_full
sourcetype = snort_alert_fast


In theory the app should take care of the rest.


Logged
3xban
Hero Member
*****
Offline Offline

Posts: 608


View Profile WWW
« Reply #6 on: April 18, 2013, 06:17:44 PM »

Hmm, I do have the app.  I think it was designed for a designated Splunk box.  pfsense is currently dumping all logs to syslog and the current Firewall setting is parsing that information.  I can probably change the settings to see if it can pull those out.  If so maybe I can do something with pfsense to send the snort logs another way.  This helps though.  I may muck around with it over the weekend.

Thanks!
Logged

Certs: GCWN
(@)Dewser
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.097 seconds with 23 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.