Hello Cesar,
thank you very much for your avaiilability and patience.
I will try to describe shortly my environment and explain my problem.
Basically, our environment is composed by:
- 5 FTP servers
- 2 HTTP servers
On each server, I installed the latest version of Wazuh Agent. All the 7 servers are managed by out IT team and monitored by Wazub Manager v.4.1.4
Only the physical edge firewall is not managed by our IT team (so, we can’t change the existing firewall policies).
I created two host groups named “ftp” and “web”:
- 5 FTP servers belong to “ftp” and “default” Wazuh groups
- 2 HTTP servers belong to “web” and “default” Wazuh groups
At this moment, I’m using this policy and it is working as expected:
<active-response>
<disabled>no</disabled>
<command>firewall-drop</command>
<location>all</location>
<rules_id>100100</rules_id>
<timeout>600</timeout>
</active-response>
<active-response>
<disabled>no</disabled>
<command>firewall-drop</command>
<location>all</location>
<rules_group>attack|web|accesslog|syslog|elevation_of_privilege|exploit_attempt|sshd|errors|vuls|vulnerability-detector|invalid_access|attacks|agent_flooding|syscheck|service_availability|linuxkernel|named|modsecurity|access_denied|apache|virustotal|sysmon_process-anomalies|ids|fortigate|recon|sudo|telnetd|dovecot|vsftpd|web_sna|sql_injection|invalid_request|nginx|dropbear|audit_daemon|sqlserver|wazuh|rootcheck|login_time|policy_violation|login_day|sca|oscap|oscap-report|oscap-result|ciscat|adduser|appsec|low_diskspace|ossec|syscheck|syscheck_entry_modified|syscheck_file|agentless|wordpress|checkpoint_smart1|gsad|openvasmd|firewall|firewall_drop|invalid_login|access_denied|ftpd|nginx|local|systemd|time_changed|audit_anom|openvpn|firewall_block|mysql_audit|mariadb|incident_response|it_compliance|hardware_monitoring|osquery|freeipa|docker|docker-error|active_response|ossec|connection_attempt|authentication_success|pam|yum|upgrade|nfs|su|postfix|dhcp|groupdel|authentication_failed|authentication_failures</rules_group>
<level>8</level>
<timeout>600</timeout>
</active-response>
<active-response>
<repeated_offenders>15,30,60,120,180</repeated_offenders>
</active-response>
My target:
Now, I would like to split this active response policy in two blocks: 1 block (with level 8) for all FTP servers and 1 block (with level 12) for HTTP servers.
My ideal workflow should be the following one:
- if a “bad” IP is detected by one of FTP servers, all the FTP servers block the same IP;
- if a “bad” IP is detected by one of HTTP servers, all the HTTP servers block the same IP;
I know that I can split the active response block mentioned above in multiple blocks (one block for each agent), but, in this way, I will lose the very interesting "<location>all</location> feature”.
It would be nice, if I have the possiblity to change the current location (all) with the host group name.
For example:
<active-response>
<disabled>no</disabled>
<command>firewall-drop</command>
<location>ftp</location>
<rules_id>100100</rules_id>
<timeout>600</timeout>
</active-response>
<active-response>
<disabled>no</disabled>
<command>firewall-drop</command>
<location>ftp</location>
<rules_group>attack|web|accesslog|syslog|elevation_of_privilege|exploit_attempt|sshd|errors|vuls|vulnerability-detector|invalid_access|attacks|agent_flooding|syscheck|service_availability|linuxkernel|named|modsecurity|access_denied|apache|virustotal|sysmon_process-anomalies|ids|fortigate|recon|sudo|telnetd|dovecot|vsftpd|web_sna|sql_injection|invalid_request|nginx|dropbear|audit_daemon|sqlserver|wazuh|rootcheck|login_time|policy_violation|login_day|sca|oscap|oscap-report|oscap-result|ciscat|adduser|appsec|low_diskspace|ossec|syscheck|syscheck_entry_modified|syscheck_file|agentless|wordpress|checkpoint_smart1|gsad|openvasmd|firewall|firewall_drop|invalid_login|access_denied|ftpd|nginx|local|systemd|time_changed|audit_anom|openvpn|firewall_block|mysql_audit|mariadb|incident_response|it_compliance|hardware_monitoring|osquery|freeipa|docker|docker-error|active_response|ossec|connection_attempt|authentication_success|pam|yum|upgrade|nfs|su|postfix|dhcp|groupdel|authentication_failed|authentication_failures</rules_group>
<level>8</level>
<timeout>600</timeout>
</active-response>
<active-response>
<disabled>no</disabled>
<command>firewall-drop</command>
<location>web</location>
<rules_id>100100</rules_id>
<timeout>600</timeout>
</active-response>
<active-response>
<disabled>no</disabled>
<command>firewall-drop</command>
<location>web</location>
<rules_group>attack|web|accesslog|syslog|elevation_of_privilege|exploit_attempt|sshd|errors|vuls|vulnerability-detector|invalid_access|attacks|agent_flooding|syscheck|service_availability|linuxkernel|named|modsecurity|access_denied|apache|virustotal|sysmon_process-anomalies|ids|fortigate|recon|sudo|telnetd|dovecot|vsftpd|web_sna|sql_injection|invalid_request|nginx|dropbear|audit_daemon|sqlserver|wazuh|rootcheck|login_time|policy_violation|login_day|sca|oscap|oscap-report|oscap-result|ciscat|adduser|appsec|low_diskspace|ossec|syscheck|syscheck_entry_modified|syscheck_file|agentless|wordpress|checkpoint_smart1|gsad|openvasmd|firewall|firewall_drop|invalid_login|access_denied|ftpd|nginx|local|systemd|time_changed|audit_anom|openvpn|firewall_block|mysql_audit|mariadb|incident_response|it_compliance|hardware_monitoring|osquery|freeipa|docker|docker-error|active_response|ossec|connection_attempt|authentication_success|pam|yum|upgrade|nfs|su|postfix|dhcp|groupdel|authentication_failed|authentication_failures</rules_group>
<level>12</level>
<timeout>600</timeout>
</active-response>
Unfortunately, I noticed that I Wazuh doesn’t support “group” location.
Is there an alternative way to do the work? Do you know if “group” location will be added in the next version of Wazuh?
Thank you in advance.
Mauro