> 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/adapters/c/cobalt.md).

# Cobalt

Cobalt is a pentest as a service platform. OctoXLabs uses the Cobalt API to add the assets under test, and optionally their pentest findings as vulnerabilities, to the inventory.

## Use cases

* List assets that Cobalt tracks.

```
Adapters = cobalt
```

* Find Cobalt assets that other sources do not report.

```
Adapters = cobalt AND NOT Adapters = active-directory
```

## Before you begin

### Network

| Source              | Destination                                                        | Port | Protocol |
| ------------------- | ------------------------------------------------------------------ | ---- | -------- |
| OctoXLabs connector | Cobalt API (default api.us.cobalt.io; api.eu.cobalt.io for the EU) | 443  | HTTPS    |

### Required permissions

| Scope or role      | Permission | Needed for                         |
| ------------------ | ---------- | ---------------------------------- |
| Personal API token | Read       | Organizations, assets and findings |

## Create credentials in Cobalt

{% stepper %}
{% step %}

### Open API tokens

Sign in to the Cobalt app and navigate to **Settings > API Tokens**.
{% endstep %}

{% step %}

### Create the token

Enter a name for the token and select **Generate New Token**.
{% endstep %}

{% step %}

### Copy the secret

Copy the value in the **Secret Token** field.

{% hint style="warning" %}
The token is shown only once. If you lose it, revoke it and generate a new one.
{% endhint %}
{% endstep %}

{% step %}

### Find the Org Token (optional)

If your account belongs to several organizations, send a GET request to the `/orgs` endpoint and copy the `token` attribute of the target organization.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter             | Required | Type     | Default          | Description                                                                                        |
| --------------------- | -------- | -------- | ---------------- | -------------------------------------------------------------------------------------------------- |
| Domain                | Yes      | Text     | api.us.cobalt.io | Cobalt API domain. Use `api.eu.cobalt.io` for the European instance.                               |
| Api Token             | Yes      | Password |                  | Personal Cobalt API token. Sent as a bearer token.                                                 |
| Org Token             | No       | Text     |                  | Token of the organization to collect. When empty, the first organization of the account is used.   |
| Fetch Vulnerabilities | No       | Boolean  | False            | Collect the pentest findings of every asset as vulnerabilities. Sends one extra request per asset. |
| Proxy URL             | No       | Text     |                  | Proxy URL.                                                                                         |
| Timeout               | No       | Number   | 30               | Seconds to wait for API responses.                                                                 |

## Troubleshooting

| Error message                                                                                                                               | Cause                                   | Fix                                                               |
| ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | ----------------------------------------------------------------- |
| No organization token could be read from /orgs. Set org\_token in the configuration, or make sure the API token belongs to an organization. | The API token returned no organization. | Fill in Org Token or use a token that belongs to an organization. |
| Max retries exceeded for ...                                                                                                                | HTTP 429 persisted after 5 retries.     | Wait and retry later.                                             |

## Change history

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