> 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/assign-role-to-user-on-tenable.md).

# Assign Role to User on Tenable

Assigns a Tenable RBAC role to each matched user asset.

### 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: user only.
* Required columns: `Email`, `Username`.
* Each user asset is matched to a Tenable user by the **Username Field** value, compared case-insensitively with the Tenable username, email and user name.
* The user that owns the API keys needs the Administrator role \[64] for user actions. Tenable answers 403 otherwise.

### 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       | 500                         | Upper bound on how many assets a single run may act on. Extra assets are logged and skipped.                            |
| Username Field      | Choice         | No       | Email                       | Asset column matched against the Tenable username. Choices: `Email`, `Username`. Tenable usernames are email addresses. |
| Role Name           | Text           | Yes      | None                        | RBAC role name. Example: `Administrator`, `Security Analyst`.                                                           |

### How it works

* Before any user is handled, the job finds the role by name (case-insensitive) in `GET /access-control/v1/roles`. If the role does not exist, the job fails.
* The job reads the Tenable user list once and matches each user asset (cut to **Maximum Assets**) by the **Username Field**. Assets with no value or no Tenable match are skipped and logged at debug level; they are not counted as failures.
* For each matched user the job sends `PUT /access-control/v1/users/<user uuid>/roles` with the role as the single entry of `role_uuids` (Tenable accepts exactly one). The job does not check the current role first, so it sends the request for every matched user.
* A failure for one user is logged and the job continues. If every matched user fails, the job fails. If only some fail, the job succeeds and logs the counts. If no user matched, the job logs that it has nothing to act on.
* The job passes the matched assets it received on to the next node unchanged.

### Example

Give a role to users found by your condition.

| Setting        | Value                       |
| -------------- | --------------------------- |
| Domain         | `https://cloud.tenable.com` |
| Access Key     | `YOUR_ACCESS_KEY`           |
| Secret Key     | `YOUR_SECRET_KEY`           |
| Username Field | `Email`                     |
| Role Name      | `Security Analyst`          |

### 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>Create User on Tenable</strong></td><td>Create a Tenable user account for each matched user asset.</td><td><a href="broken://pages/1f80f17c84064646b6cb2e24867cc21f2d095e2d">Broken link</a></td></tr><tr><td><strong>Assign Group to User on Tenable</strong></td><td>Add each matched user asset to a Tenable user group.</td><td><a href="broken://pages/6579fa95e32cbd3264153eadcf9d238bafaaaa18">Broken link</a></td></tr></tbody></table>

{% hint style="info" %}
Available starting from version 6.7.2.
{% endhint %}
