Posts Tagged ‘splunk’

http://www.splunkninja.com/profiles/blogs/getting-more-intelligence-on

Great article from Michael Wilde on how to see how much data you are indexing from Splunk

This requires that the Splunk agent is getting the security event from the Domain Controller(s).

  1. Find the username of the person
  2. Log in to the Splunk server.
  3. Click on the Search button.
  4. Enter the search paramitters to find the user and select your time frame for the search:
    source=”WinEventLog:Security” User_Name=”lockedUser”
  5. Then check the “Client_Address” field.  This can be found on the left column.
  6. The client IP shows where the lockout came from.

1. Find the username of the person

2. Log in to the Splunk server.

3. Click on the Search button

4. Enter the search paramitters to find the user and select your time frame for the search:
source=”WinEventLog:Security” Type=”Failure Audit” User_Name=”lockedUser”

5. Then check the “Client_Address” field. This can be found on the left column

6. The client IP shows where the lockout came from.

I have used OSSEC in the past to watch the file system for changes.  When I found that I can have the Splunk agent handle the monitoring itself, I was pretty excited.  Since I would send my OSSEC data to Splunk anyways, it just seemed logical to have Splunk do everything.

In Windows, you need to edit the “c:program filesSplunketcsystemlocalinputs.conf” file.  Of course your path could be different if you installed it in a different place.  There are a lot of options and switches you can use.  I went for the simplest set.

[fschange:d:temp]
recurse=true
pollPeriod=3600

This will monitor the d:temp folder and all files and folders under it.  It will check the system every 3600 seconds (1 hour).

This has helped me keep track of the changes in my servers.  I can see when a file was add/deleted/changed (due to the hash) and then look at who was logged in during the period that the file was changed.

Splunk File Delete

Splunk article on the switches and FSCHANGE.
http://www.splunk.com/base/Documentation/4.0.3/Admin/Monitorchangestoyourfilesystem

[fschange:d:temp]
recurse=true
followLinks=false
pollPeriod=60

Thanks to Michael Wilde for the information on RegEx in Splunk.  For those like me who aren’t the best at RegEx, I will show some of the regular expressions I am using for OSSEC.

Server Name
(?i) Location:s((?P<FIELDNAME>.*?))s

Windows Event User
(?i) USER: (?P<FIELDNAME>[^:]*);

Server IP
(?i)^[^)]*)s+(?P<FIELDNAME>[^-]*)-

Windows Events
(?i)^[^-]*-s+(?P<FIELDNAME>[^.]*).

LogInUser
(?i) Name: (?P<FIELDNAME>w+)

LogInDomain
(?i) Domain: (?P<FIELDNAME>[^ ]*)[ ]

******************************************************

Now, to add them…

Open your browser and login in to your Splunk server.  In the Search application, type sourcetype=”ossec”
Type Search ossec

or click on “ossec” in the Sourcetypes

Click Search ossec

You should see a bunch of data from the OSSEC server.  On the left of the main frame of the webpage, there should be a grey down arrow.  Clicking on this I get two options.  You want to select  Extract Fields.
Click Extract Fields

Here is where it gets fun.  Splunk included a graphical RegEx builder based on examples.  I ended up playing with this for a while.  Once you have found the expression you like, click on the Save button.
Click Save RegEx

Name your RegEx and click Save.
Save Field

Restart your Splunk server.
Once restarted, on the main search page, on the left sidebar click on Pick fields.
AddField

Here you can select the fields that will be displayed on the search page.
SelectFields

When you get back to the search page, you will notice the new fields.
Showing

I have been playing with OSSEC and Splunk.  OSSEC is a Host based Intrusion Detection System (HIDS).  Splunk is a log archiving and searching system.  OSSEC is open source and is multiple platform.  You can run it on Linux/Unix and Windows.  I am using OSSEC to forward Windows Event Logs to Splunk.  Splunk makes the searching and correlation.  Splunk can do WMI.  This would be great since no agent would need to be installed.  The problems is that if you have more than 30-50 systems, the amount time and traffic would cause issues.  Using the OSSEC agent, I am able to push the event logs to the OSSEC server.  From there the OSSEC server will upload to the Splunk server via Syslog.

Right now I have the servers all talking but I do need to adjust a few things.  Right now Splunk sees all the hosts as the OSSEC server.  I believe I just need to tweak the fields.  The question is how.

Splunk
http://www.splunk.com

OSSEC
http://www.ossec.net