Wazuh
Connect NetLock RMM to Wazuh: disconnected agents, high level alerts and, if you want, critical vulnerabilities become alerts of the matching device or tenant.
Wazuh
NetLock reads Wazuh and writes nothing there. By default it reads only agents that stay disconnected and alerts from level 12 on, because Wazuh and the NetLock agent can see the same event.
Reachability
NetLock calls Wazuh, so the server has to reach it.
- Self-hosted NetLock in the same network: works. Private addresses are allowed.
- NetLock Cloud: an instance in the cloud reaches public addresses only. A Wazuh in a private network cannot be connected from there. Publishing the API of Wazuh on the internet just for this is not recommended.
Requirements
- Wazuh 4. The connector reads the version from the server API and refuses any other major version, because the API changes with it. The test of the connection reports this.
- A user of the server API, port 55000. A dedicated user with the role
readonlyis enough. - For alerts and vulnerabilities, the indexer, port 9200, with a user who may read
wazuh-alerts-*andwazuh-states-vulnerabilities-*. Alerts are stored only in the indexer. Without it NetLock reads only the agent status, and the history shows a note. - Certificates NetLock can verify, on both ports.
Certificates
NetLock accepts valid certificates only and has no switch to turn that off. The certificates of a default Wazuh installation are self-signed and are refused; the test of the connection then fails with a network error.
- Issue certificates for the names you enter in NetLock, from a public CA or your own CA.
- Server API: set
keyandcertin thehttpssection of/var/ossec/api/configuration/api.yaml, then restartwazuh-manager. - Indexer: replace the certificates as the documentation of Wazuh describes for your installation.
- With your own CA, add it to the trust store of the hosts or containers that run the NetLock web console and server. Both call Wazuh: the console for the test, the server for the pulls.
Setup
- In
Settings → Integrations, open the Wazuh tile and chooseConnect. - Enter the address of the server API with its port, such as
https://wazuh.example.com:55000, its user and password. - Enter the address of the indexer with its port, its user and password. Leave them empty to read only the agent status.
- The test of the connection shows the version and the number of agents, and checks that the indexer can be searched.
- Under options, choose what to read.
- Map each tenant to an agent group, or import the groups. Wazuh has no tenants, so a group represents a customer. Groups without a mapping are not included.
- Activate the connection.
The token of the connection needs the scopes devices:read, alerts:ingest and external-refs:read.
An agent has to be in exactly one mapped group. An agent in two mapped groups could belong to either tenant: it reports nothing new, its open alerts stay open, and the Log tab shows a note. Every agent starts in the group default, so that group should usually stay unmapped.
What arrives in NetLock
Every five minutes NetLock queries Wazuh and reports through POST /v1/alerts/ingest with the token of the connection. Synchronize now starts a pull immediately.
The first pull only records the current state: existing problems open no alert and no ticket until they change. The Overview tab shows how many there are. A hit in a later hour than the newest one recorded counts as a change.
| Part | Source | Default | Becomes |
|---|---|---|---|
| Disconnected agents | Server API | On | One alert per agent, moderate, after the agent is away for Disconnected for at least minutes (default 60). It ends when the agent is back |
| Alerts | Indexer | On, from level 12 | One alert per agent and rule. It ends 24 hours after its last hit |
| Critical vulnerabilities | Indexer | Off | One alert per agent with their number, high. It ends when the agent has none left |
Levels become severities: 7 to 11 moderate, 12 to 14 high, 15 critical. Alerts from level accepts values from 7 to 15. SCA and file integrity results are not read.
Alerts are events, so NetLock reads the last 24 hours on every pull, as one total per agent and rule. There is no limit on the number of hits. An open alert is written again at most once an hour, however often its rule fires.
After a pause NetLock reads back to its last good pull, at most seven days, and continues to read that far back for a day. A hit from the pause therefore opens an alert that stays open for 24 hours, like any other. Switching Report alerts off discards the last pull: when you switch it back on, NetLock reads the usual 24 hours.
When a mapping changes, open alerts end at the old tenant and open at the new one; if the mapping is removed, they end. Switching off a part ends the alerts it left open.
How an agent finds its device
NetLock tries these in order, always within the tenant of the group:
- An external reference of the device for the system
wazuh, set through the public API with the agent id. - The match of an earlier pull.
- The name of the agent, if exactly one device of the tenant has it. Case and domain are ignored.
Two tenants can hold a device of the same name: an agent only ever matches within the tenant of its group. A reference contains only the agent id, so with two managers in one tenant it applies to the agent with that id on both. Without a match the report goes to the tenant. If Report unmatched devices for the tenant is off, it is skipped and counted. The External systems tab of the device shows its agent and open reports.
Known limits
- If the indexer does not answer, or a part of it fails, disconnected agents still arrive. No alert is treated as ended; the pull reports the failure and the next one tries again. The
Logtab shows the failure. IfReport disconnected agentsis off, the whole pull fails. @timestampis the time of the alert, not of its arrival in the indexer. Alerts that reach the indexer more than 24 hours late, for example after a long stop of Filebeat, fall outside the window and are not read.- The index of vulnerabilities appears with the first scan of Wazuh 4.8 or later. Without it the option reads nothing and ends no alerts, and the test and the
Logtab show a note. - If no pull succeeds for a day, the connection stays active and shows a note.
- If the vulnerability list cannot be read in full, no vulnerability alert is ended.
- A condition that stays the same is reported again once a day, so its alert does not run into the time limit for open alerts.
- The manager allows 300 requests a minute by default. NetLock waits when Wazuh reports the limit. A login that is refused is not repeated for five minutes, because Wazuh blocks a client after too many of them.