Hello all,
We recently deployed a small group of Security Onion boxes in our environment in a server / sensor deployment. We've had some issues with ELSA since day one and recently decided to re-run sosetup on all the sensors to get ELSA working again. Our sensors (and our console) do not have internet access - our console will eventually, but there are no plans to connect the sensors to the internet. Attempting to run sosetup (utilizing a configuration file) results in hanging at "Configuring Elsa" and eventually errors out. After this, all services start but ELSA still does not function. I have read that this could be a result of the sensors not being able to download new GeoIP rules, but I have not stumbled on a workaround for this while running sosetup using a config file. However the error messages we are getting indicate to me that sosetup is failing to edit the elsa_web.conf on the server. The user given to sosetup has passwordless sudo access on the server. If this is an issue of downloading geopIP rules, what is the best method to disable attempts to download rules while running sosetup utilizing a configuration file, or is there another problem going on here??
Here are the errors we are getting, and the configuration file I am using as well. The elsa_web.conf file on the sensor also appears suspicious to me, and I can upload that if it may be helpful.
Thanks in advance for any help on this issue!
root@sensor:/etc# sosetup -f /home/user/sosetup.conf
Security Onion Setup
Ready to configure system using parameters in /home/user/sosetup.conf.
WARNING! Continuing will destroy any existing data/config.
Are you sure you want to continue?
Type yes to continue or anything else to exit.
yes
Please wait while...
setting OS timezone to UTC...
setting OSSEC timezone to UTC...
restarting OSSEC...
stopping all NSM services...
creating Sguil sensor(s)...
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
creating Sguil sensor: sensor-eth0...
creating Sguil sensor: sensor-eth1...
configuring /etc/nsm/securityonion.conf...
stopping and disabling Apache...
configuring salt...
starting all Security Onion services...
configuring ELSA...
/usr/lib/ruby/1.9.1/json/common.rb:148:in `parse': 746: unexpected token at '{ "apikeys": { "elsa":
"7f5d85fd4e361258dd643a09314e356e" }, "version": { "Author": "mcholste", "Date": "2014-07-17 15:12:58 -0700 (Thu,
17 Jul 2014)", "Rev": "1205", "Sphinx": "Sphinx 2.1.9" }, "peers": { "127.0.0.1": { "url":
"
http://127.0.0.1:3154/", "username": "elsa", "apikey": "7f5d85fd4e361258dd643a09314e356e" }, },
"admin_email_address": "root@localhost", "connectors": { }, "dashboards": { }, "datasources": { }, "transforms": {
"whois": { "known_subnets": { "10.0.0.0": { "end": "10.255.255.255", "org": "MyOrg"
}, "192.168.0.0": { "end": "192.168.255.255", "org": "MyOrg" }, "172.16.0.0": {
"end": "172.31.255.255", "org": "MyOrg" } }, "known_orgs": { "MyOrg": {
"name": "MyOrg", "org": "MyOrg", "descr": "MyOrg", "cc": "US", "country": "United
States", "city": "Anytown", "state": "Somestate" } } }, "parse": { "tld": [
{ "field": "domain", "pattern": "\\.([a-zA-Z]+)$", "extractions": [ "tld"
] }, { "field": "site", "pattern": "\\.([a-zA-Z]+)$", "extractions": [
"tld" ] }, { "field": "uri", "pattern": "\\.([a-zA-Z]+)(:|/|$)",
"extractions": [ "tld" ] } ], "url": [ { "field": "uri",
"pattern": "(?:(?<proto>[a-zA-Z]+)://)?(?:(?<username>[^/]+):(?<password>[^/]+)@)?(?<domain>\\d{1,3}\\.\\d{1,3}\\.\\d
{1,3}\\.\\d{1,3}|[^/]+\\.(?<tld>[a-zA-Z]+))(?::(?<port>\\d+))?(?<resource>/[^?]*)?(?:\\?(?<query_string>.*))?$",
"extractions": [ "proto", "username", "password", "domain", "tld",
"port", "resource", "query_string" ] } ], "mimetype": [ {
"field": "msg", "pattern": "[\"'\\(\\[\\s\\|;:](?<mime>(?<type>application|audio|chemical|image|
message|model|multipart|text|video)/(?<subtype>[\\w-_]+))[\"'\\)\\]\\s\\|;:]", "extractions": [
"mime", "type", "subtype" ] } ] } }, "plugins": { "SNORT":
"Info::Snort", "WINDOWS": "Info::Windows", "URL": "Info::Url", "BRO_NOTICE": "Info::Bro" }, "info": {
"snort": { "url_templates": [ "
http://doc.emergingthreats.net/bin/view/Main/%d" ] }, "url": {
"url_templates": [ "
http://whois.domaintools.com/%s" ] }, "windows": { "url_templates": [
"
http://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=%d" ] } },
"max_concurrent_archive_queries": 4, "schedule_interval": 60, "node_info_cache_timeout": 60, "email": {
"display_address": "
norepl...@example.com", "base_url": "
http://elsa/", "subject": "ELSA Alert" }, "link_key":
"secret", "yui": { "local": "inc" }, "data_db": { "db": "syslog", "username": "elsa", "password": "biglog"
}, "meta_db": { "dsn": "dbi:mysql:database=elsa_web", "username": "elsa", "password": "biglog" }, "auth": {
"method": "security_onion" }, "admin_groups": [ "system", "admin" ], "auth_db": { "dsn":
"dbi:mysql:database=securityonion_db", "username": "root", "password": "", "auth_statement": "SELECT PASSWORD
(password) FROM user_info WHERE username=?", "email_statement": "SELECT email FROM user_info WHERE username=?" },
"peer_id_multiplier": 1000000000000, "query_timeout": 55, "pcap_url": "/capme", "logdir": "/nsm/elsa/data/elsa/log",
"buffer_dir": "/nsm/elsa/data/elsa/tmp/buffers", "debug_level": "TRACE", "default_start_time_offset": 2, "livetail": {
"poll_interval": 5, "time_limit": 3600 }}' (JSON::ParserError)
from /usr/lib/ruby/1.9.1/json/common.rb:148:in `parse'
from /usr/bin/securityonion_elsa_register.rb:214:in `parse_conf'
from /usr/bin/securityonion_elsa_register.rb:348:in `<main>'
Security Onion Setup is now complete!
FWIW I've seen similiar threads where the issue appears to be permissions on the server's elsa_web.conf - permissions appear to be correct on ours.
user@server:/etc$ ls -lah elsa_web.conf
-rw-rw-r-- 1 root securityonion 4.1K Aug 30 14:39 elsa_web.conf