{"id":312,"date":"2012-09-18T15:40:02","date_gmt":"2012-09-18T13:40:02","guid":{"rendered":"http:\/\/www.btrnaidu.com\/?p=312"},"modified":"2012-09-24T12:27:45","modified_gmt":"2012-09-24T10:27:45","slug":"multiline-pattern-match-with-fail2ban","status":"publish","type":"post","link":"https:\/\/btrnaidu.com\/index.php\/multiline-pattern-match-with-fail2ban\/","title":{"rendered":"Multi line pattern match with fail2ban"},"content":{"rendered":"<p>I run my own asterisk server where it is well protected against external attacks using iptables + fail2ban. \u00a0I thought it was secure enough until I came across attacks which my current fail2ban configuration failed to detect. \u00a0In investigation tells me that fail2ban cannot do multi line pattern match and because the attacker&#8217;s IP was not logged in the same line where the attack statement was mentioned, fail2ban did not work.<\/p>\n<p>The only solution I could find \/ think of is to write my own script which will write these multiple lines into one single line. \u00a0Assuming you will hit this\u00a0bottleneck\u00a0of fail2ban sooner or later, I have uploaded the script which I wrote to <a title=\"JailMe\" href=\"https:\/\/github.com\/naidu\/JailMe\">github<\/a> and available for free download.<\/p>\n<p>Feel free to use the script. \u00a0I welcome your comments \/\u00a0suggestions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I run my own asterisk server where it is well protected against external attacks using iptables + fail2ban. \u00a0I thought it was secure enough until I came across attacks which my current fail2ban configuration failed to detect. \u00a0In investigation tells me that fail2ban cannot do multi line pattern match and because the attacker&#8217;s IP was &hellip; <a href=\"https:\/\/btrnaidu.com\/index.php\/multiline-pattern-match-with-fail2ban\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Multi line pattern match with fail2ban<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117],"tags":[],"class_list":["post-312","post","type-post","status-publish","format-standard","hentry","category-fail2ban"],"_links":{"self":[{"href":"https:\/\/btrnaidu.com\/index.php\/wp-json\/wp\/v2\/posts\/312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/btrnaidu.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/btrnaidu.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/btrnaidu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/btrnaidu.com\/index.php\/wp-json\/wp\/v2\/comments?post=312"}],"version-history":[{"count":3,"href":"https:\/\/btrnaidu.com\/index.php\/wp-json\/wp\/v2\/posts\/312\/revisions"}],"predecessor-version":[{"id":317,"href":"https:\/\/btrnaidu.com\/index.php\/wp-json\/wp\/v2\/posts\/312\/revisions\/317"}],"wp:attachment":[{"href":"https:\/\/btrnaidu.com\/index.php\/wp-json\/wp\/v2\/media?parent=312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/btrnaidu.com\/index.php\/wp-json\/wp\/v2\/categories?post=312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/btrnaidu.com\/index.php\/wp-json\/wp\/v2\/tags?post=312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}