Skip to main content
Skip table of contents

FortiGate

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:

D3 SOAR

V12.7.83.0+

Category

Network Security

Deployment Options

Option II, Option IV

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)

  1. Go to System > Admin Profiles and click + Create New to create a profile for API users.

  2. 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

  1. Go to System > Administrators, click + Create New and select Rest API Admin from the dropdown menu.

  2. Fill in the Username and select the Administrator Profile (you can find the profile you just created here). Click OK to save the changes.

  3. 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.

  4. 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

  1. Log in to D3 SOAR.

  2. Find the FortiGate integration.

    1. Navigate to Configuration on the top header menu.

    2. Click on the Integration icon on the left sidebar.

    3. Type FortiGate in the search box to find the integration, then click it to select it.

    4. Click + Connection, on the right side of the Connections section. A new connection window will appear.

  3. Configure the following fields to create a connection to FortiGate.

    1. Connection Name: The desired name for the connection.

    2. 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.

    3. 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.

    4. 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.

    5. Description (Optional): Add your desired description for the connection.

    6. Configure User Permissions: Defines which users have access to the connection.

    7. Active: Check the tick box to ensure the connection is available for use.

    8. 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.

    9. 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.

    10. 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.

  4. Test the connection.

    1. 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.

    2. Click OK to close the alert window.

    3. 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

Raw Data

The primary response data from the API request.

SAMPLE DATA

JSON
{
    "http_method": "PUT",
    "revision": "***",
    "revision_changed": true,
    "old_revision": "***",
    "mkey": "***",
    "status": "success",
    "http_status": 200,
    "vdom": "root",
    "path": "firewall",
    "name": "***",
    "serial": "***",
    "version": "v6.4.0",
    "build": 1579
}
Context Data

The data extracted from Raw Data converted into JSON format. Context Data may be identical to Raw Data in some cases.

D3 modifies the context data by including additional fields including "name" and "q_origin_key".

It is recommended to refer to the Raw Data instead of Context Data, since it contains the complete API response data. D3 will deprecate Context Data in the future, and playbook tasks using Context Data will be replaced with Raw Data.

SAMPLE DATA

CODE
[
    {
        "name": "BlockIP_3.3.3.3/14",
        "q_origin_key": "BlockIP_3.3.3.3/14"
    },
    {
        "name": "BlockIP_1.5.5.9/18",
        "q_origin_key": "BlockIP_1.5.5.9/18"
    },
    {
        "name": "Block_5.5.5.5/10",
        "q_origin_key": "Block_5.5.5.5/10"
    },
    {
        "name": "Block_6.6.6.6/24",
        "q_origin_key": "Block_6.6.6.6/24"
    }
]
Key Fields

Common cyber security indicators such as unique IDs, file hash values, CVE numbers, IP addresses, etc., will be extracted from Raw Data as Key Fields.
The system stores these key fields in the path $.[playbookTask].outputData. You can use these key-value pairs as data points for playbook task inputs.

SAMPLE DATA

CODE
{
    "AddressNames": "\"[\\r\\n \\r\\n  \\\"BlockIP_3.3.3.3/14\\\",\\r\\n \\r\\n  \\\"BlockIP_1.5.5.9/18\\\",\\r\\n \\r\\n  \\\"Block_5.5.5.5/10\\\",\\r\\n \\r\\n  \\\"Block_6.6.6.6/24\\\"\\r\\n \\r\\n ]\""
}
Return Data

Indicates one of the possible command execution states: Successful, Partially Successful, or Failed.

The Partially Successful state only occurs when a command’s input accepts an array of items (e.g. an array of IP addresses) and one or more items within the array return an error from the API request.

The Failed state can be triggered by any of the following errors:

  • A connection issue with the integration

  • The API returned an error message

  • No response from the API

You can view more details about an error in the Error tab.

Return Data can be passed down directly to a subsequent command or used to create conditional tasks in playbooks.

SAMPLE DATA

CODE
Successful
Result

Provides a brief summary of outputs in an HTML formatted table.

SAMPLE DATA

NAME

Q_ORIGIN_KEY

BlockIP_3.3.3.3/14

BlockIP_3.3.3.3/14

BlockIP_1.5.5.9/18

BlockIP_1.5.5.9/18

Block_5.5.5.5/10

Block_5.5.5.5/10

Block_6.6.6.6/24

Block_6.6.6.6/24

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

Raw Data

The primary response data from the API request.

SAMPLE DATA

JSON
{
    "http_method": "PUT",
    "revision": "b1***d",
    "revision_changed": true,
    "old_revision": "7***5",
    "mkey": "BlockURLGroup",
    "status": "success",
    "http_status": 200,
    "vdom": "root",
    "path": "firewall",
    "name": "addrgrp",
    "serial": "FO***7",
    "version": "v6.4.0",
    "build": 1579
}
Context Data

The data extracted from Raw Data converted into JSON format. Context Data may be identical to Raw Data in some cases.

D3 modifies the context data by including additional fields including "name" and "q_origin_key".

It is recommended to refer to the Raw Data instead of Context Data, since it contains the complete API response data. D3 will deprecate Context Data in the future, and playbook tasks using Context Data will be replaced with Raw Data.

SAMPLE DATA

CODE
[
    {
        "name": "Block_1.1.1.1",
        "q_origin_key": "Block_1.1.1.1"
    },
    {
        "name": "B5.5.5.5",
        "q_origin_key": "B5.5.5.5"
    },
    {
        "name": "BlockURL_www.4.com",
        "q_origin_key": "BlockURL_www.4.com"
    },
    {
        "name": "BlockURL_www.5.com",
        "q_origin_key": "BlockURL_www.5.com"
    },
    {
        "name": "Block_www.1.com",
        "q_origin_key": "Block_www.1.com"
    },
    {
        "name": "Block_www.2.com",
        "q_origin_key": "Block_www.2.com"
    }
]
Key Fields

Common cyber security indicators such as unique IDs, file hash values, CVE numbers, IP addresses, etc., will be extracted from Raw Data as Key Fields.
The system stores these key fields in the path $.[playbookTask].outputData. You can use these key-value pairs as data points for playbook task inputs.

SAMPLE DATA

CODE
{
    "AddressNames": "\"[\\r\\n \\r\\n  \\\"Block_1.1.1.1\\\",\\r\\n \\r\\n  \\\"B5.5.5.5\\\",\\r\\n \\r\\n  \\\"BlockURL_www.4.com\\\",\\r\\n \\r\\n  \\\"BlockURL_www.5.com\\\",\\r\\n \\r\\n  \\\"Block_www.1.com\\\",\\r\\n \\r\\n  \\\"Block_www.2.com\\\"\\r\\n \\r\\n ]\""
}
Return Data

Indicates one of the possible command execution states: Successful, Partially Successful, or Failed.

The Partially Successful state only occurs when a command’s input accepts an array of items (e.g. an array of IP addresses) and one or more items within the array return an error from the API request.

The Failed state can be triggered by any of the following errors:

  • A connection issue with the integration

  • The API returned an error message

  • No response from the API

You can view more details about an error in the Error tab.

Return Data can be passed down directly to a subsequent command or used to create conditional tasks in playbooks.

SAMPLE DATA

CODE
Successful
Result

Provides a brief summary of outputs in an HTML formatted table.

SAMPLE DATA

NAME

Q_ORIGIN_KEY

Block_1.1.1.1

Block_1.1.1.1

B5.5.5.5

B5.5.5.5

BlockURL_www.4.com

BlockURL_www.4.com

BlockURL_www.5.com

BlockURL_www.5.com

Block_www.1.com

Block_www.1.com

Block_www.2.com

Block_www.2.com

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

Raw Data

The primary response data from the API request.

SAMPLE DATA

JSON
{
    "http_method": "PUT",
    "revision": "9***2",
    "revision_changed": true,
    "old_revision": "b***d",
    "mkey": "Block_Group",
    "status": "success",
    "http_status": 200,
    "vdom": "root",
    "path": "firewall",
    "name": "***",
    "serial": "FO***7",
    "version": "v6.4.0",
    "build": 1579
}
Context Data

The data extracted from Raw Data converted into JSON format. Context Data may be identical to Raw Data in some cases.

D3 modifies the context data by including additional fields including "name" and "q_origin_key".

It is recommended to refer to the Raw Data instead of Context Data, since it contains the complete API response data. D3 will deprecate Context Data in the future, and playbook tasks using Context Data will be replaced with Raw Data.

SAMPLE DATA

CODE
[
    {
        "name": "BlockIP_3.3.3.3/14",
        "q_origin_key": "BlockIP_3.3.3.3/14"
    },
    {
        "name": "BlockIP_1.5.5.9/18",
        "q_origin_key": "BlockIP_1.5.5.9/18"
    }
]
Key Fields

Common cyber security indicators such as unique IDs, file hash values, CVE numbers, IP addresses, etc., will be extracted from Raw Data as Key Fields.
The system stores these key fields in the path $.[playbookTask].outputData. You can use these key-value pairs as data points for playbook task inputs.

SAMPLE DATA

CODE
{
    "AddressNames": "\"[\\r\\n \\r\\n  \\\"BlockIP_3.3.3.3/14\\\",\\r\\n \\r\\n  \\\"BlockIP_1.5.5.9/18\\\"\\r\\n \\r\\n ]\""
}
Return Data

Indicates one of the possible command execution states: Successful, Partially Successful, or Failed.

The Partially Successful state only occurs when a command’s input accepts an array of items (e.g. an array of IP addresses) and one or more items within the array return an error from the API request.

The Failed state can be triggered by any of the following errors:

  • A connection issue with the integration

  • The API returned an error message

  • No response from the API

You can view more details about an error in the Error tab.

Return Data can be passed down directly to a subsequent command or used to create conditional tasks in playbooks.

SAMPLE DATA

CODE
Successful
Result

Provides a brief summary of outputs in an HTML formatted table.

SAMPLE DATA

NAME

Q_ORIGIN_KEY

BlockIP_3.3.3.3/14

BlockIP_3.3.3.3/14

BlockIP_1.5.5.9/18

BlockIP_1.5.5.9/18

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

Raw Data

The primary response data from the API request.

SAMPLE DATA

JSON
{
    "http_method": "PUT",
    "revision": "***",
    "revision_changed": true,
    "old_revision": "***",
    "mkey": "***",
    "status": "success",
    "http_status": 200,
    "vdom": "root",
    "path": "firewall",
    "name": "***",
    "serial": "***",
    "version": "v6.4.0",
    "build": 1579
}
Context Data

The data extracted from Raw Data converted into JSON format. Context Data may be identical to Raw Data in some cases.

D3 modifies the context data by including additional fields including "name" and "q_origin_key".

It is recommended to refer to the Raw Data instead of Context Data, since it contains the complete API response data. D3 will deprecate Context Data in the future, and playbook tasks using Context Data will be replaced with Raw Data.

SAMPLE DATA

CODE
[
    {
        "name": "Block_1.1.1.1",
        "q_origin_key": "Block_1.1.1.1"
    },
    {
        "name": "B5.5.5.5",
        "q_origin_key": "B5.5.5.5"
    },
    {
        "name": "BlockURL_www.4.com",
        "q_origin_key": "BlockURL_www.4.com"
    },
    {
        "name": "BlockURL_www.5.com",
        "q_origin_key": "BlockURL_www.5.com"
    }
]
Key Fields

Common cyber security indicators such as unique IDs, file hash values, CVE numbers, IP addresses, etc., will be extracted from Raw Data as Key Fields.
The system stores these key fields in the path $.[playbookTask].outputData. You can use these key-value pairs as data points for playbook task inputs.

SAMPLE DATA

CODE
{
    "AddressNames": "\"[\\r\\n \\r\\n  \\\"Block_1.1.1.1\\\",\\r\\n \\r\\n  \\\"B5.5.5.5\\\",\\r\\n \\r\\n  \\\"BlockURL_www.4.com\\\",\\r\\n \\r\\n  \\\"BlockURL_www.5.com\\\"\\r\\n \\r\\n ]\""
}
Return Data

Indicates one of the possible command execution states: Successful, Partially Successful, or Failed.

The Partially Successful state only occurs when a command’s input accepts an array of items (e.g. an array of IP addresses) and one or more items within the array return an error from the API request.

The Failed state can be triggered by any of the following errors:

  • A connection issue with the integration

  • The API returned an error message

  • No response from the API

You can view more details about an error in the Error tab.

Return Data can be passed down directly to a subsequent command or used to create conditional tasks in playbooks.

SAMPLE DATA

CODE
Successful
Result

Provides a brief summary of outputs in an HTML formatted table.

SAMPLE DATA

NAME

Q_ORIGIN_KEY

Block_1.1.1.1

Block_1.1.1.1

B5.5.5.5

B5.5.5.5

BlockURL_www.4.com

BlockURL_www.4.com

BlockURL_www.5.com

BlockURL_www.5.com

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.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.