Hello Sylmarch,
You're right, active-response can currently be configured to be triggered at a specific agent but only by it's ID.
Then generate a random key for the agent
key=$(openssl rand -hex 32)
Then add the agent using the manager's API:
curl -k -X POST "https://localhost:55000/agents/insert" -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -d'
{
"name": "AR-agent",
"ip": "any",
"id": "003",
"key": "'$key'"
}'
Which will output something similar to:
{"data": {"id": "003", "key": "MDAzIEFSLWFnZW50IGFueSA2MmQ5NDRmZjIxYjY5NDRkMTEyOGU2NTAwMGI0MDFkMWZlYjBjYWEwYTJlODIyMWE0MTU4NzRlYjAwM2NmM2Y1"}, "error": 0}
Using they key provided there you may then provide the registration information to the agent by running:
/var/ossec/bin/manage_agents -i MDAzIEFSLWFnZW50IGFueSA2MmQ5NDRmZjIxYjY5NDRkMTEyOGU2NTAwMGI0MDFkMWZlYjBjYWEwYTJlODIyMWE0MTU4NzRlYjAwM2NmM2Y1
Thank you for your feedback and please let us know if you have any other questions.
Best Regards,
Juan Carlos Tello