> 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/fortimanager-on-prem.md).

# FortiManager On Prem

FortiManager On Prem centrally manages FortiGate firewalls, with provisioning, configuration and policy management. OctoXLabs reads the managed devices through the JSON-RPC API.

## Use cases

* List all devices managed by FortiManager.

```
Adapters = fortimanager
```

* Find managed firewalls that OctoXLabs does not read directly.

```
Adapters = fortimanager AND NOT Adapters = fortigate
```

## Before you begin

### Network

| Source              | Destination                           | Port                        | Protocol                           |
| ------------------- | ------------------------------------- | --------------------------- | ---------------------------------- |
| OctoXLabs connector | FortiManager (JSON-RPC at `/jsonrpc`) | 443 (default, configurable) | HTTPS (HTTP when Is secure is off) |

### Required permissions

| Scope or role                                               | Permission                                    | Needed for         |
| ----------------------------------------------------------- | --------------------------------------------- | ------------------ |
| Administrator account, or REST API Administrator with token | Read access to the device database (`/dvmdb`) | Devices            |
| Same account                                                | Read access to ADOMs and ADOM policy packages | Only with Use adom |

The exact profile is Not verified. With a token, the connection test fails when the administrator cannot read the device database.

## Create credentials in FortiManager

{% stepper %}
{% step %}

### Choose an authentication method

Provide **one** of the two methods. If both are filled, the API token takes precedence.

* **Username and password**: a standard administrator account. Both fields must be filled. The adapter signs in and reuses the session.
* **API token**: for REST API Administrator accounts, which cannot use username and password. Fill in only the API Token field. The adapter sends it as a Bearer token and does not sign in.
  {% endstep %}

{% step %}

### Decide on ADOM usage

Turn on **Use adom** if your devices are organized in ADOMs.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter | Required                      | Type             | Default | Description                                            |
| --------- | ----------------------------- | ---------------- | ------- | ------------------------------------------------------ |
| Ip        | Yes                           | Text             | None    | IP address of the FortiManager host.                   |
| Port      | No                            | Text             | 443     | Port number.                                           |
| Username  | When no token                 | Text             | None    | Administrator username. Leave empty with an API token. |
| Password  | When no token                 | Text (sensitive) | None    | Password of the user. Leave empty with an API token.   |
| Api token | When no username and password | Text (sensitive) | None    | Token of a REST API Administrator.                     |
| Use adom  | No                            | Boolean          | False   | Enable when you use ADOMs.                             |
| Is secure | No                            | Boolean          | True    | Use HTTPS.                                             |
| Timeout   | No                            | Integer          | 30      | Seconds to wait for API responses.                     |

## Troubleshooting

| Error message                                                | Cause                                         | Fix                                                                                                         |
| ------------------------------------------------------------ | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `Provide either an api_token or both username and password.` | No usable authentication was entered.         | Fill in the token, or both username and password.                                                           |
| `Message: Session ID was not found!`                         | The sign-in returned no session.              | Check the username and password. FortiManager's own message is shown when present.                          |
| `Message: Token validation failed!`                          | The token probe did not return status code 0. | Check the token and the administrator's read permissions. FortiManager's own message is shown when present. |

## Change history
