Fortinet Document Library

Version:


Table of Contents

Cookbook

6.2.0
Download PDF
Copy Link

AliCloud Function action

AliCloud functions can be called when an automation stitch is triggered.

To configure an AliCloud 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 AliCloud 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).

    HTTP URL

    The HTTP URL, in the format:

    {account id}.{region}.{domain}/{version}/proxy/{service}/{function}

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

    Authorization

    The authorization level: Anonymous, or Function.

    AccessKey ID

    The access key ID

    This options is only available when Authorization is Function.

    AccessKey Secret

    The access key secret.

    This options is only available when Authorization is Function.

    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 an AliCloud function automation stitch in the CLI:
  1. Create an automation action:
    config system automation-action
        edit "Ali-Action-1"
            set action-type alicloud-function
            set alicloud-account-id "5594200612296301"
            set alicloud-region "us-east-1"
            set alicloud-version "2016-08-15"
            set alicloud-service "jlum-test-function"
            set alicloud-function "echoBodyAuth"
            set alicloud-function-authorization function
            set alicloud-access-key-id "LTAIKmERWEuEOChg"
            set alicloud-access-key-secret xxxxxx
        next
    end
  2. Create an automation trigger:
    config system automation-trigger
        edit "auto-ali"
            set event-type security-rating-summary
        next
    end
  3. Create the automation stitch:
    config system automation-stitch
        edit "auto-ali"
            set trigger "auto-ali"
            set action "Ali-Action-1"
        next
    end

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

In AliCloud, the function log shows that the function was called, executed, and finished:

AliCloud Function action

AliCloud functions can be called when an automation stitch is triggered.

To configure an AliCloud 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 AliCloud 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).

    HTTP URL

    The HTTP URL, in the format:

    {account id}.{region}.{domain}/{version}/proxy/{service}/{function}

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

    Authorization

    The authorization level: Anonymous, or Function.

    AccessKey ID

    The access key ID

    This options is only available when Authorization is Function.

    AccessKey Secret

    The access key secret.

    This options is only available when Authorization is Function.

    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 an AliCloud function automation stitch in the CLI:
  1. Create an automation action:
    config system automation-action
        edit "Ali-Action-1"
            set action-type alicloud-function
            set alicloud-account-id "5594200612296301"
            set alicloud-region "us-east-1"
            set alicloud-version "2016-08-15"
            set alicloud-service "jlum-test-function"
            set alicloud-function "echoBodyAuth"
            set alicloud-function-authorization function
            set alicloud-access-key-id "LTAIKmERWEuEOChg"
            set alicloud-access-key-secret xxxxxx
        next
    end
  2. Create an automation trigger:
    config system automation-trigger
        edit "auto-ali"
            set event-type security-rating-summary
        next
    end
  3. Create the automation stitch:
    config system automation-stitch
        edit "auto-ali"
            set trigger "auto-ali"
            set action "Ali-Action-1"
        next
    end

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

In AliCloud, the function log shows that the function was called, executed, and finished: