PL EN
WB-6FFA1250TLP:CLEARWazuh 5

4.x agents under a Wazuh 5 manager: the legacy channel, enrollment tokens and upgrade order

What a 4.x agent can do under a Wazuh 5 manager, what a 5.x agent requires (1517, TLS 1.3, token) and in which order to upgrade the fleet in waves.

A Wazuh 5 manager accepts 4.x agents over the legacy channel, but a 4.x agent sends only logs and findings, so a mixed fleet is a transitional state with limited capabilities. How you plan the move depends on what works on which side and on what a 5.x agent requires.

Wazuh 5.0 is a release candidate: this post covers tag v5.0.0-rc2. Tag v5.0.0-rc3 came out on 4 December 2026 and is not covered here, and there is no stable version yet. The facts come from the 5.0-rc documentation and that tag, so they may change after GA. I checked the default configuration and API responses on a lab with the Docker image 5.0.0-rc2; I had no 4.x agent in that lab. The values in the examples are synthetic: host example.com, agent agent-01.

What a 4.x agent does under a 5 manager

4.x agents can enroll and connect to a 5.0 manager, but some agent-side components are not fully supported until the agent is upgraded.

Area4.x agent5.x agent
Event channelAES-encrypted TCP or UDP channel, port 1514HTTPS, port 1517
EnrollmentPort 1515 and a shared password from authd.passPOST /enroll on port 1517 and a token
Logs and findingsYesYes
FIM, SCA, system inventory, vulnerability detectionSends no dataSends data
Active ResponseNot availableAvailable
RootcheckDoes not work without manually copied filesThe migration documentation does not describe it
Remote upgradeThe manager sends the package over the legacy channelThe agent downloads the package after receiving a task in the response to POST /control
Communication metricsIndex wazuh-metrics-comms-v4 (legacy protocol, agents older than 5.0.0)The documentation does not describe a separate index

Rootcheck works on migrated 4.x agents only if you copy the .txt files from /var/ossec/etc/shared/default/ on the 4.x manager to /etc/wazuh-manager/shared/default/ on the 5.x manager (owner wazuh-manager). This concerns the files rootkit_files.txt and rootkit_trojans.txt, which are not in the 5.x default group; remove them once every agent runs 5.x. The manager does not track the result of a remote upgrade, so you check the status yourself.

The legacy channel on the manager side

The manager starts the channel on port 1514 only when the legacy block in remote is enabled; the installer enables it by default. Without that block only 5.x agents can connect. The default block looks like this:

<remote>
  <https>
    <port>1517</port>
    <bind_addr>0.0.0.0</bind_addr>
    <global_prefix>/wazuh-manager/</global_prefix>
  </https>
  <legacy>
    <enabled>yes</enabled>
    <port>1514</port>
    <protocol>tcp</protocol>
    <local_ip>0.0.0.0</local_ip>
    <queue_size>131072</queue_size>
  </legacy>
  <agents>
    <allow_higher_versions>no</allow_higher_versions>
  </agents>
</remote>

Options that affect a mixed fleet:

OptionMeaning
remote/legacy/enabledEnables the TCP/UDP listener and every subsystem that serves only 4.x agents; yes by default when the legacy block exists
auth/legacy_enrollmentEnrollment of 4.x agents on port 1515; when the option is absent, the value follows remote/legacy/enabled
auth/remote_enrollmentEnrollment through the HTTPS listener 1517 and port 1515; yes by default
auth/disabledThe value yes closes POST /enroll and port 1515, so no agent (neither 4.x nor 5.x) can enroll
remote/agents/allow_higher_versionsAgents newer than the manager may connect; needed only when agents are upgraded before the manager

With the 5.x manager deployed before the agents are upgraded, allow_higher_versions is not needed. In the v5.0.0-rc2 code the legacy channel (remoted/src/manager.c) and enrollment (os_auth/src/auth.c) reject an agent only when its version is higher than the manager’s, and a 4.x agent is always lower.

A new 4.x agent enrolls on port 1515 with the 5.x manager password from /etc/wazuh-manager/authd.pass (the variable WAZUH_REGISTRATION_PASSWORD at install time). Without the correct password the agent logs Invalid password. Unable to add an agent (from manager) and stays pending. The password on the 5.x manager must be at least 16 bytes. A 4.x agent cannot use a 5.x token: the 4.14.11 enrollment configuration (src/config/client-config.c) has no token option, so a 4.x agent enrolls only with the password on port 1515.

What a 5.x agent requires

Token creation and installation of the first agent are described in installing Wazuh 5, and the rewrite of enrollment and address is in migration from 4.x. The table contains only what differs between a 5.x and a 4.x agent in day-to-day fleet operation.

RequirementDetail
Port1517/TCP for enrollment and all communication; port 55000/TCP only for enrollment through the API or for agents with anti-tampering that remove themselves
TLSEnrollment always requires TLS 1.3, the auto_method option has been removed
TokenContains the manager address, the CA to trust and the credential; expires after 30 days by default, and the use limit is optional (none by default); created by the master node, and the address must be in the certificate SAN
AddressOne manager address: the last entry of the server list is used
Install variableWAZUH_MANAGER_ENDPOINT in the form host[:port][/prefix] replaces WAZUH_MANAGER and WAZUH_MANAGER_PORT when it is set
Enrollment optionsRemoved: manager_address, port, interface_index, ssl_cipher, server_certificate_path, agent_certificate_path, agent_key_path; an old ossec.conf containing them still parses after an in-place upgrade
Enrollment passwordThe package upgrade removes etc/authd.pass from the endpoint; WAZUH_REGISTRATION_PASSWORD is no longer used
Re-enrollmentThe agent keeps a secret in etc/reenroll.secret and keeps its identifier
TrustUpgraded agents trust only the CA from the manager’s /etc/wazuh-manager/ca/

An agent enrolled before the upgrade keeps working on its existing key, but it has to be given a token to receive the re-enrollment secret. Re-enrollment happens only when the manager reports that it does not know the agent. If the manager rejects the secret, the agent falls back to the configured credential, so a rebuilt manager does not require visiting every endpoint. The secret is 64 hexadecimal characters and lives in global.db, not in client.keys; a global.db created before the column was added is recreated, and its agents enroll again. If your fleet management tool rotates the authd.pass password, that file will no longer exist after the agent upgrade.

Agent upgrade conditions

Before you upgrade agents to 5.x remotely, the documentation requires five things:

  • The agent runs version 4.14.0 or newer. Upgrade older ones to the latest 4.14 first.
  • The agent reaches the 5.x manager on port 1517/TCP; otherwise it will not install the upgrade. Leave port 1514 open until every agent runs 5.x.
  • The certificate of every manager node contains the address the agents connect to.
  • verification_mode in remote/https of wazuh-manager.conf is none or not set; otherwise the manager rejects the upgrade.
  • Linux agents have the openssl command; otherwise the upgraded agent runs with TLS verification disabled.

The manager version must be equal to or newer than the agent versions, so you stand up the 5.x manager before upgrading agents. After the upgrade, check in Agents management > Summary that no agent has the status Outdated. Take a copy of /etc/wazuh-manager/ca/ before the first wave.

Upgrade order in waves

The vendor gives no ready procedure, so the order below is my proposal, built from the requirements described above.

  1. Before importing enrollments, upgrade agents older than 4.14.0 to the latest 4.14 under the still running 4.x manager.
  2. Deploy the 5.x manager (all nodes in a cluster), import the enrollments and leave legacy enabled. Open 1514, 1515 and 1517.
  3. Repoint the 4.x agent addresses to the 5.x manager. Until they are upgraded you get logs and findings, while FIM, SCA, inventory and vulnerability detection stay silent; copy the rootcheck files if you need them. If your 4.x agents list several addresses in server for failover, test the switchover on one agent: the 5.0 documentation does not describe it, and I had no 4.x agent in the lab.
  4. Pick a pilot: one agent per operating system from one group. Upgrade them and check that FIM, SCA, inventory, vulnerability detection and Active Response come back.
  5. Upgrade the rest in waves by group, checking the Outdated status after each. Check the fleet state with the API query below.
  6. Install an agent on every manager node. Enroll it with a token that carries that node’s address, after the enrollment import.
  7. When no 4.x agent remains, check the legacy channel metrics (query below), then disable legacy and close 1514 and 1515.

You can read agent versions from the API. The -k flag in curl turns off certificate verification and belongs only in a lab with self-signed certificates; in production point --cacert at the CA of the API certificate and drop -k.

# Obtain a token, then list agents with their installed version
TOKEN=$(curl -sk -u wazuh:EXAMPLE_PASSWORD -X POST "https://example.com:55000/security/user/authenticate?raw=true")
curl -sk "https://example.com:55000/agents?select=id,name,group,version" -H "Authorization: Bearer $TOKEN"

On the rc2 lab the version field has the form v5.0.0, with the letter v, and GET /agents/outdated returns an empty list when all agents have the manager version. The documentation does not describe this format, so check it on your side before filtering by version. Nor does it say how long the vendor will keep the legacy channel.

The wazuh-metrics-comms-v4 index stores legacy protocol metrics, but the mere existence of documents proves nothing. On a lab where all agents had version 5.0.0, a document was created roughly every 10 minutes, and the fields tcp.sessions, events.total and messages.total had the value 0 the whole time. So check the values, not the number of documents. The tcp.sessions field comes from a counter in remoted/src/state.c that goes up when a TCP session opens on the legacy channel and down when it closes, so it shows the sessions open at the moment of the write. A 4.x agent that connects over UDP holds no TCP session, which is why the query also checks events.total. The index documentation does not describe these fields:

GET wazuh-metrics-comms-v4/_search
{
  "size": 0,
  "query": { "range": { "@timestamp": { "gte": "now-24h" } } },
  "aggs": {
    "tcp_sessions": { "max": { "field": "tcp.sessions" } },
    "events": { "max": { "field": "events.total" } }
  }
}

Zero in both aggregations over a day means no sessions and no events on the legacy channel in that time.

Load balancer

The migration documentation requires that before upgrading the first agent you settle on a load balancer in front of the manager nodes, or a node assigned to each agent. 4.x agents connect to the manager or its load balancer on 1514 and 1515, and after the upgrade on 1517. Because a 5.x agent has one address, the address the agents use (the balancer name) must be in the master node certificate: the master creates the enrollment tokens and rejects an address outside its own certificate. The documentation does not say whether a balancer on 1517 should pass TCP through or terminate TLS. The requirement that every node certificate carry the address the agents use fits TCP passthrough, because then the agent sees the node certificate; that is my inference, not a vendor statement. Nor does it describe how the balancer affects the agent source address the manager sees, so check that in a lab before you route the first group of agents through the balancer. Load balancer for Wazuh agents describes the 4.x ports, and enrollment over the legacy channel is covered in the post on agent enrollment. What changed in the daemons and tools on the manager side is collected in the map for 4.x operators.

Sources

↑↓ select Enter open Esc close