Everyday, I’m doing an agents export from Rapid7 - Login*******/agent-management
I’ll looking to script/shedule it using API, CURL and Powershell.
I’m using US1 cloud tenant and have already generated a user API.
Next step on which I’m stuck : Build the CURL query to get all my agents.
I’v no idea how to…api host to use…fully newbies…
Any hint from scripting gurus ?
you cannot schedule a CSV export via agent management, we do however have a Graphql Preview API, which is the API used to load the agent mangement page which we can provide access to
@david_smith : Thks
I’m getting following error :
message":"Validation error of type FieldUndefined: Field ‘beaconTime’ in type ‘Agent’ is undefined @ 'organization/assets/edges/node/agent/beaconTime
@david_smith Based on your experience, what would be the best way to get detail on a specific agent ?
Assuming something like $Name = “aSpecificAgentName” , query($Name: String!) would work ?
You can’t apply a filter like name to your query beforehand, your best option would be to query for all agents (up to the first 10000) and the using the output you can fetch the information related to a particular agent by iterating over the objects that are returned in the JSON response.
@david_smith : My script is working well for months now.
Unfortunalty, I’v now more than 10000 agents, meaning that, my query in truncated.
How can I get the second page of my output to get agent after the first 10000 ?