Ver 1.3.2 - Last Updated 07/12/2006
This is a quick guide to help you setup SnortSMS. It will be assumed you have at least to servers available to fuction as the SnortSMS Collector and SnortSMS Sensor.
SnortSMS Collector
Be sure include the CLI build option for PHP as SnortSMS requires some scripts to execute from the command line shell. Since SnortSMS uses cURL in CLI mode via shell system calls and forking, so you do not need cURL libs compiled into PHP directly. Mysql, pcre, and pcntl should be compiled into PHP or available as a PHP module extention.
SnortSMS IDS Sensor
The sensor Agent software is a custom Webmin module, so you will need to install Webmin on the sensor as a prerequisite. This shouldn't be an issue since Webmin is also a great Administration tool for the sensor as well.
Barnyard is an optional tool which allows Snort alerts to be propagated to a central database in the background. Although Snort can write to the database directly, we recommend Barnyard as it is more reliable and frees Snort of latency and fail-over issues.
Prerequisites
We assume you have an available server established with Apache, PHP (with above requirements), and MySQL client libraries (and MySQL server - if you plan to run the databases locally).
Installing the SnortSMS Collector Website
# chown :www conf/ conf/conf.php # chmod 775 conf/ # chmod 664 conf/conf.php
max_execution_time = 120 max_input_time = 120 memory_limit = 100M post_max_size = 20M upload_max_filesize = 20M include_path = ".:/usr/local/share/pear"
# mkdir /var/tmp/snortsms # chmod 1777 /var/tmp/snortsms
Creating the SnortSMS Database
# mysql -u root -p < {snortsms_source}/schema/SNORTSMS.mysql
Creating the Snort Alert Database (optional)
If you would like a central database where all Snort sensors can send the Alert events to, you can create a Snort database on the SnortSMS collector or an alternate server.
# mysql -u root -p < {snort-x.x.x}/schemas/create_mysql
Modify the Snort Event Database
Note: If you plan to use the SnortSMS Alert Browser to view incoming alerts, you will need to modify Snort's default database.
mysql> use {your snort db name}; mysql> alter table event add column viewed tinyint (1);Or execute the script we've supplied with SnortSMS:
# mysql -d {SnortDB} -u root -p < {snortsms_source}/schema/SNORT_DB_mod.mysql
Prerequisites
We assume you have an available server established with a basic installation of Snort and Webmin (also Barnyard and MySQL Client libraries if you desire to propagate Snort Events to a central database).
Installing the SnortSMS Agent
The SnortSMS Agent is designed to reside on the remote Snort sensor and is packaged as a third-party Webmin Module. The Agent included with the SnortSMS Collector distribution under the 'Agent' directory path. This Agent allows the SnortSMS Collector server to communicate and remotely control the sensor.
Prerequisites
At this juncture, you should have a SnortSMS Collector and at least one SnortSMS sensor established and functional. We will now walk you through a few steps required to get SnortSMS configured and start managing your Snort sensor(s).
Configure SnortSMS global settings
Create a Snort Daemon Profile
You MUST create at least one Snort Daemon Profile.
This is used to tell SnortSMS how to launch the snort process on the remote sensor.
Populating the libraries
Before you can assign configurations to your sensors, you must first populate the SnortSMS configuration libraries.
The easiest way to fill up the libraries is to import the various Snort snapshot tarball files.
The Snort source code tarball contains much of the default varaibles and config directives.
There are also many VRT and Community rules now available in seperate files.
So start by importing the Snort source tarball (i.e. Snort-x.x.x.tar.gz). Don't worry, SnortSMS will only find what it needs.
Next, import any of the Rule distribution tarballs (i.e. Community-Rules-x.x.tar.gz).
You can either download it to your local desktop or import it from the web.
This will parse the tarball file, detecting any and all rules and directives, thus populating the SnortSMS libraries accordingly. Once this is done, you should be able to browse the libraries and verify the imported resources.
Create a Rule Profile
Now that your resource libraries are full, we suggest you 1st create at least one rule profile.
You cannot assign rules directly to sensors, only rule profiles can be assigned to each sensor.
Adding Sensors
Now you are ready to adding sensor profiles into the system.
Testing
At this point, SnortSMS should be properly configured. We also assume you have at least one functional Snort-base sensor defined.
From the Administration Console, click anywhere on your sensor line. You should be able to get statistical data from the 'Status' tab.
There is also a "Test Configuration" under the Settings menu. This is very helpful in determining common issues.
Issue: | I get an error while trying to save the Global Settings. |
Resolution: | Be sure the "conf.php" file has read/write permissions by the webserver. This includes the parent "conf" directory. |
Issue: | I cannot connect to the remote agent. |
Resolution: | A ton of reasons for this one: - Be sure to "Disable session authentication" in Webmin. - Are you using the correct protocol (http/https)? - Username exits within Webmin and the user has access granted to the SnortSMS Agent module. - Does cURL work from the command line? |
Issue: | I get a database connection error. |
Resolution: | Verify your database server and table installation. Insure you have the correct username and password configured in SnortSMS Global Settings and in your database permissions section. |
Issue: | I get an error "Missing DB.php". |
Resolution: | - Be sure the PEAR-DB abstraction layer is properly installed. - Check that your PHP "include" path is correct and includes the path to the PEAR files. |
Issue: | Importing Snort snapshot file failed. |
Resolution: | - Verify your path setting for temporary files in 'SnortSMS Global Settings'. - Verify your temp path is read/writable by your web server userid (chmod 1777 /tmp/path). - Verify correct paths for 'curl' & 'tar' on your web server in 'SnortSMS Global Settings' and that cURL is working properly. - Verify your max upload, max memory, and max execution parameters in 'php.ini' config file. |
Issue: | Barnyard Fails to start via SnortSMS. |
Resolution: |
- In Barnyard Daemon Profiles section, verifiy path to barnyard executable on sensor. - In Barnyard Daemon Profiles section, verifiy path to PID file on sensor. - Take a look at the Barnyard command trace file. Should be located on the sensor in the snort config directory under the filename 'SMS_barnyard.?.conf.CMD'. |