IDMEF is the Intrusion Detection Message Exchange Format.
The idmef module is a module that is at the same time:
- a dissection module, allowing Orchids to parse IDMEF alerts and pick selected nodes as input through XPath expressions
- an extension module, allowing Orchids to produce IDMEF reports.
The idmef module manipulates IDMEF alerts internally as XML objects, which one may explore and modify through the primitives provided by the xml module.
Configuration options – input
First, the options relevant to IDMEF input. Typically, input will be obtained from the textfile module, or from the .syslog.msg field from the syslog module, written in XML.
str_fieldfield-name xpath-expression: declares a new field.idmef.field-name, of typestr, which will be read from the node selected by the XPath expression xpath-expression.
Example:str_field c_text "/*/idmef:Alert/idmef:Classification/@text" str_field c_ident "/*/idmef:Alert/idmef:Classification/@ident"
bstr_fieldfield-name xpath-expression: declares a new field.idmef.field-name, of typebstr, which will be read from the node selected by the XPath expression xpath-expression.int_fieldfield-name xpath-expression: declares a new field.idmef.field-name, of typeint, which will be read from the node selected by the XPath expression xpath-expression. Conversion to typeintis automatic.
Example:int_field message_id "/*/idmef:Alert/@messageid"
uint_fieldfield-name xpath-expression: declares a new field.idmef.field-name, of typeuint, which will be read from the node selected by the XPath expression xpath-expression. Conversion to typeuintis automatic.float_fieldfield-name xpath-expression: declares a new field.idmef.field-name, of typefloat, which will be read from the node selected by the XPath expression xpath-expression. Conversion to typefloatis automatic.ctime_fieldfield-name xpath-expression: declares a new field.idmef.field-name, of typectime, which will be read from the node selected by the XPath expression xpath-expression. Conversion to typectimeis automatic.
Example:ctime_field create_time "/*/idmef:Alert/idmef:CreateTime" ctime_field detect_time "/*/idmef:Alert/idmef:DetectTime"
timeval_fieldfield-name xpath-expression: declares a new field.idmef.field-name, of typetimeval, which will be read from the node selected by the XPath expression xpath-expression. Conversion to typetimevalis automatic.ipv4_fieldfield-name xpath-expression: declares a new field.idmef.field-name, of typeipv4, which will be read from the node selected by the XPath expression xpath-expression. Conversion to typeipv4is automatic.
Example:ipv4_field analyzer_ip "/*/idmef:Alert/idmef:Analyzer/idmef:Node/idmef:Address/idmef:address"
ipv6_fieldfield-name xpath-expression: declares a new field.idmef.field-name, of typeipv6, which will be read from the node selected by the XPath expression xpath-expression. Conversion to typeipv6is automatic.snmpoid_fieldfield-name xpath-expression: declares a new field.idmef.field-name, of typesnmpoid, which will be read from the node selected by the XPath expression xpath-expression. Conversion to typesnmpoidis automatic.
Configuration options – reports
IDMEF reports can be built and written using the idmef_new_alert and idmef_write_alert primitives, see below. The following options allow you to set some of the nodes automatically.
IDMEFOutputDirreport-directory: defines the output directory whereidmef_write_alertwill store the generated IDMEF alerts to report-directory.
Default value is$OCONF/reports, which will typically point to/usr/local/var/orchids/reports/.AnalyzerIdid: sets theanalyzeridproperty of theAnalyzernode in the generated IDMEF alert to id.
Default value is42.AnalyzerNameanalyzer-name: sets thenameproperty of theAnalyzernode in the generated IDMEF alert to analyzer-name.
Default value isorchids.AnalyzerNodeNamestring: sets the value of theAnalyzer/Node/namenode in the generated IDMEF alert to string.
Default value is"orchids.lsv.fr".AnalyzerNodeLocationstring: sets the value of theAnalyzer/Node/locationnode in the generated IDMEF alert to string.
Default value is"LSV ENS Paris-Saclay", which you are encouraged to modify.AnalyzerNodeAddressstring: sets the value of theAnalyzer/Node/Address/addressnode in the generated IDMEF alert to string. It also sets the propertycategoryof that same node toipv4-addr.
Default value is"42.42.42.42", but that should of course be modified.
Primitives
idmef_new_alert: →xmldoc
create a new IDMEF documentidmef_write_alert:xmldoc→int
write the given IDMEF document into the Orchids report directory (typically/usr/local/var/orchids/reports/)- file name is report-directory
/report-secs-msecs.xml, where secs and msecs are the current time, split into seconds and microseconds, as 8 hexadecimal digits - returns: 1 (true) if all went well, 0 (false) otherwise
the causes of error can be: the reports directory is not set, or there was not enough space left on the device
- file name is report-directory
- Setting values and attributes is done by using the primitives provided by the
xmlmodule (xml_set_str,xml_set_prop)