Fortinet white logo
Fortinet white logo

Administration Guide

Google Cloud Function action

Google Cloud Function action

Google Cloud functions can be called when an automation stitch is triggered.

To configure a Google Cloud function automation stitch in the GUI:
  1. Go to Security Fabric > Automation.
  2. Click Create New.
  3. Enter a name for the stitch, and select the FortiGate devices that it will be applied to.
  4. Select a trigger, such as Security Rating Summary.
  5. Select Google Cloud Function and configure its settings.

    Name

    The action name.

    Delay

    The amount of time after the previous action before this action executes, in seconds (0 - 3600, default = 0).

    API gateway

    The API gateway URL, in the format:

    {region}-{project}{domain}/{function}

    The CLI must be used to manually enter the individual parameters.

    HTTP header

    The HTTP request header name and value. Multiple headers can be added.

    +

    Click to add another action.

    Actions can be reorganized as needed by dragging and dropping.

  6. Click OK.
To configure a Google Cloud function automation stitch in the CLI:
  1. Create an automation action:
    config system automation-action
        edit "google-echo"
            set action-type google-cloud-function
            set gcp-function-region "us-central1"
            set gcp-project "xxx-xxxxxxx-000-000000"
            set gcp-function-domain "cloudfunctions.net"
            set gcp-function "xxxx-echo"
            set headers "echo-header:echo-value"
        next
    end
  2. Create an automation trigger:
    config system automation-trigger
        edit "auto-google1"
            set event-type security-rating-summary
        next
    end
  3. Create the automation stitch:
    config system automation-stitch
        edit "auto-google1"
            set trigger "auto-google1"
            set action "google-echo"
        next
    end

When the automation stitch is triggered, the FortiGate shows the stitch trigger time:

In Google Cloud, go to Logs to see the function log showing that the configured function was called, executed, and finished:

Google Cloud Function action

Google Cloud Function action

Google Cloud functions can be called when an automation stitch is triggered.

To configure a Google Cloud function automation stitch in the GUI:
  1. Go to Security Fabric > Automation.
  2. Click Create New.
  3. Enter a name for the stitch, and select the FortiGate devices that it will be applied to.
  4. Select a trigger, such as Security Rating Summary.
  5. Select Google Cloud Function and configure its settings.

    Name

    The action name.

    Delay

    The amount of time after the previous action before this action executes, in seconds (0 - 3600, default = 0).

    API gateway

    The API gateway URL, in the format:

    {region}-{project}{domain}/{function}

    The CLI must be used to manually enter the individual parameters.

    HTTP header

    The HTTP request header name and value. Multiple headers can be added.

    +

    Click to add another action.

    Actions can be reorganized as needed by dragging and dropping.

  6. Click OK.
To configure a Google Cloud function automation stitch in the CLI:
  1. Create an automation action:
    config system automation-action
        edit "google-echo"
            set action-type google-cloud-function
            set gcp-function-region "us-central1"
            set gcp-project "xxx-xxxxxxx-000-000000"
            set gcp-function-domain "cloudfunctions.net"
            set gcp-function "xxxx-echo"
            set headers "echo-header:echo-value"
        next
    end
  2. Create an automation trigger:
    config system automation-trigger
        edit "auto-google1"
            set event-type security-rating-summary
        next
    end
  3. Create the automation stitch:
    config system automation-stitch
        edit "auto-google1"
            set trigger "auto-google1"
            set action "google-echo"
        next
    end

When the automation stitch is triggered, the FortiGate shows the stitch trigger time:

In Google Cloud, go to Logs to see the function log showing that the configured function was called, executed, and finished: