Zentralisierte Konfigurationsverteilung von Wazuh Agents

Warum eine zentralisierte Konfiguration?

In einer Umgebung mit vielen Endpunkten kann die manuelle Konfiguration jedes Wazuh Agents aufwendig und fehleranfällig sein. Durch eine zentrale Verwaltung der Konfiguration ergeben sich folgende Vorteile:

  • Konsistenz: Alle Agents erhalten dieselben Regeln, Einstellungen und Policies.
  • Automatisierung: Änderungen müssen nur an einer zentralen Stelle vorgenommen werden.
  • Reduzierter Administrationsaufwand: Administratoren müssen nicht jeden Agent einzeln konfigurieren.
  • Erhöhte Sicherheit: Einheitliche Sicherheitsrichtlinien können effektiv durchgesetzt werden.

Funktionsweise der zentralisierten Konfiguration

Die zentralisierte Konfigurationsverteilung wird über den Wazuh Manager realisiert. Dieser speichert die Konfigurationsdateien und verteilt sie an die registrierten Agents.

Konfiguration des Wazuh-Dashboards

Zu Den Gruppen gelangt man über das Endpoint-Management:

Hier die Agents den Gruppen zuweisen und über Files kann die agents.conf angepasst werden:

Die zentrale Konfiguration wird über Gruppen im Wazuh-Dashboard definiert. Ein typisches Beispiel sieht so aus:

<agent_config>
    <!-- Shared agent configuration here -->
    <localfile>
        <location>Application</location>
        <log_format>eventchannel</log_format>
        <query>Event/System[EventID != 1006 and EventID != 12016 and EventID != 12017 and EventID != 12018]</query>
    </localfile>
</agent_config>

Diese Einstellungen definieren beispielsweise eine Protokollüberwachung für spezifische Event-IDs im Event-Channel. Der Vorteil ist, dass diese Logs erst gar nicht am Manager ankommen und sowohl Traffic als auch CPU eingespart wird.

Hier können aber auch noch mehrere Logquellen angezapft werden, nicht nur exkludiert:

<agent_config>
    <!-- Shared agent configuration here -->
    <localfile>
      <location>Application</location>
      <log_format>eventchannel</log_format>
      <query>Event/System[EventID != 1006 and EventID != 12016 and EventID != 12017 and EventID != 12018]</query>
    </localfile>
    <localfile>
      <location>Microsoft-Windows-Windows Firewall With Advanced Security/Firewall</location>
      <log_format>eventchannel</log_format>
    </localfile>
    <localfile>
      <location>Microsoft-Windows-Sysmon/Operational</location>
      <log_format>eventchannel</log_format>
    </localfile>
    <localfile>
      <location>Microsoft-Windows-Windows Defender/Operational</location>
      <log_format>eventchannel</log_format>
    </localfile>
    <localfile>
      <location>Microsoft-Windows-WMI-Activity/Operational</location>
      <log_format>eventchannel</log_format>
    </localfile>
    <localfile>
      <location>Microsoft-Windows-TerminalServices-LocalSessionManager/Operational</location>
      <log_format>eventchannel</log_format>
    </localfile>
    <localfile>
      <location>Microsoft-Windows-SMBServer/Operational</location>
      <log_format>eventchannel</log_format>
    </localfile>
    <localfile>
      <location>Microsoft-Windows-SMBServer/Connectivity</location>
      <log_format>eventchannel</log_format>
    </localfile>
    <localfile>
      <location>Microsoft-Windows-SMBClient/Operational</location>
      <log_format>eventchannel</log_format>
    </localfile>
    <localfile>
      <location>Microsoft-Windows-SmbClient/Connectivity</location>
      <log_format>eventchannel</log_format>
    </localfile>
    <localfile>
      <location>Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational</location>
      <log_format>eventchannel</log_format>
    </localfile>
    <localfile>
      <location>Microsoft-Windows-TaskScheduler/Operational</location>
      <log_format>eventchannel</log_format>
    </localfile>
    <localfile>
      <location>Microsoft-Windows-TerminalServices-RDPClient/Operational</location>
      <log_format>eventchannel</log_format>
    </localfile>
</agent_config>

Das Speichern im Wazuh-Dasboard veranlasst den sofortigen Rollout und Reload der betroffenen Agenten.