Skip to content

Instantly share code, notes, and snippets.

@BirkhoffLee
Created May 7, 2020 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BirkhoffLee/9e424e0b1e7352584bf615dc23285707 to your computer and use it in GitHub Desktop.
Save BirkhoffLee/9e424e0b1e7352584bf615dc23285707 to your computer and use it in GitHub Desktop.
/etc/fail2ban/action.d/custom-firewalld.conf
[INCLUDES]
before =
[Definition]
actionstart =
actionstop =
actioncheck =
actionflush = sed -i '/<source address=/d' /etc/firewalld/zones/drop.xml
actionban = firewall-cmd --change-source=<ip> --zone=drop && firewall-cmd --change-source=<ip> --zone=drop --permanent
actionunban = firewall-cmd --remove-source=<ip> --zone=drop && firewall-cmd --remove-source=<ip> --zone=drop --permanent || echo 0
[Init]
@BirkhoffLee
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment