On Thu, 6 Sep 2012, Boyles, Gary P wrote:
Hi,
I'm new to SEC and have one problem I'm hoping can be solved within SEC.
I want to load a (hash) table on SEC startup that contains the host (e.g.
foobar.x.y.com) as the key, and a value such as location (e.g.
site.building.room.row.rack).
So... for 100 hosts I'd have a hash-array where I access the location of each
host, and then use that for additional processing.
I'd like to be able to load this table on startup, and then use it for all my
events (for given patterns).
Possibly via a context expression/mini-program???
I assume this could be setup with an SEC_STARTUP event, but a real-life example
would be most helpful.
Here's what I have on one of my servers, it loads a list of known IP
addresses into a hash and has an option to reload the table without
needing a restart
the input is a file
category|ip
I then have other rules that check to see if an admin login is from an
unexpected IP address and alert on it.
type=Single
desc=Load known admin IPs on startup
ptype=RegExp
continue=TakeNext
pattern=(SEC_STARTUP|SEC_RESTART)
context=[SEC_INTERNAL_EVENT]
action=eval %a ( open(FILE, "</etc/sec/known_admin_ips.txt");\
while (<FILE>) { chomp; @junk=split; $known_admin_ips{$junk[0]}{$junk[1]} =
1}; close(FILE) )
type=Single
desc=reload known IPs
ptype=SubStr
continue=TakeNext
pattern=reload known IP addresses
action=eval %a ( %known_admin_ips=(); open(FILE,
"</etc/sec/known_admin_ips.txt"); \
while (<FILE>) { chomp; @junk=split('|',$_);
$known_admin_ips{$junk[0]}{$junk[1]} = 1; }; close(FILE))
David Lang------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users