Create tag rules that apply tags automatically to assets that match your rule criteria, including any new assets that are attributed to your organization. Tag rules can be defined for IPv4 addresses and IPv4 ranges. These fields can be the same to denote a single IP address. If the list of IP addresses exceeds 100, Expander will create multiple tag rules, each with at most 100 IP addresses per rule.
Required License: Cortex Xpanse Expander
authorization
String
required
{{api_key}}
x-xdr-auth-id
String
required
{{api_key_id}}
request_dataObjectrequired
A dictionary containing the API request fields.
ip_rangesArray
List of dictionaries containing "from_ip" and "to_ip" to define an IP range. These fields can be the same to denote a single IP address.
For example,"from_ip": "1.1.1.1", "to_ip": "1.1.1.3"
.'
from_ipString
to_ipString
rule_nameString
Name of the tag rule. Will use tag_name
if left empty.
descriptionString
(Optional) Description of the tag rule.
tag_nameString
Name of the tag to be used to tag assets. If a rules-based tag with the same name already exists, it will use that tag. If not, a new rules-based tag will be created.
{
"request_data": {
"rule_name": "rule_name",
"ip_ranges": [
{
"to_ip": "to_ip",
"from_ip": "from_ip"
},
{
"to_ip": "to_ip",
"from_ip": "from_ip"
}
],
"tag_name": "tag_name",
"description": "description"
}
}
curl -X 'POST'
-H
'Accept: application/json'
-H
'Content-Type: application/json'
-H
'authorization: {{api_key}}'
-H
'x-xdr-auth-id: {{api_key_id}}'
'https://api-}/public_api/v1/assets/create_asset_tag_rules/'
-d
'{
"request_data" : {
"rule_name" : "rule_name",
"ip_ranges" : [ {
"to_ip" : "to_ip",
"from_ip" : "from_ip"
}, {
"to_ip" : "to_ip",
"from_ip" : "from_ip"
} ],
"tag_name" : "tag_name",
"description" : "description"
}
}'