> 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/f/fortigate-cloud.md).

# FortiGate Cloud

FortiGate Cloud provides cloud-managed visibility and lifecycle management for FortiGate firewalls. OctoXLabs reads the device list through the FortiCloud API and adds the devices to the inventory.

## Use cases

* List all FortiGate devices registered in FortiCloud.

```
Adapters = fortigate-cloud
```

* Compare cloud-registered firewalls with those OctoXLabs reads directly.

```
Adapters = fortigate-cloud AND NOT Adapters = fortigate
```

## Before you begin

### Network

| Source              | Destination                                                  | Port | Protocol |
| ------------------- | ------------------------------------------------------------ | ---- | -------- |
| OctoXLabs connector | `customerapiauth.fortinet.com` (token)                       | 443  | HTTPS    |
| OctoXLabs connector | FortiCloud domain, default `www.forticloud.com` (device API) | 443  | HTTPS    |

### Required permissions

| Scope or role | Permission                           | Needed for      |
| ------------- | ------------------------------------ | --------------- |
| IAM API user  | Admin permission for FortiGate Cloud | Reading devices |

## Create credentials in FortiGate Cloud

{% stepper %}
{% step %}

### Create an IAM API user

Log in to the FortiCloud IAM portal and create an IAM API user with **Admin** permissions for FortiGate Cloud.
{% endstep %}

{% step %}

### Download the API credentials

Download the credentials. They contain the API key, the client ID and the password. Use them in the parameters below.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter   | Required | Type             | Default                      | Description                                               |
| ----------- | -------- | ---------------- | ---------------------------- | --------------------------------------------------------- |
| Domain      | No       | Text             | `https://www.forticloud.com` | Global FortiCloud domain, with scheme.                    |
| Client id   | Yes      | Text             | None                         | Client ID of the IAM API user.                            |
| Api key     | Yes      | Text             | None                         | API key of the IAM API user (sent as the OAuth username). |
| Password    | Yes      | Text (sensitive) | None                         | Password of the IAM API user.                             |
| Https proxy | No       | Text             | Empty                        | Proxy URL.                                                |
| Timeout     | No       | Integer          | 30                           | Seconds to wait for API responses.                        |

## Troubleshooting

| Error message                                                  | Cause                                      | Fix                                                                                         |
| -------------------------------------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------- |
| `Request failed after 5 retries for url <url>`                 | The API kept answering HTTP 401 or 429.    | Check the credentials, then retry later.                                                    |
| `Failed to fetch users: <status>`                              | The device list returned a non-200 status. | Check the IAM API user permissions. The text says "users" but refers to the device request. |
| `Invalid JSON response while fetching users (status=<status>)` | The device list response was not JSON.     | Check the domain value.                                                                     |

## Change history

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