> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/action-center/tenable/add-tag-to-assets-on-tenable.md).

# Add Tag to Assets on Tenable

Adds a Tenable tag (category and value) to the matched assets. The job looks the devices up in Tenable, finds the tag, and assigns it to all matched assets in bulk assignment requests. Remove Tag from Assets on Tenable does the reverse and has no **Create Tag If Missing** setting.

### Before you begin

* An API key pair for Tenable Vulnerability Management: an **Access Key** and a **Secret Key**, generated in the Tenable console under Settings - My Account - API Keys. The default **Domain** is `https://cloud.tenable.com`.
* Connection defaults (Domain, Access Key, Secret Key, Timeout, Verify SSL) can be saved once under **Action Center** > **Settings**. See [Action Center Settings](broken://pages/742bb94503961e05b5eaa95572a142f73cd7ecb2).
* Asset type: device only. Required columns: `Hostname`, `IpAddresses`.
* The devices must already exist as assets in Tenable. The job looks them up by hostname or IP address.

### Settings

The job node shows these fields.

| Setting               | Type           | Required | Default                     | Description                                                                                               |
| --------------------- | -------------- | -------- | --------------------------- | --------------------------------------------------------------------------------------------------------- |
| Domain                | URL            | No       | <https://cloud.tenable.com> | Base URL of Tenable. Example: `https://cloud.tenable.com`.                                                |
| Access Key            | Sensitive text | Yes      | None                        | Generated in the Tenable console under Settings - My Account - API Keys. Masked after saving.             |
| Secret Key            | Sensitive text | Yes      | None                        | The secret key of the same key pair. Masked after saving.                                                 |
| Timeout               | Number         | No       | 30                          | Request timeout in seconds.                                                                               |
| Verify SSL            | Boolean        | No       | On                          | Verify the TLS certificate of the Tenable host.                                                           |
| Retry on Rate Limit   | Boolean        | No       | On                          | Retry a request once when Tenable answers 429, waiting for the `retry-after` header (at most 60 seconds). |
| Maximum Assets        | Number         | No       | 5000                        | Upper bound on how many assets a single request body may carry. Extra assets are logged and skipped.      |
| Tag Category          | Text           | Yes      | None                        | Example: `OctoXLabs`.                                                                                     |
| Tag Value             | Text           | Yes      | None                        | Example: `High CVSS`.                                                                                     |
| Create Tag If Missing | Boolean        | No       | Off                         | Create the tag category and value when they do not exist yet.                                             |

### How it works

* The job reads the Tenable asset list once (`GET /assets`) and indexes it by hostname, FQDN, IPv4 and NetBIOS name. A device matches by its hostnames (also the short name before the first dot) or its IP addresses. The list is not paged: if Tenable returns 5,000 records, the job logs a warning and assets beyond that cannot be resolved.
* Devices with no match in Tenable are logged and skipped. If no device matches, the job logs that there is nothing to do and sends nothing.
* The job finds the tag by category and value in the Tenable tag list (case-insensitive).
* If the tag does not exist and **Create Tag If Missing** is off, the job fails. If it is on, the job creates the tag with the description `Created by the OctoXLabs workflow '<workflow title>'.` The tag is looked up only after at least one asset matched.
* The job sends `POST /tags/assets/assignments` with the action `add`, the asset ids and the tag, in chunks of up to 5,000 assets, and logs the Tenable tag job id. Tenable queues the assignment.
* A failed request fails the job.
* The job passes the matched assets it received on to the next node unchanged.

### Example

Tag the devices found by your condition as high CVSS.

| Setting               | Value                       |
| --------------------- | --------------------------- |
| Domain                | `https://cloud.tenable.com` |
| Access Key            | `YOUR_ACCESS_KEY`           |
| Secret Key            | `YOUR_SECRET_KEY`           |
| Tag Category          | `OctoXLabs`                 |
| Tag Value             | `High CVSS`                 |
| Create Tag If Missing | On                          |

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>About Action Center</strong></td><td>Workflows, triggers, conditions and job nodes.</td><td><a href="broken://pages/ed78ac5bacec4909acb71c776dd17d62cfa78748">Broken link</a></td></tr><tr><td><strong>Action Center Settings</strong></td><td>Save connection defaults for Tenable jobs.</td><td><a href="broken://pages/742bb94503961e05b5eaa95572a142f73cd7ecb2">Broken link</a></td></tr><tr><td><strong>Remove Tag from Assets on Tenable</strong></td><td>Remove a Tenable tag from the matched assets.</td><td><a href="broken://pages/f476d9e04125e82cba12a32f76f657284f48a5ec">Broken link</a></td></tr><tr><td><strong>Add IP Addresses to Tag Value on Tenable</strong></td><td>Create or update a Tenable tag value whose asset filter matches the matched assets.</td><td><a href="broken://pages/c3cb6b6b5a3be65552b6be64204fd9087bb91147">Broken link</a></td></tr></tbody></table>
