REST API SCA request

80 views
Skip to first unread message

Maiky Roger

unread,
Oct 4, 2022, 5:44:26 PM10/4/22
to Wazuh mailing list
Hello,

In attempt to create a Global Security Score using Wazuh REST API, I found a problem.
The only way to get SCA score is through GET /sca/:agent_id

There is some way to get all agents score whitout doing one request for each one ?

Ps: Already tried, and get no results with CIS-CAT experimental /experimental/ciscat/results

Federico Gustavo Caffieri

unread,
Oct 4, 2022, 7:48:48 PM10/4/22
to Wazuh mailing list

Hi maikyrg9, 

I'm working on an answer to your query, I'll be back as soon as possible. 

Thanks.

Federico Gustavo Caffieri

unread,
Oct 5, 2022, 8:51:46 AM10/5/22
to Wazuh mailing list

Hi maikyrg9,

The API only allows querying the scores of SCA by indicating the agent_id in the URL.

What you can do is generate a script with some language that you handle (as an example you can use python), where you list all the agents by using the API, you can use the following URL:
https://<your_ip>:55000/agents?select=id,name

Then go through the result and for each agent execute the score query:
https://<your_ip>:55000/sca/000?pretty=true

Or just the score directly:
https://<your_ip>:55000/ciscat/000/results?pretty=true

I hope to be helpful.

Thanks.
Reply all
Reply to author
Forward
0 new messages