Fortinet FortiManager InstallPackage

Fortinet FortiManager InstallPackage

Certified
Enterprise Edition

Install a policy package on managed devices

Runs /securityconsole/install/package with the auto_lock_ws flag, so FortiManager locks and unlocks the ADOM workspace around the install, then polls the task until it ends and reads one result per device.

With checkMode: true nothing is pushed to the devices. The task follows Fortinet's preview sequence: it generates the preview cache (install/package with the preview flag), asks for the install preview of each target and reads the CLI that would be sent (preview/result). The CLI of each device is stored in previewUri.

The install succeeded when the task has no error. The task fails when a device failed, unless allowPartialInstall is true. A device that is offline or out of sync is reported in results: use ListDevices to skip them beforehand. When maxWait is exceeded the error carries the task ID, so WaitForTask can pick the job up.

yaml
type: io.kestra.plugin.ee.fortinet.fortimanager.InstallPackage

Preview, then install a policy package on two devices

yaml
id: fortimanager_install_package
namespace: company.network

tasks:
  - id: preview
    type: io.kestra.plugin.ee.fortinet.fortimanager.InstallPackage
    host: fmg.example.com
    apiKey: "{{ secret('FORTIMANAGER_API_KEY') }}"
    adom: root
    policyPackage: branch-policy
    scope:
      - device: fgt-branch-1
        vdom: root
      - device: fgt-branch-2
        vdom: root
    checkMode: true

  - id: approval
    type: io.kestra.plugin.core.flow.Pause

  - id: install
    type: io.kestra.plugin.ee.fortinet.fortimanager.InstallPackage
    host: fmg.example.com
    apiKey: "{{ secret('FORTIMANAGER_API_KEY') }}"
    adom: root
    policyPackage: branch-policy
    scope:
      - device: fgt-branch-1
        vdom: root
      - device: fgt-branch-2
        vdom: root
Installation

This Enterprise plugin requires an Enterprise image and access to the plugin registry. Install it with the following command:

kestractl plugins get io.kestra.plugin.ee:plugin-ee-fortinet --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

Properties

FortiManager host

Host name or IP address of the FortiManager management interface.

Policy package

Name of the policy package, or folder/package when it sits in a folder (see ListPackages).

Scope

Devices and VDOMs to install on, as a list of device and vdom pairs.

Definitions
devicestring

Device

Name of the managed device as shown by ListDevices.

vdomstring

VDOM

VDOM to install on. Defaults to root.

ADOM

Administrative domain to work in. Defaults to root.

Allow partial install

Do not fail the task when some devices failed: the per device results tell which ones. Defaults to false.

API key

REST API key of a FortiManager API user (FortiManager 7.2.2 and later), sent in the Authorization header and never in the URL. Use {{ secret('FORTIMANAGER_API_KEY') }}. Set either apiKey or username and password.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

CA certificate

PEM encoded CA certificate(s) used to validate the FortiManager certificate. When empty, the JVM trust store is used.

Check mode

Generate and return the install preview without pushing anything to the devices. Defaults to false.

Connect timeout

Maximum time to open the connection. Must be greater than zero. Defaults to 10 seconds.

Skip TLS verification

Disables certificate and host name validation. Only for labs with self-signed certificates. Defaults to false.

Maximum wait

Give up waiting for one FortiManager task after this long. Must be greater than zero. Defaults to 30 minutes.

Password

Administrator password. Use {{ secret('FORTIMANAGER_PASSWORD') }}. Never logged nor returned in outputs.

Poll interval

Time between two reads of the install task, at least 100 milliseconds. Defaults to 5 seconds.

FortiManager port

HTTPS port. Defaults to 443.

Request timeout

Maximum time to wait for one answer. Must be greater than zero. Defaults to 60 seconds. Long jobs are polled by task ID instead.

Username

Administrator name, used with password when no apiKey is set. The plugin logs in once per task run and always logs out at the end. Accounts with multi-factor authentication cannot log in this way: use an apiKey.

Formaturi

Preview URI

Internal storage URI of an Ion file with one row per device (device, vdom, cli). Only set in check mode.

Results

One entry per device, usable by a ForEach (Kestra 1.3) or a Loop (Kestra 2.0). Not set in check mode.

Definitions
devicestring

Device

Device name.

messagestring

Message

Detail given by FortiManager for this device.

statusstring

Status

success or failed.

vdomstring

VDOM

VDOM of the install target, when the device was given only once in scope.

Task ID

FortiManager task of the install (or of the preview generation in check mode).