Vulnerability Management: Bulk Agent Profile Operations
A new endpoint has been added to the Tenable Vulnerability Management API to enable users to bulk assign agents to a profile or bulk remove agents from a profile.
The new endpoint is described in the following table:
API Endpoint | Name | Description |
---|---|---|
POST /scanners/null/agents/_bulk/assignToProfile | Agent profile operations | Creates a bulk operation task to either assign agents to a profile or to remove agents from a profile. |
The agent profile operations endpoint accepts the following body parameters:
Parameter | Type | Description |
---|---|---|
profile_uuid | string | The UUID of the profile to assign the agents to. |
criteria | object | A set of optional parameters that you can use to filter agents for the bulk agent profile operation. |
items | array of strings | An array of agent UUIDs to add or remove from a profile. |
not_items | array of strings | An array of agent UUIDs to exclude from the filters specified in the criteria. |
Examples
Bulk assign agents to a profile
For example, to create a bulk operation task to assign three agents to a profile with the UUID 76756795-0881-43d3-90f6-7d6c3d38c6ea
, you can use the following cURL request:
curl --request POST \
--url https://cloud.tenable.com/scanners/null/agents/_bulk/assignToProfile \
--header 'X-ApiKeys: accessKey=<YOURKEY>;secretKey=<YOURKEY>' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"items": [
"eca52817-3e59-436d-80c0-2ec30972db61",
"e4bca881-2cfe-49e1-a34b-5dbc43eec345",
"cc04ef09-c50b-472f-bc94-08c8d3d7729e"
],
"profile_uuid": "76756795-0881-43d3-90f6-7d6c3d38c6ea"
}
'
Bulk remove agents from a profile
For example, to create a bulk operation task to remove the three agents added in the previous example from the agent profile, you can simply omit the profile_uuid
parameter as in the following cURL request:
curl --request POST \
curl --request POST \
--url https://cloud.tenable.com/scanners/null/agents/_bulk/assignToProfile \
--header 'X-ApiKeys: accessKey=<YOURKEY>;secretKey=<YOURKEY>' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"items": [
"eca52817-3e59-436d-80c0-2ec30972db61",
"e4bca881-2cfe-49e1-a34b-5dbc43eec345",
"cc04ef09-c50b-472f-bc94-08c8d3d7729e"
]
}
'
Bulk assign agents to a profile using filter criteria
For example, to create a bulk operation task to assign all agents with a core_version
greater than 10.0.0
to an agent profile with the UUID 76756795-0881-43d3-90f6-7d6c3d38c6ea
, you can use the following cURL request:
curl --request POST \
--url https://cloud.tenable.com/scanners/null/agents/_bulk/assignToProfile \
--header 'X-ApiKeys: accessKey=<YOURKEY>;secretKey=<YOURKEY>' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"criteria": {
"filters": [
"core_version:gt:10.0.0"
]
},
"profile_uuid": "76756795-0881-43d3-90f6-7d6c3d38c6ea"
}
'