From 39711cf6c2ec5a3b4480dcb4800cc3802bda5bf2 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Fri, 20 Mar 2026 19:16:32 +0100 Subject: feat: first fully successful run e2e on straper --- .../public/fail2ban/etc-fail2ban/action.d/ufw.conf | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 straper/db/public/fail2ban/etc-fail2ban/action.d/ufw.conf (limited to 'straper/db/public/fail2ban/etc-fail2ban/action.d/ufw.conf') diff --git a/straper/db/public/fail2ban/etc-fail2ban/action.d/ufw.conf b/straper/db/public/fail2ban/etc-fail2ban/action.d/ufw.conf new file mode 100644 index 0000000..c9ff7f3 --- /dev/null +++ b/straper/db/public/fail2ban/etc-fail2ban/action.d/ufw.conf @@ -0,0 +1,75 @@ +# Fail2Ban action configuration file for ufw +# +# You are required to run "ufw enable" before this will have any effect. +# +# The insert position should be appropriate to block the required traffic. +# A number after an allow rule to the application won't be of much use. + +[Definition] + +actionstart = + +actionstop = + +actioncheck = + +# ufw does "quickly process packets for which we already have a connection" in before.rules, +# therefore all related sockets should be closed +# actionban is using `ss` to do so, this only handles IPv4 and IPv6. + +actionban = if [ -n "" ] && ufw app info "" + then + ufw from to app "" comment "" + else + ufw from to comment "" + fi + + +actionunban = if [ -n "" ] && ufw app info "" + then + ufw delete from to app "" + else + ufw delete from to + fi + +# Option: kill-mode +# Notes.: can be set to ss or conntrack (may be extended later with other modes) to immediately drop all connections from banned IP, default empty (no kill) +# Example: banaction = ufw[kill-mode=ss] +kill-mode = + +# intern conditional parameter used to provide killing mode after ban: +_kill_ = +_kill_ss = ss -K dst "[]" +_kill_conntrack = conntrack -D -s "" + +# Option: kill +# Notes.: can be used to specify custom killing feature, by default depending on option kill-mode +# Examples: banaction = ufw[kill='ss -K "( sport = :http || sport = :https )" dst "[]"'] +# banaction = ufw[kill='cutter ""'] +kill = <_kill_> + +[Init] +# Option: add +# Notes.: can be set to "insert 1" to insert a rule at certain position (here 1): +add = prepend + +# Option: blocktype +# Notes.: reject or deny +blocktype = reject + +# Option: destination +# Notes.: The destination address to block in the ufw rule +destination = any + +# Option: application +# Notes.: application from sudo ufw app list +application = + +# Option: comment +# Notes.: comment for rule added by fail2ban +comment = by Fail2Ban after attempts against + +# DEV NOTES: +# +# Author: Guilhem Lettron +# Enhancements: Daniel Black -- cgit v1.3