wazuh / wazuh-agent

The Wazuh agent for endpoints.
https://wazuh.com
GNU Affero General Public License v3.0
32 stars 19 forks source link

Agent Saves Registration Information Even on Failure #314

Closed vikman90 closed 6 days ago

vikman90 commented 6 days ago

Parent Issue: #241

Description

When attempting to register an agent and the process fails with errors such as:

Failed to authenticate with the manager
wazuh-agent registration failed

The agent still creates and populates the _agentinfo.db file:

select * from agent_info;
dummy|ku3iIzPRNJjwIXKNnTU3qFv6QhodAu8k|95635cae-0c0d-486e-94a5-0fe29dd6972f

Steps to Reproduce

  1. Attempt to register the agent with invalid credentials.
  2. Observe the error messages in the logs.
  3. Check the contents of the _agentinfo.db file.

Expected Behavior

If the registration process fails, the database should not be altered.