improved

Bulk Agent Management Improvements

The Tenable.io API now supports criteria filtering for agent bulk operations. Users can now specify whether or not to perform bulk operation on all agents or a subset of agents determined by filtering criteria. Previously, users could only specify an array of agent IDs or UUIDs when performing agent bulk operations.

Updated Endpoints

This update applies to the following endpoints:

EndpointNameDescription
POST /scanners/null/agent-groups/{group_id}/agents/_bulk/addAdd agents to groupCreates a bulk operation task to add agents to a group.
POST /scanners/null/agents/_bulk/addToNetworkAdd agents to a networkCreates a bulk operation task to add agents to a custom network.
POST /scanners/null/agent-groups/{group_id}/agents/_bulk/removeRemove agents from groupCreates a bulk operation task to remove agents from a group.
POST /scanners/null/agents/_bulk/removeFromNetworkRemove agents from a networkCreates a bulk operation task to remove agents from a custom network.
POST /scanners/null/agents/_bulk/unlinkUnlink agentsCreates a bulk operation task to unlink agents. For more information on unlinked agent data, see Unlink an Agent.

New Parameters

You can specify filter criteria by using the criteria object. The criteria object can contain the following parameters:

ParameterTypeDescription
all_agentsbooleanIndicates whether or not to match against all agents.
wildcardstringA string used to match against all string-like attributes of an agent.
filtersarrayAn array of string or numeric operations to match against agents. For example, name:match:laptop or core_version:lt:10.0.0.
filter_typestringIndicates how to combine the filters conditions. Possible values are and or or.
hardcoded_filtersstringAdditional filters that will always be added as and conditions.

Examples

You can bulk add agents that contain the name laptop and where the core_version is less than 10.0.0 to a group by using the following criteria object in request body:

{
  "criteria": {
    "filters": [
      "name:match:laptop",
      "core_version:lt:10.0.0"
    ],
    "all_agents": false,
    "filter_type": "and"
  }
}

To use the above criteria object to bulk add agents to a group with the UUID 9bd87b50-7349-4a52-8a41-573b9a4b9bb6 you would use the following cURL request:

curl --request POST \
     --url https://cloud.tenable.com/scanners/null/agent-groups/9bd87b50-7349-4a52-8a41-573b9a4b9bb6/agents/_bulk/add \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --data '
{
  "criteria": {
    "filters": [
      "name:match:laptop",
      "core_version:lt:10.0.0"
    ],
    "all_agents": false,
    "filter_type": "and"
  }
}
'