FortiGate
LAST UPDATED: OCT 30, 2024
Overview
FortiGate Next-Generation Firewall (NGFW) filters network traffic such as packet filtering, VPN support, network monitoring, and more.
D3 SOAR is providing REST operations to function with FortiGate.
FortiGate is available for use in:
Connection
To connect to FortiGate from D3 SOAR, please follow this part to collect the required information below:
Parameter | Description | Example |
Server URL | The server URL of your FortiGate firewall instance. | https://xxx.xxx.x.xxx |
API Token | The API token to authenticate the connection. | 10***********************fQfs |
API Version | The API version to use for the connection. | v2 |
Permission Requirements
The FortiGate API requires the Restful Admin Role to function. All commands for this integration require the Restful Admin Role with Read/Write permissions enabled for Firewall.
Configuring FortiGate to Work with D3 SOAR
Log in to the FortiGate console with your credentials.
Creating Admin Profiles (roles)
Go to System > Admin Profiles and click + Create New to create a profile for API users.
Provide a name for your Admin Profile. Under Access Permissions, select the desired access permissions. In the case of integrating with D3 SOAR, you will need CRUD (Create, Read, Update, and Delete) permissions to modify the firewall. Select Read/Write for Firewall (refer to Permission Requirements). Click OK to save the changes.
Creating Rest API Admins to get API Keys/tokens
Go to System > Administrators, click + Create New and select Rest API Admin from the dropdown menu.
Fill in the Username and select the Administrator Profile (you can find the profile you just created here). Click OK to save the changes.
The generated API key for the user will be displayed in the New API key window. This is the only time you will see this API key. Copy the API key and store it in a secure location for future use.
If you forget the API key, the only option is to click Regenerate to create a new key. However, regenerating the API key will immediately revoke access for connections to the API using the current key.
Configuring D3 SOAR to Work with FortiGate
Log in to D3 SOAR.
Find the FortiGate integration.
Navigate to Configuration on the top header menu.
Click on the Integration icon on the left sidebar.
Type FortiGate in the search box to find the integration, then click it to select it.
Click + Connection, on the right side of the Connections section. A new connection window will appear.
Configure the following fields to create a connection to FortiGate.
Connection Name: The desired name for the connection.
Site: Specifies the site to use the integration connection. Use the drop-down menu to select the site. The Share to Internal Sites option enables all sites defined as internal sites to use the connection. Selecting a specific site will only enable that site to use the connection.
Recipient site for events from connections Shared to Internal Sites: This field appears if you selected Share to Internal Sites for Site to let you select the internal site to deploy the integration connection.
Agent Name (Optional): Specifies the proxy agent required to build the connection. Use the dropdown menu to select the proxy agent from a list of previously configured proxy agents.
Description (Optional): Add your desired description for the connection.
Tenant (Optional): When configuring the connection from a master tenant site, you have the option to choose the specific tenant sites you want to share the connection with. Once you enable this setting, you can filter and select the desired tenant sites from the dropdowns to share the connection.
Configure User Permissions: Defines which users have access to the connection.
Active: Check the tick box to ensure the connection is available for use.
System: This section contains the parameters defined specifically for the integration. These parameters must be configured to create the integration connection.
1. Input your domain level Server URL.
2. Input your API Token. Please check Creating Administators to get API Keys/tokens for how to generate API Keys, the API Keys are the API Token used in this parameter.
3. Input your API Version. The Default value is v2.Connection Health Check: Updates the connection status you have created. A connection health check is done by scheduling the Test Connection command of this integration. This can only be done when the connection is active.
To set up a connection health check, check the Connection Health Check tickbox. You can customize the interval (minutes) for scheduling the health check. An email notification can be set up after a specified number of failed connection attempts.Enable Password Vault: An optional feature that allows users to take the stored credentials from their own password vault. Please refer to the password vault connection guide if needed.
Test the connection.
Click Test Connection to verify the account credentials and network connection. If the Test Connection Passed alert window appears, the test connection is successful. You will see Passed with a green checkmark appear beside the Test Connection button. If the test connection fails, please check your connection parameters and try again.
Click OK to close the alert window.
Click + Add to create and add the configured connection.
Commands
FortiGate includes the following executable commands for users to set up schedules or create playbook workflows. With the Test Command, you can execute these commands independently for playbook troubleshooting.
Integration API Note
For more information about the FortiGate API, please refer to the FortiGate API reference.
READER NOTE
Certain permissions are required for each command. Please refer to the Permission Requirements and Configuring FortiGate to Work with D3 SOAR for details.
Add IPs To Address Group
Adds IP addresses to an address group.
Input
Input Parameter | Required/Optional | Description | Example |
IPs | Required | The list of IP addresses to add to the Address Group. | ["5.5.5.5/10","6.6.6.6/24"] |
Address Group Name | Required | The name of the Address Group to add the IPs to. | Block_Group |
Output
Error Handling
If the Return Data is Partially Successful, an Error tab will appear in the Test Result window.
The error tab contains the details responded from D3 SOAR or third-party API calls, including Failure Indicator, Status Code, and Message. This can help you locate the root cause of a command failure.
Parts in Error | Description | Example |
Failure Indicator | Indicates the command failure that happened at a specific input and/or API call. | Add IPs To Address Group failed. |
Status Code | The response code issued by the third-party API server or the D3 SOAR system that can be used to locate the corresponding error category. For example, if the returned status code is 401, the selected connection is unauthorized to run the command. The user or system support would need to check the permission setting in the FortiGate portal. Refer to the HTTP Status Code Registry for details. | Status Code: 404. |
Message | The raw data or captured key error message from the integration API server about the API request failure. | Message: Address group name Not Found. |
Error Sample Data Add IPs To Address Group failed. Status Code: 404. Message: Address group name Not Found. |
Add URLs To Address Group
Adds URLs to an address group.
Input
Input Parameter | Required/Optional | Description | Example |
URLs | Required | The list of URLs to add to the Address Group. | ["www.1.com","www.2.com"] |
Address Group Name | Required | The name of the Address Group to add the URLs to. | BlockURLGroup |
Output
Error Handling
If the Return Data is Partially Successful or Failed, an Error tab will appear in the Test Result window.
The error tab contains the details responded from D3 SOAR or third-party API calls, including Failure Indicator, Status Code, and Message. This can help you locate the root cause of a command failure.
Parts in Error | Description | Example |
Failure Indicator | Indicates the command failure that happened at a specific input and/or API call. | Add URLs To Address Group failed. |
Status Code | The response code issued by the third-party API server or the D3 SOAR system that can be used to locate the corresponding error category. For example, if the returned status code is 401, the selected connection is unauthorized to run the command. The user or system support would need to check the permission setting in the FortiGate portal. Refer to the HTTP Status Code Registry for details. | Status Code: 404. |
Message | The raw data or captured key error message from the integration API server about the API request failure. | Message: Address group name Not Found. |
Error Sample Data Add URLs To Address Group failed. Status Code: 404. Message: Address group name Not Found. |
Remove IPs From Address Group
Removes IP addresses from the specified address group.
Input
Input Parameter | Required/Optional | Description | Example |
IPs | Required | The list of IP addresses to remove from the Address Group. | ["5.5.5.5/10","6.6.6.6/24"] |
Address Group Name | Required | The name of the Address Group to remove the IPs from. | Block_Group |
Output
Error Handling
If the Return Data is Partially Successful or Failed, an Error tab will appear in the Test Result window.
The error tab contains the details responded from D3 SOAR or third-party API calls, including Failure Indicator, Status Code, and Message. This can help you locate the root cause of a command failure.
Parts in Error | Description | Example |
Failure Indicator | Indicates the command failure that happened at a specific input and/or API call. | Remove IPs From Address Group failed. |
Status Code | The response code issued by the third-party API server or the D3 SOAR system that can be used to locate the corresponding error category. For example, if the returned status code is 401, the selected connection is unauthorized to run the command. The user or system support would need to check the permission setting in the FortiGate portal. Refer to the HTTP Status Code Registry for details. | Status Code: 404. |
Message | The raw data or captured key error message from the integration API server about the API request failure. | Message: Address group name Not Found. |
Error Sample Data Remove IPs From Address Group failed. Status Code: 404. Message: Address group name Not Found. |
Remove URLs From Address Group
Removes URLs from the specified address group.
Input
Input Parameter | Required/Optional | Description | Example |
URLs | Required | The list of URLs to remove from the Address Group. | ["www.1.com","www.2.com"] |
Address Group Name | Required | The name of the Address Group to remove the URLs from. | BlockURLGroup |
Output
Error Handling
If the Return Data is Partially Successful or Failed, an Error tab will appear in the Test Result window.
The error tab contains the details responded from D3 SOAR or third-party API calls, including Failure Indicator, Status Code, and Message. This can help you locate the root cause of a command failure.
Parts in Error | Description | Example |
Failure Indicator | Indicates the command failure that happened at a specific input and/or API call. | Remove URLs From Address Group failed. |
Status Code | The response code issued by the third-party API server or the D3 SOAR system that can be used to locate the corresponding error category. For example, if the returned status code is 401, the selected connection is unauthorized to run the command. The user or system support would need to check the permission setting in the FortiGate portal. Refer to the HTTP Status Code Registry for details. | Status Code: 404. |
Message | The raw data or captured key error message from the integration API server about the API request failure. | Message: Address group name Not Found. |
Error Sample Data Remove URLs From Address Group failed. Status Code: 404. Message: Address group name Not Found. |