SnortSplunkIntegration
SnortSplunkIntegration
PREPARED FOR
Professor Ali Hadi
SEC350-02
PREPARED BY
Caitlin Allen & Doug Kapinos
Your students
Project Goals and
Scope
In an environment set up from scratch, we integrated the network intrusion detection
system (NIDS) Snort with our security information and event management (SIEM)
solution Splunk. The environment was set up to meet all requirements for
segmentation, firewalling, and logging (which will be highlighted in the
documentation).
Snort is a free NIDS, with the option to pay for different rule sets to use in our firewall.
Snort also provides sniffing and packet logging modules to use as well, making it a
well-rounded packet analysis tool. We will be using the Community Rules and
designing a few of our own local rules. Snort rule sets are easy once you get the syntax
down and can understand the rule structure.
This is the general syntax you want to follow. For any additions to the syntax, they will
be explained.
Log output can be formatted in a few different ways, like:
- alert_syslog
- alert_fast
- alert_full
- alert_unisock
There are a few different other ways to format them, but we will be using alert_syslog.
The alert_syslog format ships logs to the syslog, you can specify the logging facility
and priority within the Snort config file and ship these logs to your SIEM solution.
Our penetration testing platform is Mutillidae, is an open-source deliberately vulnerable
web-application that allows upcoming pen testers or web app security enthusiasts to
practice exploits. This web app is installed using the LAMP stack, composed of four
different open-source components:
- Linux
- Apache
- MySQL
- PHP/Perl/Python
Mutillidae is easy to use and allows the user to toggle levels of security, gives hints, and
offers OWASP resources on different exploits.
We need to install from the source, Snort ran into issues with installing from yum. This
documentation is for the current version of Snort available, the download link for a more
current version later is available on the S
nort website under Binaries.
In Vim, you can use / to search for lines! This is a long configuration file so be sure to
make sure you made these changes.
#syslog
Output alert_syslog host=IP_OF_SYSLOG_BOX:514 LOG_AUTH LOG_ALERT
# unified2
# Recommended for most installs
output unified2: filename snort.log, limit 128
include $RULE_PATH/community.rules
9. Validate the Snort settings
sudo snort -T -c /etc/snort/snort.conf
10. If you get an error, run this command and retry to validate the settings.
ln -s /usr/lib64/libdnet.so.1.0.1 /usr/lib64/libdnet.1
When Snort is successfully installed and initialized, you should see this.
11. You now can test the configuration by setting a basic rule to alert ICMP connections.
This can also be tweaked to alert for potential nmap attempts since nmap utilizes
ICMP for OS Fingerprinting, service detection, and network scanning.
Figure 4: Splunk snortd.logs and where to find them in the search app
Figure 5: ICMP test logs (Field extraction done for Dashboards)
3. Setting Up Mutillidae
On the snort host, you will be installing the following packages.
1. httpd
2. mariadb-server
3. mariadb
4. php
5. php-mysql
6. php-pear
7. php-pear-db
8. php-mbstring
9. git
This is a CentOS box so yum is how you should be downloading these packages!
Start the httpd service after installation and open port 80 with firewall-cmd
For the following questions after the password prompt, make sure to allow remote
access
Figure 6: Mutillidae
1. OWASP 2017 > Cross Site Scripting (XSS) > Reflected (First Order) > Echo
Message
Try to get some logs like this and we can begin to make dashboards
5. Dashboard Building
Every good SOC analyst wants a comprehensive dashboard they can open Splunk right up
to.
Create a line graph dashboard panel, for the search, we’ll want to see what hosts are
spiking in activity.
You want to pipe your results to timechart to show the timing of the attacks, which would
be needed for incident response to generate a timeline and identify when an attacker made
attempts, you will then count by host to count each time a host has been breached.
Figure this out for the other attacks and even add a few other panels, we included nmap
attempts for ICMP tests and failed logons by host in case of brute force. To make this
easier, use field extraction to extract the exact log messages from Snort you are looking for.
Figure 18: Final dashboard of Snort logs and failed logons with ICMP connections
Each VM had to be loaded as an ISO then deployed. One issue we discovered early on was
with the unstable version of VyOS we were using, since stable current versions cost money,
anytime Caitlin shut down the server, our VyOS settings were wiped from the entire VM.
Committing to the configuration file did not matter, VyOS essentially had volatile memory.
To solve this, anytime any work was done on VyOS, we snapshotted the machine and were
able to overcome this by restoring from the snapshot.
Another issue was Snort’s network placement. It was not intended to be set up as a host
but as a NIDS for the DMZ. However, just due to configuration issues and realizing that it
would not intercept until too late, we decided to put Mutillidae on snort and log directly
from the box. To solve this, we would have had to do major network reconfigurations.
8. Conclusion
Snort is a fun packet analyzer with many capabilities! Using the provided link and Snort
documentation, building rules to integrate with Splunk
You can use simple rules to get started and use regex, encoding, etc. to get more precise in
what your NIDS will detect and ship to Splunk.
Our environment was built on Caitlin’s HP Proliant DL380 Gen 7 server with ESXi
hypervisor. Different network segments were created within ESXi to segment the network
and configure the firewalls.