MacOS X hosts

Open a session in your MacOS X agent host as root user. Then, follow these steps:

  1. Add the agent to the manager.
# curl -u foo:bar -k -X POST -d '{"name":"macos-agent","ip":"10.0.0.8"}' -H 'Content-Type:application/json' "https://192.168.1.2:55000/agents?pretty"
{
  "error": 0,
  "data": {
      "id": "001",
      "key": "MDAxIE5ld0FnZW50IDEwLjAuMC44IDM0MGQ1NjNkODQyNjcxMWIyYzUzZTE1MGIzYjEyYWVlMTU1ODgxMzVhNDE3MWQ1Y2IzZDY4M2Y0YjA0ZWVjYzM="
  }
}
  1. Import the key to the agent:
# /Library/Ossec/bin/manage_agents -i MDAxIE5ld0FnZW50IDEwLjAuMC44IDM0MGQ1NjNkODQyNjcxMWIyYzUzZTE1MGIzYjEyYWVlMTU1ODgxMzVhNDE3MWQ1Y2IzZDY4M2Y0YjA0ZWVjYzM=

Warning

If you paste the command directly into the terminal, the agent key will be saved in the bash history. Use manage_agents without arguments or from a script.

  1. Edit the Wazuh agent configuration in /Library/Ossec/etc/ossec.conf to add the Wazuh server IP address. In the <client><server> section, change the MANAGER_IP value to the Wazuh server address:
<client>
  <server>
    <address>MANAGER_IP</address>
    ...
  </server>
</client>
  1. Start the agent.
# /Library/Ossec/bin/ossec-control start