{"id":347,"date":"2006-12-26T04:25:00","date_gmt":"2006-12-26T04:25:00","guid":{"rendered":"https:\/\/defragged.org\/ossec\/?p=347"},"modified":"2020-07-03T04:27:15","modified_gmt":"2020-07-03T04:27:15","slug":"correlating-multiple-snort-ids-with-ossec","status":"publish","type":"post","link":"https:\/\/defragged.org\/ossec\/2006\/12\/correlating-multiple-snort-ids-with-ossec\/","title":{"rendered":"Correlating multiple snort IDS with OSSEC"},"content":{"rendered":"\n<p>I was asked recently what is the best way to correlate multiple&nbsp;<a href=\"http:\/\/www.snort.org\/\">snort<\/a>&nbsp;events with&nbsp;<a href=\"http:\/\/www.ossec.net\/\">OSSEC<\/a>. The idea would be to generate an ossec alert (by e-mail and possible an active response) if a specific number of snort rules are fired from the same source IP address (in any order)..<\/p>\n\n\n\n<p>The easiest way to solve this is by creating a local ossec rule (inside local_rules.xml) to match if any of the desired snort signatures are fired:<\/p>\n\n\n\n<p>&lt;rule id=\u201d100015\u2033 level=\u201d6\u2033&gt;<br>&lt;if_sid&gt;20101&lt;\/if_sid&gt;<br>&lt;decoded_as&gt;snort&lt;\/decoded_as&gt;<br>&lt;id&gt;1:xx|1:yy|1:zz&lt;\/id&gt;<br>&lt;description&gt;Watched snort ids&lt;\/description&gt;<br>&lt;\/rule&gt;<\/p>\n\n\n\n<p>Note that&nbsp;<em>1:xx<\/em>,&nbsp;<em>1:yy<\/em>&nbsp;are the snort ids that you are interested to watch. We use the&nbsp;<em>&lt;if_sid&gt;<\/em>&nbsp;to make sure that this rule is only tested if it is an IDS event (see rule&nbsp;<a href=\"http:\/\/www.ossec.net\/rules\/?f=ids_rules.xml\">20101<\/a>).<\/p>\n\n\n\n<p>Now, we create another ossec rule with a higher severity that will only be fired if the above rule (100015) is generated at least 4 times from the same source ip within 3 minutes (180 seconds):<\/p>\n\n\n\n<p><em>&lt;rule id=\u201d100016\u2033 frequency=\u201d4\u2033 level=\u201d10\u2033 timeframe=\u201d180\u2033&gt;<br>&lt;if_matched_sid&gt;100015&lt;\/if_matched_sid&gt;<br>&lt;same_source_ip \/&gt;<br>&lt;description&gt;Multiple snort alerts with the watched ids&lt;\/description&gt;<br>&lt;\/rule&gt;<\/em><\/p>\n\n\n\n<p>This idea can be extended to any other log format that you want to monitor. The following entry in the ossec wiki has some information too:&nbsp;<a href=\"http:\/\/www.ossec.net\/wiki\/index.php\/Know_How:Ignore_Rules\">Ignoring rules<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was asked recently what is the best way to correlate multiple&nbsp;snort&nbsp;events with&nbsp;OSSEC. The idea would be to generate an ossec alert (by e-mail and possible an active response) if a specific number of snort rules are fired from the same source IP address (in any order).. The easiest way to solve this is by [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[],"_links":{"self":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts\/347"}],"collection":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/comments?post=347"}],"version-history":[{"count":1,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts\/347\/revisions"}],"predecessor-version":[{"id":348,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts\/347\/revisions\/348"}],"wp:attachment":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/media?parent=347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/categories?post=347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/tags?post=347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}