Fortinet black logo

CICD Utils v1.1.0

1.1.0
Copy Link
Copy Doc ID 84612528-e508-11ee-8c42-fa163e15d75b:809

About the connector

CICD Utils provides out-of-the-box actions for the Continuous Delivery solution pack.

This document provides information about the CICD Utils Connector, which facilitates automated interactions, with a CICD Utils server using FortiSOAR™ playbooks. Add the CICD Utils Connector as a step in FortiSOAR™ playbooks and perform automated operations with CICD Utils.

Version information

Connector Version: 1.1.0

FortiSOAR™ Version Tested on: 7.4.3-3294

Authored By: Fortinet

Certified: Yes

Release Notes for version 1.1.0

Following enhancements have been made to the CICD Utils Connector in version 1.1.0:

  • Added following new actions:
    • Import FortiSOAR Template
    • Export FortiSOAR Template

Installing the connector

Use the Content Hub to install the connector. For the detailed procedure to install a connector, click here.

You can also use the yum command as a root user to install the connector:

yum install cyops-connector-cicd-utils

Prerequisites to configuring the connector

There are no prerequisites to configuring this connector.

Minimum Permissions Required

  • Not applicable

Configuring the connector

This connector installs with the Continuous Delivery solution pack and requires no configurations to run.

Actions supported by the connector

The following automated operations can be included in playbooks and you can also use the annotations to access operations:

Function Description Annotation and Category
Unzip Export Template Unzips the specified export template zip file. unzip_export_template
Utilities
Split Export Template Splits the export template file into following three export templates
  • Production Content
  • Production Settings
  • Development Settings
split_export_templates
Utilities
Export FortiSOAR Template Exports updated FortiSOAR Template's zip file. export_fortisoar_template
Utilities
Import FortiSOAR Template Imports FortiSOAR Template zip file in FortiSOAR import_fortisoar_template
Utilities

operation: Unzip Export Template

Input parameters

Parameter Description
Filepath Specify the export template .zip file path on the FortiSOAR™ filesystem.

Output

The output contains the following populated JSON schema:

{
    "filenames": []
}

operation: Split Export Template

Input parameters

Parameter Description
Prod Content Filepath Specify the filepath of production content's export template to create in export template record set
Prod Content JSON Specify the json of production content's export template to add in export template record set.
Prod Settings Filepath Specify the filepath of production setting's export template to create in export template record set.
Prod Settings JSON Specify the json code of production setting's export template to add in export template record set.
Dev Settings Filepath Specify the filepath of development setting's export template to create in export template record set.
Dev Settings JSON Specify the json code of development setting's export template to add in export template record set.
Unzip Export Template Filepath Specify the export template filepath under /tmp directory to extract the zip file.
Split Zip Export Template Filename Specify the split export template zip filename.

Output

The output contains the following populated JSON schema:

{
    "exportFileName": ""
}

operation: Export FortiSOAR Template

Input parameters

Parameter Description
Export Template Name Specify the export template's name to export from FortiSOAR™.
Export File Name Specify a file name for the template being exported.
Ignore Keys Specify the key's details to remove from the template files being exported. For example:
[
    {
        "file_path": "/info.json",
        "operations": [
        {
            "key_path": "contents.globalVariables",
            "key_type": "list",
            "key_to_compare": "name",
            "values_to_remove": [
            "Default_Email",
            "Server_fqhn"
            ]
        },
        {
            "key_path": "",
            "key_type": "dict",
            "keys_to_remove": [
            "exported_from",
            "date"
            ]
        }
        ]
    }
]
For more information, refer Detailing Ignore Keys Parameter section.

Output

The output contains the following populated JSON schema:

{
    "file_iri": ""
}

operation: Import FortiSOAR Template

Input parameters

Parameter Description
File Name Specify the name of file within FortiSOAR™ to import.
File Path Specify the path of the FortiSOAR Template file to be imported. For example: /tmp/github-fortisoar-prod-content-2024-01-10-12-16-24-315685.zip

Output

The output contains a non-dictionary value.

Included playbooks

The Sample - CICD Utils - 1.1.0 playbook collection comes bundled with the CICD Utils connector. These playbooks contain steps using which you can perform all supported actions. You can see bundled playbooks in the Automation > Playbooks section in FortiSOAR™ after importing the CICD Utils connector.

  • Split Export Template
  • Unzip Export Template
  • Export FortiSOAR Template
  • Import FortiSOAR Template

NOTE: If you are planning to use any of the sample playbooks in your environment, ensure that you clone those playbooks and move them to a different collection since the sample playbook collection gets deleted during connector upgrade and delete.

Detailing Ignore Keys Parameter

The Ignore Keys parameter in the action Export FortiSOAR Template requires data in a JSON Array format.

Following is a sample JSON content of the Ignore Keys parameter:

[
    {
        "file_path": "/info.json",
        "operations": [
        {
            "key_path": "contents.globalVariables",
            "key_type": "list",
            "key_to_compare": "name",
            "values_to_remove": [
            "Default_Email",
            "Server_fqhn"
            ]
        },
        {
            "key_path": "",
            "key_type": "dict",
            "keys_to_remove": [
            "exported_from",
            "date"
            ]
        }
        ]
    }
]

The following pointers explain how to use the Ignore Keys parameter for removal of unwanted JSON objects or lists:

  • file_path: Specify the file path to edit.
  • operations: List the operations to perform as JSON objects.
    • key_path: Specify the object to filter as a dot notation.
    • key_type: Specify either list or dict. list removes the entire object and specified keys; dict removes only the specified keys.

      For list key_type specify:

      • key_to_compare: Specify the key to compare
      • values_to_remove: Specify values corresponding to key contained in key_to_compare to remove the entire object
      • keys_to_remove: Removes these keys from the remaining objects in the list

      • keys_to_remove: Removes these keys from the JSON objects
Previous
Next

About the connector

CICD Utils provides out-of-the-box actions for the Continuous Delivery solution pack.

This document provides information about the CICD Utils Connector, which facilitates automated interactions, with a CICD Utils server using FortiSOAR™ playbooks. Add the CICD Utils Connector as a step in FortiSOAR™ playbooks and perform automated operations with CICD Utils.

Version information

Connector Version: 1.1.0

FortiSOAR™ Version Tested on: 7.4.3-3294

Authored By: Fortinet

Certified: Yes

Release Notes for version 1.1.0

Following enhancements have been made to the CICD Utils Connector in version 1.1.0:

Installing the connector

Use the Content Hub to install the connector. For the detailed procedure to install a connector, click here.

You can also use the yum command as a root user to install the connector:

yum install cyops-connector-cicd-utils

Prerequisites to configuring the connector

There are no prerequisites to configuring this connector.

Minimum Permissions Required

Configuring the connector

This connector installs with the Continuous Delivery solution pack and requires no configurations to run.

Actions supported by the connector

The following automated operations can be included in playbooks and you can also use the annotations to access operations:

Function Description Annotation and Category
Unzip Export Template Unzips the specified export template zip file. unzip_export_template
Utilities
Split Export Template Splits the export template file into following three export templates
  • Production Content
  • Production Settings
  • Development Settings
split_export_templates
Utilities
Export FortiSOAR Template Exports updated FortiSOAR Template's zip file. export_fortisoar_template
Utilities
Import FortiSOAR Template Imports FortiSOAR Template zip file in FortiSOAR import_fortisoar_template
Utilities

operation: Unzip Export Template

Input parameters

Parameter Description
Filepath Specify the export template .zip file path on the FortiSOAR™ filesystem.

Output

The output contains the following populated JSON schema:

{
    "filenames": []
}

operation: Split Export Template

Input parameters

Parameter Description
Prod Content Filepath Specify the filepath of production content's export template to create in export template record set
Prod Content JSON Specify the json of production content's export template to add in export template record set.
Prod Settings Filepath Specify the filepath of production setting's export template to create in export template record set.
Prod Settings JSON Specify the json code of production setting's export template to add in export template record set.
Dev Settings Filepath Specify the filepath of development setting's export template to create in export template record set.
Dev Settings JSON Specify the json code of development setting's export template to add in export template record set.
Unzip Export Template Filepath Specify the export template filepath under /tmp directory to extract the zip file.
Split Zip Export Template Filename Specify the split export template zip filename.

Output

The output contains the following populated JSON schema:

{
    "exportFileName": ""
}

operation: Export FortiSOAR Template

Input parameters

Parameter Description
Export Template Name Specify the export template's name to export from FortiSOAR™.
Export File Name Specify a file name for the template being exported.
Ignore Keys Specify the key's details to remove from the template files being exported. For example:
[
    {
        "file_path": "/info.json",
        "operations": [
        {
            "key_path": "contents.globalVariables",
            "key_type": "list",
            "key_to_compare": "name",
            "values_to_remove": [
            "Default_Email",
            "Server_fqhn"
            ]
        },
        {
            "key_path": "",
            "key_type": "dict",
            "keys_to_remove": [
            "exported_from",
            "date"
            ]
        }
        ]
    }
]
For more information, refer Detailing Ignore Keys Parameter section.

Output

The output contains the following populated JSON schema:

{
    "file_iri": ""
}

operation: Import FortiSOAR Template

Input parameters

Parameter Description
File Name Specify the name of file within FortiSOAR™ to import.
File Path Specify the path of the FortiSOAR Template file to be imported. For example: /tmp/github-fortisoar-prod-content-2024-01-10-12-16-24-315685.zip

Output

The output contains a non-dictionary value.

Included playbooks

The Sample - CICD Utils - 1.1.0 playbook collection comes bundled with the CICD Utils connector. These playbooks contain steps using which you can perform all supported actions. You can see bundled playbooks in the Automation > Playbooks section in FortiSOAR™ after importing the CICD Utils connector.

NOTE: If you are planning to use any of the sample playbooks in your environment, ensure that you clone those playbooks and move them to a different collection since the sample playbook collection gets deleted during connector upgrade and delete.

Detailing Ignore Keys Parameter

The Ignore Keys parameter in the action Export FortiSOAR Template requires data in a JSON Array format.

Following is a sample JSON content of the Ignore Keys parameter:

[
    {
        "file_path": "/info.json",
        "operations": [
        {
            "key_path": "contents.globalVariables",
            "key_type": "list",
            "key_to_compare": "name",
            "values_to_remove": [
            "Default_Email",
            "Server_fqhn"
            ]
        },
        {
            "key_path": "",
            "key_type": "dict",
            "keys_to_remove": [
            "exported_from",
            "date"
            ]
        }
        ]
    }
]

The following pointers explain how to use the Ignore Keys parameter for removal of unwanted JSON objects or lists:

Previous
Next