Create a Dynamic Tag
You can create a dynamic tag using the Container Security APIs.
Input ParametersInput Parameters
The Input Parameter below is used for evaluating a dynamic tag for existing assets.
|
Parameter |
Mandatory/Optional |
Data Type |
Description |
|---|---|---|---|
| name | Mandatory | string | Describes the name of the tag you want to evaluate. Example Usage tagName=<name of the dynamic tag> |
| reevaluate |
Mandatory | boolean | Specify if re-evaluation is needed. Valid values: true or false |
| tagInfoDataList | Mandatory | -- | Specify information about the tag. |
| entityType | Mandatory | string | Describes type of the entity. Valid values: IMAGE or CONTAINER |
| rule | Mandatory | string | Specify the rule value in QQL format that you want to assign to the tag and repective assets (images or containers). |
Sample: Create a Dynamic TagSample: Create a Dynamic Tag
API Request
curl -X 'POST' \
'<qualys_base_url>/csapi/v1.3/tag/create' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"name": "sample",
"reevaluate": true,
"tagInfoDataList": [
{
"entityType": "IMAGE",
"rule": "image.repo.repository:latest"
}
]
}'
Response
{
"tagId": 52310803,
"name": "sample",
"backgroundColor": null,
"foregroundColor": null,
"icon": null,
"criticalityScore": null,
"entityTagInfo": [
{
"entityType": "image",
"dynamicTagRule": "image.repo.repository:latest"
}
]
}