Hi Lucas,
Thank you for your message — I’m really glad to hear it worked as expected!
Just a quick note: while I understand Portuguese, all communication in the Wazuh Community must be in English, as per our contribution guidelines. This helps ensure everyone on the team and community can follow along and assist when needed.
Thanks for your understanding
.Now. to confirm your questions:
1. You're asking if Wazuh can
automatically unblock the same IP addresses it blocks (e.g., after 1 hour).
2. You're also asking if it's possible to
generate a graph that shows which IPs are being blocked and another for unblocked IPs.
Let me address both points below.
1. Yes
, Wazuh can automatically unblock IPs after a set amount of time using the `
timeout` option in the
<active-response> configuration.
Here’s how to configure it in your `ossec.conf` (on the Manager):
<active-response>
<command>firewall-drop</command>
--- previous code ---
<timeout>3600</timeout> <!-- 3600 seconds = 1 hour -->
</active-response>
Wazuh will internally track the IPs it has blocked and automatically run the firewalldrop undo script to remove the corresponding iptables rule after 1 hour (30 seconds in my test).
ADD iptables block rule log:
"full_log": "2025/05/21 14:54:10 active-response/bin/firewall-drop: {\"version\":1,\"origin\":{\"name\":\"node01\",\"module\":\"wazuh-execd\"},\"command\":\"add\",\"parameters\":{\"extra_args\":[],\"alert\":{\"timestamp\":\"2025-05-21T20:54:10.922+0000\",\"rule\":{\"level\":10,\"description\":\"sshd: more than 5 authentication failures.\",\"id\":\"100101\",\"frequency\":8,\"firedtimes\":1,\"mail\":false,\"groups\":[\"local\",\"syslog\",\"sshd\",\"authentication_failed\",\"sshd\"]},\"agent\":{\"id\":\"001\",\"name\":\"WS-UY-PC001\",\"ip\":\"172.18.0.1\"},\"manager\":{\"name\":\"wazuh.manager\"},\"id\":\"1747860850.917610\",\"previous_output\":\"May 21 20:54:06 WS-UY-PC001 sshd[364447]: Failed password for esilva from 192.168.122.209 port 59614 ssh2\\nMay 21 20:53:58 WS-UY-PC001 sshd[364194]: Failed password for esilva from 192.168.122.209 port 57018 ssh2\\nMay 21 20:53:53 WS-UY-PC001 sshd[364194]: Failed password for esilva from 192.168.122.209 port 57018 ssh2\\nMay 21 20:53:51 WS-UY-PC001 sshd[364194]: Failed password for esilva from 192.168.122.209 port 57018 ssh2\\nMay 21 20:53:44 WS-UY-PC001 sshd[363823]: Failed password for esilva from 192.168.122.209 port 46380 ssh2\\nMay 21 20:53:39 WS-UY-PC001 sshd[363823]: Failed password for esilva from 192.168.122.209 port 46380 ssh2\\nMay 21 20:53:38 WS-UY-PC001 sshd[363823]: Failed password for esilva from 192.168.122.209 port 46380 ssh2\",\"full_log\":\"May 21 20:54:10 WS-UY-PC001 sshd[364447]: Failed password for esilva from 192.168.122.209 port 59614 ssh2\",\"predecoder\":{\"program_name\":\"sshd\",\"timestamp\":\"May 21 20:54:10\",\"hostname\":\"WS-UY-PC001\"},\"decoder\":{\"parent\":\"sshd\",\"name\":\"sshd\"},\"data\":{\"srcip\":\"192.168.122.209\",\"srcport\":\"59614\",\"dstuser\":\"esilva\"},\"location\":\"journald\"},\"program\":\"active-response/bin/firewall-drop\"}}",
DELETE iptables block rule log:
"full_log": "2025/05/21 14:54:41 active-response/bin/firewall-drop: {\"version\":1,\"origin\":{\"name\":\"node01\",\"module\":\"wazuh-execd\"},\"command\":\"delete\",\"parameters\":{\"extra_args\":[],\"alert\":{\"timestamp\":\"2025-05-21T20:54:10.922+0000\",\"rule\":{\"level\":10,\"description\":\"sshd: more than 5 authentication failures.\",\"id\":\"100101\",\"frequency\":8,\"firedtimes\":1,\"mail\":false,\"groups\":[\"local\",\"syslog\",\"sshd\",\"authentication_failed\",\"sshd\"]},\"agent\":{\"id\":\"001\",\"name\":\"WS-UY-PC001\",\"ip\":\"172.18.0.1\"},\"manager\":{\"name\":\"wazuh.manager\"},\"id\":\"1747860850.917610\",\"previous_output\":\"May 21 20:54:06 WS-UY-PC001 sshd[364447]: Failed password for esilva from 192.168.122.209 port 59614 ssh2\\nMay 21 20:53:58 WS-UY-PC001 sshd[364194]: Failed password for esilva from 192.168.122.209 port 57018 ssh2\\nMay 21 20:53:53 WS-UY-PC001 sshd[364194]: Failed password for esilva from 192.168.122.209 port 57018 ssh2\\nMay 21 20:53:51 WS-UY-PC001 sshd[364194]: Failed password for esilva from 192.168.122.209 port 57018 ssh2\\nMay 21 20:53:44 WS-UY-PC001 sshd[363823]: Failed password for esilva from 192.168.122.209 port 46380 ssh2\\nMay 21 20:53:39 WS-UY-PC001 sshd[363823]: Failed password for esilva from 192.168.122.209 port 46380 ssh2\\nMay 21 20:53:38 WS-UY-PC001 sshd[363823]: Failed password for esilva from 192.168.122.209 port 46380 ssh2\",\"full_log\":\"May 21 20:54:10 WS-UY-PC001 sshd[364447]: Failed password for esilva from 192.168.122.209 port 59614 ssh2\",\"predecoder\":{\"program_name\":\"sshd\",\"timestamp\":\"May 21 20:54:10\",\"hostname\":\"WS-UY-PC001\"},\"decoder\":{\"parent\":\"sshd\",\"name\":\"sshd\"},\"data\":{\"srcip\":\"192.168.122.209\",\"srcport\":\"59614\",\"dstuser\":\"esilva\"},\"location\":\"journald\"},\"program\":\"active-response/bin/firewall-drop\"}}",
2. About building dashboards for blocked and unblocked IPs,
I’m afraid that falls outside my current scope and the original topic of this thread.
To make sure your request gets the right attention, I kindly invite you to open a new thread specifically for that topic. The team will be happy to assist you as soon as possible.
Thanks again for your kind message and engagement