Hi all,
We're running a wazuh cluster, v4.3.1, with a single manager handling wodles/gcp-pubsub and a single worker handling the events from agents. We register our Wazuh agents with a password which seems to be working fine. However, once registered the manager reports:
{"timestamp":"2022/09/12 13:45:55","tag":"wazuh-authd","pid":30643,"file":"auth.c","line":106,"routine":"w_auth_parse_data","level":"info","description":"Received request for a new agent (AGENT NAME) from: AGENT IP"}
{"timestamp":"2022/09/12 13:45:55","tag":"wazuh-authd","pid":30643,"file":"main-server.c","line":654,"routine":"run_dispatcher","level":"info","description":"Agent key generated for 'AGENT NAME' (requested by any)"}
{"timestamp":"2022/09/12 13:45:55","tag":"wazuh-authd","pid":30643,"file":"main-server.c","line":808,"routine":"run_writer","level":"debug","description":"Dumping changes into disk."}
{"timestamp":"2022/09/12 13:45:55","tag":"wazuh-authd","pid":30643,"file":"main-server.c","line":848,"routine":"run_writer","level":"debug","description":"[Writer] Performing insert([148581] AGENT NAME)."
{"timestamp":"2022/09/12 13:46:02","tag":"wazuh-remoted","level":"info","description":"(1409): Authentication file changed. Updating."}
{"timestamp":"2022/09/12 13:46:02","tag":"wazuh-remoted","level":"info","description":"(1410): Reading authentication keys file."}
{"timestamp":"2022/09/12 13:46:03","tag":"wazuh-authd","pid":30643,"file":"main-server.c","line":584,"routine":"run_dispatcher","level":"debug","description":"SSL Error (-1)"}
{"timestamp":"2022/09/12 13:46:07","tag":"wazuh-authd","pid":30643,"file":"main-server.c","line":591,"routine":"run_dispatcher","level":"info","description":"New connection from AGENT IP"}
{"timestamp":"2022/09/12 13:46:07","tag":"wazuh-authd","pid":30643,"file":"auth.c","line":89,"routine":"w_auth_parse_data","level":"error","description":"Invalid password provided by AGENT IP. Closing connection."}
I've verified that the passwords match - I think this is something to do with SSL rather than the password. The manager and worker also have correct ownership of files around authentication (client.keys, authd.pass). The manager is behind an AWS network load balancer, which forwards 1515/TCP to the manager and 1514/TCP to the workers. The agent logs the following:
2022/09/08 01:11:51 wazuh-agentd: WARNING: (4101): Waiting for server reply (not started). Tried: '
manager.wazuh.gutools.co.uk/54.73.53.14'.
2022/09/08 01:11:51 wazuh-agentd: WARNING: Unable to connect to any server.
2022/09/08 01:11:51 wazuh-agentd: INFO: Closing connection to server (MANAGER URL/MANAGER IP:1514/tcp).
2022/09/08 01:11:51 wazuh-agentd: INFO: Trying to connect to server (MANAGER URL/MANAGER IP:1514/tcp).
2022/09/08 01:13:01 wazuh-agentd: INFO: Closing connection to server (MANAGER URL/MANAGER IP:1514/tcp).
2022/09/08 01:13:01 wazuh-agentd: INFO: Trying to connect to server (MANAGER URL/MANAGER IP:1514/tcp).
2022/09/08 01:14:11 wazuh-agentd: INFO: Closing connection to server (MANAGER URL/MANAGER IP:1514/tcp).
2022/09/08 01:14:11 wazuh-agentd: INFO: Trying to connect to server (MANAGER URL/MANAGER IP:1514/tcp).
2022/09/08 01:14:37 wazuh-agentd: INFO: Closing connection to server (MANAGER URL/MANAGER IP:1514/tcp).
2022/09/08 01:14:37 wazuh-agentd: INFO: Trying to connect to server (MANAGER URL/MANAGER IP/tcp).
2022/09/08 01:14:37 wazuh-agentd: ERROR: (1216): Unable to connect to 'MANAGER IP/tcp': 'Connection refused'.
2022/09/08 01:14:47 wazuh-agentd: INFO: Trying to connect to server (MANAGER URL/MANAGER IP/tcp).
2022/09/08 01:15:47 wazuh-agentd: INFO: Requesting a key from server: MANAGER URL/MANAGER IP
2022/09/08 01:15:47 wazuh-agentd: INFO: No authentication password provided
2022/09/08 01:15:47 wazuh-agentd: INFO: Using agent name as: AGENT NAME
2022/09/08 01:15:47 wazuh-agentd: INFO: Waiting for server reply
2022/09/08 01:15:47 wazuh-agentd: ERROR: Invalid password (from manager)
2022/09/08 01:15:47 wazuh-agentd: ERROR: Unable to add agent (from manager)
It's probably also worth noting that restart the worker briefly allows some of the agents to reconnect, however they time out after 5 minutes. This does suggest the password/registration probably isn't the issue.
Please let me know if I can provide any more information, thank you!