{"id":116,"date":"2009-04-14T21:41:00","date_gmt":"2009-04-14T21:41:00","guid":{"rendered":"https:\/\/defragged.org\/ossec\/?p=116"},"modified":"2020-07-02T21:42:29","modified_gmt":"2020-07-02T21:42:29","slug":"ossec-to-twitter","status":"publish","type":"post","link":"https:\/\/defragged.org\/ossec\/2009\/04\/ossec-to-twitter\/","title":{"rendered":"OSSEC to Twitter"},"content":{"rendered":"\n<p>Want to see your OSSEC alerts on&nbsp;<a href=\"http:\/\/twitter.com\/\">twitter<\/a>? We just added support for that on the latest&nbsp;<a href=\"http:\/\/www.ossec.net\/files\/snapshots\/ossec-hids-090414.tar.gz\">snapshot<\/a>.<\/p>\n\n\n\n<p>To make it work, first update to the latest snapshot and add the following to your ossec.conf:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>&lt;command&gt;<br>&lt;name&gt;ossec-tweeter&lt;\/name&gt;<br>&lt;expect&gt;&lt;\/expect&gt;<br>&lt;executable&gt;ossec-tweeter.sh&lt;\/executable&gt;<br>&lt;\/command&gt;<\/p><p>&lt;active-response&gt;<br>&lt;command&gt;ossec-tweeter&lt;\/command&gt;<br>&lt;location&gt;server&lt;\/location&gt;<br>&lt;level&gt;6&lt;\/level&gt;<br>&lt;\/active-response&gt;<\/p><\/blockquote>\n\n\n\n<p>Where the first entry&nbsp;<em>\u201ccommand\u201d<\/em>&nbsp;is defining the active response script and the second one&nbsp;<em>\u201cactive-response\u201d<\/em>&nbsp;is configuring when to execute it. In my example above, I chose to execute it for every alert &gt;= level 6. Note, that you can\u2019t run it on the individual agents, just on the management server.<\/p>\n\n\n\n<p>After that, you need to configure the twitter script with the appropriate credentials. So, open the file&nbsp;<strong>\/var\/ossec\/active-response\/bin\/ossec-tweeter.sh<\/strong>&nbsp;and modify the first 2 entries:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>TWITTERUSER=\u201dyouruser\u201d<br>TWITTERPASS=\u2019yourpass\u2019<\/p><\/blockquote>\n\n\n\n<p>If you want to send direct messages to yourself (or any other account), also set the direct msg user variable:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>DIRECTMSGUSER=\u201d&#8221;<\/p><\/blockquote>\n\n\n\n<p>After that, just restart OSSEC and wait for the updates. If you want some examples, check the&nbsp;<a href=\"http:\/\/twitter.com\/ossec\">ossec twitter page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to see your OSSEC alerts on&nbsp;twitter? We just added support for that on the latest&nbsp;snapshot. To make it work, first update to the latest snapshot and add the following to your ossec.conf: &lt;command&gt;&lt;name&gt;ossec-tweeter&lt;\/name&gt;&lt;expect&gt;&lt;\/expect&gt;&lt;executable&gt;ossec-tweeter.sh&lt;\/executable&gt;&lt;\/command&gt; &lt;active-response&gt;&lt;command&gt;ossec-tweeter&lt;\/command&gt;&lt;location&gt;server&lt;\/location&gt;&lt;level&gt;6&lt;\/level&gt;&lt;\/active-response&gt; Where the first entry&nbsp;\u201ccommand\u201d&nbsp;is defining the active response script and the second one&nbsp;\u201cactive-response\u201d&nbsp;is configuring when to execute it. In my [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,5],"tags":[],"_links":{"self":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts\/116"}],"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=116"}],"version-history":[{"count":1,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts\/116\/revisions"}],"predecessor-version":[{"id":117,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts\/116\/revisions\/117"}],"wp:attachment":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/media?parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/categories?post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/tags?post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}