> For the complete documentation index, see [llms.txt](https://inverselattice.gitbook.io/saurabhsugandh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://inverselattice.gitbook.io/saurabhsugandh/sample-api-reference/prisma-cloud-compute.md).

# Prisma Cloud Compute

This section describes how to configure a tag for vulnerability management. A vulnerability can be found in a source or a binary package.

## /api/vVERSION/tags/{id}/vuln

Sets a tag to a vulnerability based on Common Vulnerability and Exposures (CVE) ID, package, and resource.

<mark style="color:green;">`POST`</mark> `https://<Prisma_Cloud_Compute_URL>/api/vVERSION/tags/{id}/vuln`

#### Path Parameters

| Name                                 | Type   | Description                  |
| ------------------------------------ | ------ | ---------------------------- |
| id<mark style="color:red;">\*</mark> | String | Specifies the ID of the tag. |

#### Headers

| Name         | Type   | Description                                                           |
| ------------ | ------ | --------------------------------------------------------------------- |
| Content-Type | String | <p>Specifies the header type.</p><p><code>application/json</code></p> |

#### Request Body

| Name                                          | Type           | Description                                                                                                                                                                                                                                                                                                              |
| --------------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| id<mark style="color:red;">\*</mark>          | String         | Specifies a Common Vulnerability and Exposures (CVE) ID.                                                                                                                                                                                                                                                                 |
| packageName<mark style="color:red;">\*</mark> | String         | <p>Specifies a source or binary package name. </p><p></p><p>Use a wildcard <code>\*</code> to apply the tag to all the packages.</p><p></p><p><strong>Tip:</strong> Specify the source package name for tagging when a vulnerability is in the source package. </p>                                                      |
| checkBaseLayer                                | Boolean        | <p>(<code>Applicable only when the resource type is image.</code>) Specifies to apply the tag for images that has one of the resources in a base layer.</p><p></p><p>Available values:</p><p><strong><code>true</code>:</strong> Applies the tag. </p><p><strong><code>false</code>:</strong> Doesn't apply the tag.</p> |
| resourceType                                  | String         | <p>Specifies a resource type such as <code>image</code>, <code>host</code>, <code>function</code>, or <code>codeRepo</code> for tagging.</p><p></p><p>Use a wildcard <code>\*</code> to apply the tag to all the resource types.</p><p></p>                                                                              |
| resources                                     | Array (String) | <p>(<code>Applicable only when you define a resource type.</code>) Specifies a resource for tagging a vulnerability. </p><p></p><p>Either specify the resource names separated by a comma or use a wildcard <code>\*</code> to apply the tag to all the resources.</p>                                                   |
| comment                                       | String         | Describes the usability of a tag.                                                                                                                                                                                                                                                                                        |

{% tabs %}
{% tab title="200: OK Specifies the operation is successful." %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### Example and Scenarios

Use this section to understand various applicable scenarios to use the endpoint.

**Consider the following cURL requests and scenarios**:

A CVE `CVE-2020-16156` is found in packages such as `perl`, `perl-open`, `perl-macros`, and `perl-libs`.&#x20;

Refer to the following example cURL request to apply a tag `Critical` to all packages and resources:

```
$ curl -k \
  -u <USER> \
  -H 'Content-Type: application/json' \
  -X POST \
  -d \
'{
  "id": "CVE-2020-16156",
  "packageName": "*"
}' \
  "https://<CONSOLE>/api/v<VERSION>/tags/Critical/vuln"
```

Refer to the following example cURL request to apply a tag `Critical` to a resource type `image` and to all packages and resources:

```
$ curl -k \
  -u <USER> \
  -H 'Content-Type: application/json' \
  -X POST \
  -d \
'{
  "id": "CVE-2020-16156",
  "packageName": "*",
  "resourceType": "image",
  "resources": ["*"]
}' \
  "https://<CONSOLE>/api/v<VERSION>/tags/Critical/vuln"
```

Refer to the following example cURL request to apply a tag `Critical` to a resource type `host` and a resource `servo` and also to all packages:

```
$ curl -k \
  -u <USER> \
  -H 'Content-Type: application/json' \
  -X POST \
  -d \
'{
  "id": "CVE-2020-16156",
  "packageName": "*",
  "resourceType": "host",
  "resources": ["servo"]
}' \
  "https://<CONSOLE>/api/v<VERSION>/tags/Critical/vuln"
```

### Error Codes

Refer to the following error codes that you may encounter while using the cURL request:

{% tabs %}
{% tab title="400" %}
Bad request: Invalid syntax. Modify your syntax and try again.
{% endtab %}

{% tab title="401" %}
Unauthorised access: Invalid authorisation credentials. Verify the username and password.&#x20;
{% endtab %}
{% endtabs %}
