From 7ae0ef24082a118b7addcfb9907281b24ff1081c Mon Sep 17 00:00:00 2001 From: Aaron Brice Date: Fri, 24 Apr 2015 17:19:31 -0700 Subject: [PATCH] Fix actions in ufw.conf On Ubuntu 15.04 the ufw action was not working. - With empty , receiving errors: 2015-04-24 16:28:35,204 fail2ban.filter [8527]: INFO [sshd] Found 43.255.190.157 2015-04-24 16:28:35,695 fail2ban.actions [8527]: NOTICE [sshd] Ban 43.255.190.157 2015-04-24 16:28:35,802 fail2ban.action [8527]: ERROR [ -n "" ] && app="app " -- stdout: b'' 2015-04-24 16:28:35,803 fail2ban.action [8527]: ERROR [ -n "" ] && app="app " -- stderr: b'' 2015-04-24 16:28:35,803 fail2ban.action [8527]: ERROR [ -n "" ] && app="app " -- returned 1 - With action = ufw[application=OpenSSH], it was silently not doing anything (no errors after "Ban x.x.x.x", but no IP addresses in ufw status). Re-arranged the bash commands on two lines, and it works with or without . --- ChangeLog | 1 + THANKS | 1 + config/action.d/ufw.conf | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02eac37a..dcc516f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ ver. 0.9.2 (2014/XX/XXX) - wanna-be-released ----------- - Fixes: + * Fix ufw action commands * infinite busy loop on _escapedTags match in substituteRecursiveTags gh-907. Thanks TonyThompson * port[s] typo in jail.conf/nginx-http-auth gh-913. Thanks Frederik Wagner (fnerdwq) diff --git a/THANKS b/THANKS index 5482b21d..5ae86a3c 100644 --- a/THANKS +++ b/THANKS @@ -6,6 +6,7 @@ the project. If you have been left off, please let us know (preferably send a pull request on github with the "fix") and you will be added +Aaron Brice Adam Tkac Adrien Clerc ache diff --git a/config/action.d/ufw.conf b/config/action.d/ufw.conf index 04b8b32c..d2f731f2 100644 --- a/config/action.d/ufw.conf +++ b/config/action.d/ufw.conf @@ -13,9 +13,11 @@ actionstop = actioncheck = -actionban = [ -n "" ] && app="app " ; ufw insert from to $app +actionban = [ -n "" ] && app="app " + ufw insert from to $app -actionunban = [ -n "" ] && app="app " ; ufw delete from to $app +actionunban = [ -n "" ] && app="app " + ufw delete from to $app [Init] # Option: insertpos