Skip to main content
Connector guides

Connect Fortinet FortiGate and FortiManager

Fortinet FortiGate is a firewall, and FortiManager manages many of them from one place. FortiGate Cloud and FortiManager Cloud are the same products run by Fortinet. StackJack connects an AI assistant…

Written By Christopher Scaminaci

Last updated 11 days ago

Fortinet FortiGate is a firewall, and FortiManager manages many of them from one place. FortiGate Cloud and FortiManager Cloud are the same products run by Fortinet. StackJack connects an AI assistant to all three, so it can check and manage the firewalls of every customer you look after.

Connecting Fortinet to StackJack gives your AI assistant a family of forti_ MCP tools. MCP (Model Context Protocol) tools are the standardized commands an AI assistant can call through StackJack. With them, your AI can:

  • Check a firewall - system status, resources, interfaces, firmware, licenses, HA peers, VPN tunnels, routes, sessions, DHCP leases, SD-WAN health
  • Read the configuration - policies, addresses, services, VIPs, users, switches and access points, and the rest of the FortiOS configuration tables
  • Read the logs - event and traffic logs, in pages
  • Work in FortiManager - ADOMs, devices, policy packages, shared objects, revisions, tasks
  • Change things (on Pro plans) - create and edit objects and policies, ban an address, close a session, bring a tunnel up or down, install a policy package

Choose how StackJack reaches your firewalls

You choose one method for each connection. Start with a cloud method if you can: the other one asks you to open a management interface to the internet.

MethodWhat you needWhat stays closed
FortiGate CloudA FortiCloud IAM API user, and a FortiGate Cloud Standard subscription on each device (API Access is not part of Basic)Everything on your firewall
FortiManager CloudA FortiCloud IAM API user with FortiManager Cloud accessEverything on your firewall
A FortiManager that you runA REST API administrator key, a public address, a certificate from a public authority and a trusted host for StackJackNothing: the FortiManager is reachable from the internet

A direct connection to a single FortiGate is not available yet. A FortiManager that you run yourself is not that method, and it works today.

FortiGate Cloud and FortiManager Cloud

Create an IAM API user

  1. Sign in to the FortiCloud IAM portal and open API Users, then click Add API User.
  2. Under permissions, add FortiGate with Admin access for FortiGate Cloud, or FortiManager Cloud for FortiManager Cloud.
  3. Click Download credentials and keep the file. It holds the API ID and the password, and Fortinet shows them once. Downloading again resets the password, so download it once and paste the values straight away.

Connect it in StackJack

  1. Open Connectors, then Fortinet, and choose FortiGate Cloud or FortiManager Cloud.
  2. FortiGate Cloud: choose your region (Global, United States, Europe or Japan). A key sent to the wrong region fails exactly like a wrong password.
  3. FortiManager Cloud: paste the instance URL from the FortiManager Cloud portal. It looks like https://106728.ca-west-1.fortimanager.forticloud.com and ends in fortimanager.forticloud.com.
  4. Paste the IAM API ID and the IAM API password.
  5. Click Test connection. StackJack signs in to FortiCloud and reads one list: your devices (FortiGate Cloud) or the FortiManager system status (FortiManager Cloud). Nothing is changed.

StackJack keeps the short-lived token for you and stores the rotating refresh token Fortinet returns. You never paste a token.

A FortiManager that you run

This method needs three things on your side, and each one costs something:

  • Exposure. The FortiManager's web address must be reachable from the internet. Fortinet's own hardening guidance is not to allow administration on an internet-facing interface, so weigh this against FortiManager Cloud.
  • A certificate from a public authority. A FortiManager ships with a certificate signed by Fortinet's own private authority, which StackJack does not trust. The connection fails with a certificate message until you install a certificate for a public name.
  • Trusted hosts. The REST API administrator must list StackJack's addresses. StackJack does not publish them: open a support ticket and ask for them.

Then create the administrator and connect it:

  1. In FortiManager 7.2.2 or later, create an administrator of type REST API Admin, with JSON API Access set to Read-Write (Read for read-only use), an administrator profile and ADOM scope that fit, and the trusted hosts above.
  2. Copy the API key. FortiManager shows it once.
  3. In StackJack, open Connectors, then Fortinet, choose FortiManager that you run, paste the address (add the port if it is not 443, for example https://fortimanager.example.com:8443) and the key.
  4. Click Test connection.

Do not turn on certificate matching ("PKI") for this administrator: StackJack sends no client certificate, so every call would fail.

What is worth knowing before you start

Name the firewall on each call

A FortiOS tool takes a vdom (the value global means the whole device). On FortiGate Cloud it also takes the device serial, and on a FortiManager it takes the adom and the device name. FortiGate Cloud documents read access only through its proxy, so a change to a firewall goes through a FortiManager connection. One connection reaches every firewall in its FortiCloud account or its FortiManager.

A FortiManager write is not live yet

A write to the FortiManager database (an address, a policy) changes nothing on a firewall until a policy package is installed. The install tools push configuration to live devices, so they are marked destructive and your AI client asks before they run. An install that runs longer than StackJack waits (three minutes) ends as a timeout, not as a result: read the task to see how it finished.

The surface changes with the firmware

Fortinet's API differs between firmware releases. A 404 on a tool usually means the table or route is not on that firmware. The Fortinet documentation behind this API is open to Fortinet partners only, so StackJack built the tool list from Fortinet's own automation modules; tell support when a tool does not match your firmware.

Lists are large

A FortiOS list returns the whole table unless you trim it. Pass format (for example name|comment) and filter, and rows or count for logs and sessions (StackJack caps them at 500). FortiManager lists take fields, a filter, and a range, also capped at 500.

When Fortinet refuses a call

  • A key or password is refused. StackJack does not retry it. A FortiGate counts failed sign-ins per source address, locks the address out after three in 60 seconds, and doubles the lockout each time, refusing even a valid key meanwhile. Save the new credential before you test again.
  • 429 Too Many Requests. Wait a few minutes. This is not counted toward disabling the connection.
  • A FortiManager error code. FortiManager reports failure in the body even when the status is 200. The message names the code and the URL.
  • The direct method. The reserved direct FortiGate method is refused with its own message.

Plans and limits

Reads are available on the Free tier. Every write is Pro. Business reaches the same tools as Pro and differs by monthly call quota.

See the generated Fortinet tool reference for the current inventory, plan assignment, input schemas and destructive-action labels.

Fortinet FortiGate and FortiManager tools

forti_ · 7773 tools · Free 2973 · Pro 4800

This reference lists 7773 tools. It is too long for one page, so it is split by tool group into 3 pages. Every tool and every group is on exactly one of them.

Part 1: FortiGate and FortiOS

3476 tools in 87 groups.

Part 2: FortiManager

2228 tools in 34 groups.

Part 3: FortiManager and Raw

2069 tools in 45 groups.