Every Wazuh Agent sends data to the Wazuh Manager via a secure way called OSSEC message protocol. This encrypts messages using a pre-shared key. Initially, when you successfully install a new Wazuh Agent, this cannot communicate with the Wazuh Manager due to a lack of that pre-shared key.
The registration process consists of a mechanism to create a trusted relationship between the Manager and an Agent. This process could be done in a Manager itself or with a registration service. This service runs on the Manager, where an Agent could request a pre-shared key using some credentials. The Manager will reply with the key and store the new Agent in a local database.
Another approach is using the RESTful API, this is just a wrapper for local registration on Wazuh Manager.
Agent keys
The manager uses the file /var/ossec/etc/client.keys to store the registration record of each agent, which includes ID, name, IP, and key. Example: