Prerequisites
- A FortiGate whose HTTPS management interface CloudThinker can reach from the internet. Limit that access to CloudThinker’s egress IPs, with Trusted Hosts on the API administrator (step 2) and a firewall rule or local-in policy in front of the interface. This connection runs from CloudThinker Cloud, so there’s no private-network option. See Reaching private services.
- A FortiGate administrator with the super_admin profile. Only that profile can create a REST API administrator.
- Edit permission on connections in your CloudThinker workspace.
Setup
1
Create an administrator profile
In FortiGate, go to System → Admin Profiles and click Create New. Name it
cloudthinker and set every permission to Read.Set Read/Write only on the areas you want agents to change, such as Firewall. See Required permissions.2
Create a REST API administrator
Go to System → Administrators and click Create New → REST API Admin. Fill in:
- Username:
cloudthinker - Administrator Profile: the
cloudthinkerprofile - PKI Group: leave empty
- Trusted Hosts: recommended. Add CloudThinker’s egress IP addresses so the token works from nowhere else. These docs don’t publish CloudThinker’s egress IP list: ask your CloudThinker contact, or contact us.
3
Add the connection in CloudThinker
In the sidebar, click More → Workspace settings → Connections. On the Builtin Connections tab, search for FortiGate and click Connect. Fill in the fields from Connection details and click Connect.FORTIGATE_VERIFY_SSL starts on Skip SSL verification, so TLS isn’t checked unless you change it. If the FortiGate already has a CA-signed certificate, pick Verify SSL certificate now. Otherwise, switch to it once you install one.CloudThinker tests the token by reading the FortiGate’s system status.Success state: the test message reads
FortiGate connection verified and the connection shows Connected.Connection details
Agents only see the VDOM you enter. To cover several VDOMs, add one connection per VDOM. On a FortiGate without VDOMs, leave
root.
Required permissions
The token has exactly the permissions of its administrator profile.Agent capabilities
Reads run without asking. Every configuration change is a write: the agent states the exact object and change, and each object goes through your Approvals on its own. Agents can only write configuration objects, never run commands on the device.
Writes also need Allow writes on, which starts on. To lock writes in CloudThinker, open FortiGate in More → Workspace settings → Connections and turn off the Allow writes switch on its detail panel.
Every change an agent makes goes through your workspace’s Approvals first. On the default Auto · Rules + AI · Ask me mode, AI judgment can let a safe change run without asking — and an Allow Rule can too, once CloudThinker turns on Rule enforcement for your workspace. Choose Manual to approve every change yourself.
For a production firewall, choose Manual so every change reaches a person. Once CloudThinker turns on Rule enforcement for your workspace, an Ask first Rule can cover this connection on its own.
Before you approve writes:
- Back up the configuration. Save a FortiGate configuration backup first, so you can restore it if a change goes wrong.
- Keep the earlier values. Ask the agent to read the object before it changes it. To undo, ask it to set those values back.
- Check for FortiManager. If FortiManager manages this FortiGate, make changes there instead. Local changes can be overwritten on FortiManager’s next install.
Verify the connection
wan1. A 401 error means the token was rejected: see Troubleshooting.
Example prompts
Troubleshooting
The test fails with "returned error: 401"
The test fails with "returned error: 401"
The token was rejected. Check that you copied the whole token, that PKI Group is empty on the REST API administrator, and that Trusted Hosts (if set) includes CloudThinker’s addresses. FortiGate’s system event log records the failed login and its source IP, so you can compare it with the Trusted Hosts list.
The test fails with "Failed to connect" or "Could not resolve host"
The test fails with "Failed to connect" or "Could not resolve host"
CloudThinker couldn’t reach the FortiGate. Check FORTIGATE_HOST and FORTIGATE_PORT, and that the management interface accepts HTTPS from CloudThinker.
SSL certificate problem
SSL certificate problem
The FortiGate’s certificate isn’t trusted. Install a CA-signed certificate on the FortiGate. To test before then, set FORTIGATE_VERIFY_SSL to Skip SSL verification, and switch to Verify SSL certificate once the certificate is in place.
Invalid FortiGate connection configuration
Invalid FortiGate connection configuration
FORTIGATE_HOST or FORTIGATE_API_TOKEN is empty. Fill in both and connect again.
Connected, but objects are missing
Connected, but objects are missing
Agents only see the VDOM in FORTIGATE_VDOM. Set it to the VDOM that holds the objects, or add a second connection for that VDOM.
A configuration change fails with HTTP 403
A configuration change fails with HTTP 403
The administrator profile doesn’t allow that change. Give the profile Read/Write on that area, or make the change in FortiGate yourself.
Security
- Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
- Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
- Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
- Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
- Restrict trusted hosts. Limit the REST API administrator to CloudThinker’s egress addresses so a leaked token is useless elsewhere.
- Verify the certificate. Skip SSL verification is the default, but treat it as a test setting. Use Verify SSL certificate once the FortiGate has a trusted certificate.
- Token stays redacted. CloudThinker injects the token at run time and redacts it from command output, so it doesn’t appear in chat.
Related
Approvals
Decide which changes run, wait for a person, or are refused
Wazuh Connection
Security alerts and agent health from your Wazuh SIEM