Automation
Automation stitches pair a trigger with one or more response actions to allow FortiWeb to automatically respond with the action(s) once the trigger condition is met.
From the Security Fabric > Automation page, you can create an automation stitch by selecting a Trigger event type and the corresponding Action that you would like to automate.
FortiWeb supports three event types and one response actions for automation.
-
Triggers: Reboot, Low memory, HA, Event log
-
Actions: CLI Script.
To create an automation using stitches, you need to follow these steps:
- Create a Trigger: Define the event that will initiate the automation. See Creating a trigger.
- Set up an Action Resource: Specify the action you want the system to perform when the trigger is activated. This could be sending an email or running a CLI script. See Creating an action.
- Create an Action: Combine the previously defined action resource with additional details, if necessary, to fully describe what the automation should do when triggered. See Creating an action.
- Stitch Everything Together: Integrate the trigger and action you've created into a stitch. This step effectively binds the trigger event with the specified action. See Creating a stitch.
Creating a trigger
Certain events can trigger the system to take corresponding actions. You can define the trigger events or use the pre-defined triggers including low memory, HA failover, and reboot.
- Go to Security Fabric > Automation.
- Select the Trigger tab.
- Click Create New to display the configuration editor.
- Select the trigger type. FortiWeb supports four types of triggers:
- System: Reboot, Low memory, HA.
Miscellaneous: FortiWeb Event log.
System Reboot The system reboots. Low memory Available memory is less than 100 MB. HA HA fail-over occurs. Miscellaneous FortiWeb Event Log The system prints certain even logs. - If you have selected one of the system triggers, enter a name and description for the trigger.
- If you have selected FortiWeb Event Log, enter a name and description for the trigger. Then configure the following options to define the event log.
- Click the Add icon beside the Event field, then select the type of the event log.
- Click the Add icon beside the Field filters, then enter the field name and value to narrow down to specific event logs.
The available field names are Action, Date/Time, Level, Message, User Interface, Log ID, MSG ID, Status, Sub Type, and User.
To find the appropriate values for the specified field, you can try add a filter in Log&Report > Log Access > Event with the desired log field name and then check its values.
- Click OK.
Creating an action
- Go to Security Fabric > Automation.
- Select the Action resources tab.
- Click Create New under either Email or CLI Script.
- Enter a name for the action resource.
- Enter the subject of the email to be sent.
- Enter the email body. Simple string and two parameters are supported:
- %%log%%: All fields from the log event triggering this stitch.
- %%results%%:The complete result from previous action, such as CLI script.
- Select the email policy. For more information, see "Configuring email settings" in Alert email.
- Click OK.
- Enter a name for the action resource.
- Enter the CLI scripts to be run. You can enter multiple CLI commands.
- Click OK.
- Select the Action tab.
- Click Create New.
- Enter a name for the action.
- Enter a description for the action.
- Select the type of actions resource you want to add in this action.
- Select the action resource you have created in the tabAction Resources.
- Click OK.
For the Email action, perform the following steps:
For the CLI Script action, perform the following steps:
Creating a stitch
Integrate the trigger and action you've created into a stitch.
- Go to Security Fabric > Automation.
- Select the Stitch tab.
- Click Create New.
- Enter a name for the stitch.
- Select whether to enable or disable this stitch.
- Enter a description for the stitch.
- Click Add Trigger, select the trigger you have created in the Trigger tab, or the pre-defined triggers, then click Apply.
- Click Add Action, select the action to take when the trigger event occurs, then click Apply. You can add multiple actions for a stitch.
- Click OK.