Building Collector Plugins 1.1 - AlienVault
Building Collector Plugins 1.1 - AlienVault
Building Collector Plugins 1.1 - AlienVault
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Building</strong> <strong>Collector</strong> <strong>Plugins</strong> - Admin Guide<br />
2.7 Rules<br />
The Rules define the format of each event and how they are normalized. It is composed by a regular<br />
expression and the list of fields that the event will include once it is sent to the OSSIM Server.<br />
In some cases only one regular expression will collect every event coming from one application, in<br />
some other cases more than one rule will be required.<br />
2.7.1 Evaluation Order<br />
Rules are loading in alphabetical order based on the name given to each rule (Rule ID).<br />
Once the log matches the regex of one rule the ossim agent stops processing the event, therefore<br />
generic rules must be the last to be evaluated.<br />
2.7.2 Structure<br />
o<br />
Name / Rule ID<br />
The name of the rule is mandatory<br />
o<br />
Regular Expression<br />
The regexp field contains the regular expression that defines the format of the events, and<br />
extracts the information to normalize the event.<br />
The regular expression has to be written following Python regular expression syntax:<br />
http://docs.python.org/library/re.html<br />
The information extracted by the regular expression from the log can be accessed by:<br />
Position: (\d\d):(\d\d):(\d\d)<br />
hour={$1}<br />
minutes ={$2}<br />
seconds={$3}<br />
Tags: (?P\d\d):(?P\d\d)(?P\d\d)<br />
hour={$hour}<br />
minutes ={$minutes}<br />
seconds={$seconds}<br />
o<br />
Normalized Fields<br />
As the server must receive normalized events, where IP addresses for instance are using the<br />
IPV4 format and the date uses the format YYYY-MM-DD HH:MM:SS (2010-12-31 22:57:00)<br />
To simplify the process of normalizing events functions are defined (more details on<br />
functions can be found in the “Functions” section of this document):<br />
resolv()<br />
Translates hostnames into IPV4 addresses (DNS queries)<br />
Page 19 Copyright © Alienvault 2010