Skip to content

Commit db1c78a

Browse files
committed
feat: ossec.conf + AR script opnsense-fw + 5 secciones web El Heraldo
1 parent a6cf8b3 commit db1c78a

7 files changed

Lines changed: 894 additions & 0 deletions

File tree

config/active-response/opnsense-fw

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
# opnsense-fw — Wazuh Active Response script
3+
# Ubicación en VM101 (OPNsense): /var/ossec/active-response/bin/opnsense-fw
4+
#
5+
# Este script es ejecutado por el Agente Wazuh 009 en VM101 cuando
6+
# Wazuh Manager dispara una acción de Active Response por las reglas
7+
# 100011 (Cowrie SSH success, lvl 14) o 100040 (CRITICAL, lvl 15).
8+
#
9+
# Flujo:
10+
# Wazuh Manager (VM102) → AR command → Agente 009 (VM101) → este script → pfctl
11+
#
12+
# Acción: añade la IP atacante a la tabla PF __wazuh_agent_drop
13+
# Latencia medida en laboratorio: < 5 segundos desde alerta hasta bloqueo
14+
15+
ACTION=$1 # add / delete
16+
USER=$2 # usuario (no usado)
17+
IP=$3 # IP a bloquear
18+
19+
if [ "$ACTION" = "add" ]; then
20+
pfctl -t __wazuh_agent_drop -T add "$IP"
21+
logger -t wazuh-ar "BLOCKED: $IP added to __wazuh_agent_drop"
22+
elif [ "$ACTION" = "delete" ]; then
23+
pfctl -t __wazuh_agent_drop -T delete "$IP"
24+
logger -t wazuh-ar "UNBLOCKED: $IP removed from __wazuh_agent_drop"
25+
fi

0 commit comments

Comments
 (0)