Hello Team,
I've configured my Wazuh agent to use SSL certificates to verify that an agent is authorised to enrol in the Wazuh manager. By following the instructions in the Wazuh documentation- Wazuh agent identity verification - Additional security options . I was able to register devices with the Wazuh Manager. However, it seems the key expires after 30 days, requiring me to generate a new key.
I attempted to extend the certificate key’s validity to a year by using the following command:
openssl req -x509 -new -nodes -newkey rsa:4096 -keyout rootCA.key -out rootCA.pem -days 365 -batch -subj "/C=US/ST=CA/O=Wazuh"
However, this didn’t work. I received the following error message:
Test Server:
2024/10/17 12:19:08 wazuh-agentd: INFO: Requesting a key from server: a…………
2024/10/17 12:19:08 wazuh-agentd: INFO: No authentication password provided
2024/10/17 12:19:08 wazuh-agentd: INFO: Using agent name as: Testserver01…………
2024/10/17 12:19:08 wazuh-agentd: INFO: Waiting for server reply
2024/10/17 12:19:08 wazuh-agentd: ERROR: SSL read (unable to receive message)
2024/10/17 12:19:08 wazuh-agentd: ERROR: If Agent verification is enabled, the agent key and certificates may be incorrect!
Test Laptop:
2024/10/17 12:19:08 wazuh-agentd: ERROR: If Agent verification is enabled, the agent key and certificates may be incorrect!
wazuh-agent: ERROR: Unable to read private key file: sslagent.key
It works fine with the default (presumably 30-day) certificate and was able to register new devices. The certificate authority (self-signed) should be valid for 365 days, but it isn’t producing a valid key. Do you know why this might be?
Many Thanks
Omar
