Fortinet white logo
Fortinet white logo
1.0.0

GitLab v1.0.0

About the connector

GitLab is a single application for the entire software development lifecycle. From project planning and source code management to CI/CD, monitoring, and security.

This document provides information about the GitLab connector, which facilitates automated interactions, with a GitLab server using FortiSOAR™ playbooks. Add the GitLab connector as a step in FortiSOAR™ playbooks and perform automated operations, such as creating a single file in the GitLab repository, or retrieving information about a file stored in the GitLab repository.

Version information

Connector Version: 1.0.0

FortiSOAR™ Version Tested on: 5.0.0-866

Authored By: Fortinet

Certified: Yes

Installing the connector

All connectors provided by FortiSOAR™ are delivered using a FortiSOAR™ repository. Therefore, you must set up your FortiSOAR™ repository and use the yum command to install connectors:

yum install cyops-connector-gitlab

For the detailed procedure to install a connector, click here

Prerequisites to configuring the connector

  • You must have the IP address or hostname of GitLab server to which you will connect and perform automated operations.
  • You must have the access token that is provided to you by a GitLab administrator that you will use to access the GitLab REST API.
  • To access the FortiSOAR™ UI, ensure that port 443 is open through the firewall for the FortiSOAR™ instance.

Configuring the connector

For the procedure to configure a connector, click here

Configuration parameters

In FortiSOAR™, on the Connectors page, click the GitLab connector row, and in the Configuration tab enter the required configuration details.

Parameter Description
Server URL IP address or hostname of the GitLab server to which you will connect and perform automated operations.
Access Token Access token that is provided to you by a GitLab administrator that you will use to access the GitLab REST API.
Verify SSL Specifies whether the SSL certificate for the server is to be verified or not.
By default, this option is set as True.

Actions supported by the connector

The following automated operations can be included in playbooks and you can also use the annotations to access operations from FortiSOAR™ release 4.10.0 and onwards:

Function Description Annotation and Category
Create File Creates a single file in the GitLab repository based on the project ID, branch name, file name and other input parameters that you have specified. create_new_file_in_repository
Investigation
Get File Retrieves information such as name, size, content, etc. about a file from the GitLab repository based on the project ID, branch name, and file name that you have specified.
Note: File content is Base64 encoded.
get_file_from_repository
Investigation
Update File Updates a single file in the GitLab repository based on the project ID, branch name, file name and other input parameters that you have specified. update_file_in_repository
Investigation
Delete File Deletes a single file in the GitLab repository based on the project ID, branch name, file name and other input parameters that you have specified. delete_existing_file_in_repository
Investigation

operation: Create File

Input parameters

Parameter Description
Project ID Project ID in which you want to store the file that you want to create in the GitLab repository.
Branch Name Name of the branch in which you want to store the file that you want to create in the GitLab repository.
File Name Name of the file that you want to create in the GitLab repository.
Content Information Content information that you want to add to the file that you want to create in the GitLab repository.
Commit Message Commit message that you want to add while creating the file in the GitLab repository.
Author Email ID (Optional) Email address of the commit author that you want to add while creating the file in the GitLab repository.
Author Name (Optional) Name of the commit author that you want to add while creating the file in the GitLab repository.

Output

The output contains the following populated JSON schema:
{
"branch": "",
"file_path": ""
}

operation: Get File

Input parameters

Parameter Description
Project ID Project ID in which the file is stored in the GitLab repository whose information you want to retrieve.
Branch Name Name of the branch in which the file is stored in the GitLab repository whose information you want to retrieve.
File Name Name of the file whose information you want to retrieve from the GitLab repository.

Output

The output contains the following populated JSON schema:
{
"operation": "",
"message": "",
"data": {
"commit_id": "",
"file_path": "",
"content": "",
"content_sha256": "",
"last_commit_id": "",
"file_name": "",
"ref": "",
"blob_id": "",
"size": "",
"encoding": ""
},
"status": "",
"env": {}
}

operation: Update File

Input parameters

Parameter Description
Project ID Project ID in which the file that you want to update is stored in the GitLab repository.
Branch Name Name of the branch in which the file that you want to update is stored in the GitLab repository.
File Name Name of the file that you want to update in the GitLab repository.
Content Information Content information that you want to update in the specified file in the GitLab repository.
Commit Message Commit message that you want to add while updating the specified file in the GitLab repository.

Output

The output contains the following populated JSON schema:
{
"operation": "",
"message": "",
"data": {
"branch": "",
"file_path": ""
},
"status": "",
"env": {}
}

operation: Delete File

Input parameters

Parameter Description
Project ID Project ID in which the file that you want to delete is stored in the GitLab repository.
Branch Name Name of the branch in which the file that you want to delete is stored in the GitLab repository.
File Name Name of the file that you want to delete in the GitLab repository.
Commit Message Commit message that you want to add while deleting the specified file in the GitLab repository.
Author Email ID (Optional) Email address of the commit author that you want to add while deleting the file in the GitLab repository.
Author Name (Optional) Name of the commit author that you want to add while deleting the file in the GitLab repository.

Output

The output contains a non-dictionary value.

Included playbooks

The Sample - GitLab - 1.0.0 playbook collection comes bundled with the GitLab 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 GitLab connector.

  • Create File
  • Delete File
  • Get File
  • Update File

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.

Previous
Next

GitLab v1.0.0

About the connector

GitLab is a single application for the entire software development lifecycle. From project planning and source code management to CI/CD, monitoring, and security.

This document provides information about the GitLab connector, which facilitates automated interactions, with a GitLab server using FortiSOAR™ playbooks. Add the GitLab connector as a step in FortiSOAR™ playbooks and perform automated operations, such as creating a single file in the GitLab repository, or retrieving information about a file stored in the GitLab repository.

Version information

Connector Version: 1.0.0

FortiSOAR™ Version Tested on: 5.0.0-866

Authored By: Fortinet

Certified: Yes

Installing the connector

All connectors provided by FortiSOAR™ are delivered using a FortiSOAR™ repository. Therefore, you must set up your FortiSOAR™ repository and use the yum command to install connectors:

yum install cyops-connector-gitlab

For the detailed procedure to install a connector, click here

Prerequisites to configuring the connector

Configuring the connector

For the procedure to configure a connector, click here

Configuration parameters

In FortiSOAR™, on the Connectors page, click the GitLab connector row, and in the Configuration tab enter the required configuration details.

Parameter Description
Server URL IP address or hostname of the GitLab server to which you will connect and perform automated operations.
Access Token Access token that is provided to you by a GitLab administrator that you will use to access the GitLab REST API.
Verify SSL Specifies whether the SSL certificate for the server is to be verified or not.
By default, this option is set as True.

Actions supported by the connector

The following automated operations can be included in playbooks and you can also use the annotations to access operations from FortiSOAR™ release 4.10.0 and onwards:

Function Description Annotation and Category
Create File Creates a single file in the GitLab repository based on the project ID, branch name, file name and other input parameters that you have specified. create_new_file_in_repository
Investigation
Get File Retrieves information such as name, size, content, etc. about a file from the GitLab repository based on the project ID, branch name, and file name that you have specified.
Note: File content is Base64 encoded.
get_file_from_repository
Investigation
Update File Updates a single file in the GitLab repository based on the project ID, branch name, file name and other input parameters that you have specified. update_file_in_repository
Investigation
Delete File Deletes a single file in the GitLab repository based on the project ID, branch name, file name and other input parameters that you have specified. delete_existing_file_in_repository
Investigation

operation: Create File

Input parameters

Parameter Description
Project ID Project ID in which you want to store the file that you want to create in the GitLab repository.
Branch Name Name of the branch in which you want to store the file that you want to create in the GitLab repository.
File Name Name of the file that you want to create in the GitLab repository.
Content Information Content information that you want to add to the file that you want to create in the GitLab repository.
Commit Message Commit message that you want to add while creating the file in the GitLab repository.
Author Email ID (Optional) Email address of the commit author that you want to add while creating the file in the GitLab repository.
Author Name (Optional) Name of the commit author that you want to add while creating the file in the GitLab repository.

Output

The output contains the following populated JSON schema:
{
"branch": "",
"file_path": ""
}

operation: Get File

Input parameters

Parameter Description
Project ID Project ID in which the file is stored in the GitLab repository whose information you want to retrieve.
Branch Name Name of the branch in which the file is stored in the GitLab repository whose information you want to retrieve.
File Name Name of the file whose information you want to retrieve from the GitLab repository.

Output

The output contains the following populated JSON schema:
{
"operation": "",
"message": "",
"data": {
"commit_id": "",
"file_path": "",
"content": "",
"content_sha256": "",
"last_commit_id": "",
"file_name": "",
"ref": "",
"blob_id": "",
"size": "",
"encoding": ""
},
"status": "",
"env": {}
}

operation: Update File

Input parameters

Parameter Description
Project ID Project ID in which the file that you want to update is stored in the GitLab repository.
Branch Name Name of the branch in which the file that you want to update is stored in the GitLab repository.
File Name Name of the file that you want to update in the GitLab repository.
Content Information Content information that you want to update in the specified file in the GitLab repository.
Commit Message Commit message that you want to add while updating the specified file in the GitLab repository.

Output

The output contains the following populated JSON schema:
{
"operation": "",
"message": "",
"data": {
"branch": "",
"file_path": ""
},
"status": "",
"env": {}
}

operation: Delete File

Input parameters

Parameter Description
Project ID Project ID in which the file that you want to delete is stored in the GitLab repository.
Branch Name Name of the branch in which the file that you want to delete is stored in the GitLab repository.
File Name Name of the file that you want to delete in the GitLab repository.
Commit Message Commit message that you want to add while deleting the specified file in the GitLab repository.
Author Email ID (Optional) Email address of the commit author that you want to add while deleting the file in the GitLab repository.
Author Name (Optional) Name of the commit author that you want to add while deleting the file in the GitLab repository.

Output

The output contains a non-dictionary value.

Included playbooks

The Sample - GitLab - 1.0.0 playbook collection comes bundled with the GitLab 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 GitLab 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.

Previous
Next