Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Case insensitive parameter for Wazuh's API endpoints #468

Open
AdriiiPRodri opened this issue Jan 16, 2020 · 0 comments
Open

Case insensitive parameter for Wazuh's API endpoints #468

AdriiiPRodri opened this issue Jan 16, 2020 · 0 comments

Comments

@AdriiiPRodri
Copy link
Contributor

Hi all,

This issues is related and close #467. As @skiingyac reported to us, the endpoint GET /agents/name/:agent_name is case sensitive.

We should add a new parameter to the endpoint (and any other affected endpoint) in order to search using case insensitive.

Before

curl -u foo:bar -k -X GET "https://127.0.0.1:55000/agents/name/NewHost?pretty"

{
   "error": 0,
   "data": {
      "ip": "10.0.0.9",
      "id": "009",
      "name": "NewHost",
      "dateAdd": "2019-08-30 09:31:01",
      "status": "Never connected",
      "registerIP": "10.0.0.9",
      "node_name": "unknown"
   }
}
curl -u foo:bar -k -X GET "https://127.0.0.1:55000/agents/name/newhost?pretty"

{
    "error": 1701,
    "message": "Agent does not exist: newhost"
}

After

curl -u foo:bar -k -X GET "https://127.0.0.1:55000/agents/name/newhost?pretty&insensitive"

{
   "error": 0,
   "data": {
      "ip": "10.0.0.9",
      "id": "009",
      "name": "NewHost",
      "dateAdd": "2019-08-30 09:31:01",
      "status": "Never connected",
      "registerIP": "10.0.0.9",
      "node_name": "unknown"
   }
}

Regards.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant