> 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.md).

# FortiGate

FortiGate is Fortinet's next-generation firewall. OctoXLabs reads each virtual domain (VDOM) of a FortiGate through the REST API, together with its firewall policies, virtual IPs and IP pools. It can also read local users.

## Use cases

* List all FortiGate VDOMs that OctoXLabs knows about.

```
Adapters = fortigate
```

* Find firewalls that no vulnerability scanner covers.

```
Adapters = fortigate AND NOT Adapters = tenable-sc
```

## Before you begin

### Network

| Source              | Destination                               | Port                        | Protocol                           |
| ------------------- | ----------------------------------------- | --------------------------- | ---------------------------------- |
| OctoXLabs connector | FortiGate management interface (REST API) | 443 (default, configurable) | HTTPS (HTTP when Is secure is off) |

### Required permissions

| Scope or role                                          | Permission | Needed for        |
| ------------------------------------------------------ | ---------- | ----------------- |
| REST API Admin with the `super_admin_readonly` profile | Read       | Devices and users |

## Create credentials in FortiGate

{% stepper %}
{% step %}

### Open the administrators page

In the FortiGate UI, go to **System** > **Administrators**.
{% endstep %}

{% step %}

### Create a REST API Admin

Click **Create New** and select **REST API Admin**. Fill in the required details and assign the **super\_admin\_readonly** profile.
{% endstep %}

{% step %}

### Save the token

Save the settings and copy the generated API token.

{% hint style="info" %}
The token is shown only once. Store it in a secure place.
{% endhint %}
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter    | Required | Type             | Default | Description                                                                 |
| ------------ | -------- | ---------------- | ------- | --------------------------------------------------------------------------- |
| Ip           | Yes      | Text             | None    | IP address of the FortiGate host.                                           |
| Port         | No       | Integer          | 443     | Port number.                                                                |
| Api token    | Yes      | Text (sensitive) | None    | REST API token.                                                             |
| Is secure    | No       | Boolean          | True    | Use HTTPS. Advanced.                                                        |
| Per page     | No       | Integer          | 50      | Records per request. Advanced.                                              |
| Timeout      | No       | Integer          | 30      | Seconds to wait for API responses. Advanced.                                |
| Proxy        | No       | Text             | Empty   | Proxy URL. Advanced.                                                        |
| Thread count | No       | Integer          | 32      | Parallel threads. Minimum 1, maximum 32. Advanced.                          |
| Sleep time   | No       | Integer          | 0       | Seconds between thread batches. Increase it on rate limit errors. Advanced. |
| Fetch users  | No       | Boolean          | False   | Also collect local users. Advanced.                                         |

## Troubleshooting

| Error message                                                                         | Cause                                  | Fix                                                                        |
| ------------------------------------------------------------------------------------- | -------------------------------------- | -------------------------------------------------------------------------- |
| `Empty device_identifier from /monitor/system/status — verify FortiGate API response` | The status call returned no hostname.  | Check the token profile and that the API answers on the given IP and port. |
| `Request to <url> failed after 5 attempts.`                                           | The connection was refused five times. | Check the network path and the management port.                            |

## Change history

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