Fortinet black logo

CircleCI v1.0.0

1.0.0
Copy Link
Copy Doc ID 57694f82-e423-11ed-8e6d-fa163e15d75b:569

About the connector

CircleCI is a continuous integration and delivery platform that helps development teams to release code rapidly and automate the build, test, and deploy process. CircleCI can be configured to run very complex pipelines efficiently with caching, docker layer caching, resource classes, and many more. After repositories on GitHub or Bitbucket are authorized and added as a project to circleci.com, each code push triggers CircleCI run jobs. CircleCI also sends an email notification of success or failure after the tests are complete.

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

Version information

Connector Version: 1.0.0

FortiSOAR™ Version Tested on: 7.4.0r

CircleCI Version Tested on: v2

Authored By: Fortinet

Certified: Yes

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-circleci

Prerequisites to configuring the connector

  • You must have the URL of the CircleCI server to connect and perform automated operations and credentials to access that server.
  • The FortiSOAR™ server should have outbound connectivity to port 443 on the CircleCI server.

Minimum Permissions Required

  • Not applicable

Configuring the connector

For the procedure to configure a connector, click here

Configuration parameters

In FortiSOAR™, on the Connectors page, click the CircleCI connector row (if you are in the Grid view on the Connectors page) and in the Configurations tab enter the required configuration details:

Parameter Description
Server URL URL of the CircleCI server to connect and perform automated operations.
API Key Specify the API Key used to access the CircleCI APIs and perform automated operations.
Version Control System Type Specify the version control system, you can choose between Github and Bitbucket.
Organization Name Organization is your username or organization name in your version control system.
Project Name Specify the name of the project in your version control system.
Verify SSL Specifies whether the SSL certificate for the server is to be verified or not.
By default, this option is set to 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:

Function Description Annotation and Category
Get Workflows List Retrieves summary metrics for a project's workflow. The workflow runs going back at most 90 days are included in the aggregation window. Metrics are refreshed daily, and thus may not include executions from the last 24 hours. get_workflows_list
Investigation
Get Artifacts List Retrieves the artifacts' list from the CircleCI job based on the job number provided. get_artifacts_list
Investigation
Get Workflow Jobs List Retrieves the jobs' list from the CircleCI workflow based on the ID of the workflow provided. get_workflow_jobs_list
Investigation
Get Workflow Last Runs Retrieves the recent runs of a workflow based on the workflow name provided. Runs going back at most 90 days are returned. get_workflow_last_runs
Investigation
Trigger Workflow Triggers a new pipeline on the project. trigger_workflow
Investigation

operation: Get Workflows List

Input parameters

Parameter Description
Version Control System Type Specify the version control system to use for getting the workflows list. You can choose between GitHub and Bitbucket.
Organization Name Specify your username or organization's name in your version control system.
Project Name Specify the name of the project in your version control system
Page Token Specify the token to retrieve the next page of results.
Fetch Data From Select the sources from where to fetch data. You can select from the following available options:
  • Retrieve Data From All Branches
  • Retrieve Data From A Specific Branch: Specify the branch of the version control system from which to fetch data. If left blank, the branch specified as default in the repository is used.
Reporting Window Select a time window to calculate summary metrics.

Output

The output contains the following populated JSON schema:
{
"next_page_token": "",
"items": [
{
"name": "",
"metrics": {
"total_runs": "",
"successful_runs": "",
"mttr": "",
"total_credits_used": "",
"failed_runs": "",
"median_credits_used": "",
"success_rate": "",
"duration_metrics": {
"min": "",
"mean": "",
"median": "",
"p95": "",
"max": "",
"standard_deviation": "",
"total_duration": ""
},
"total_recoveries": "",
"throughput": ""
},
"window_start": "",
"window_end": "",
"project_id": ""
}
]
}

operation: Get Artifacts List

Input parameters

Parameter Description
Job Number Specify the job number to retrieve its artifacts
Version Control System Type Specify the version control system to use for getting the artifacts list. You can choose between GitHub and Bitbucket.
Organization Name Specify your username or organization's name in your version control system.
Project Name Specify the name of the project in your version control system

Output

The output contains the following populated JSON schema:
{
"items": [
{
"path": "",
"node_index": "",
"url": ""
}
],
"next_page_token": ""
}

operation: Get Workflow Jobs List

Input parameters

Parameter Description
Workflow ID Specify the workflow ID to retrieve its jobs.

Output

The output contains the following populated JSON schema:
{
"next_page_token": "",
"items": [
{
"dependencies": [],
"job_number": "",
"id": "",
"started_at": "",
"name": "",
"project_slug": "",
"status": "",
"type": "",
"stopped_at": ""
}
]
}

operation: Get Workflow Last Runs

Input parameters

Parameter Description
Workflow Name Specify the name of the workflow from which to retrieve its last run details.
Version Control System Type Specify the version control system to use for getting workflows' last runs. You can choose between GitHub and Bitbucket.
Organization Name Specify your username or organization's name in your version control system.
Project Name Specify the name of the project in your version control system
Page Token Specify the token to retrieve the next page of results.
Fetch Data From Select the sources from where to fetch data. You can select from the following available options:
  • Retrieve Data From All Branches
  • Retrieve Data From A Specific Branch: Specify the branch of the version control system from which to fetch data. If left blank, the branch specified as default in the repository is used.
Start Date Select a start date to include only those executions that started on or after this date. This parameter must be specified if an end date is provided.
End Date Select an end date to include only those executions that started before this date. This parameter cannot be later than 90 days after the selected start date.

Output

The output contains the following populated JSON schema:
{
"next_page_token": "",
"items": [
{
"id": "",
"duration": "",
"status": "",
"created_at": "",
"stopped_at": "",
"credits_used": "",
"branch": "",
"is_approval": ""
}
]
}

operation: Trigger Workflow

Input parameters

Parameter Description
Version Control System Type Specify the version control system to use for triggering workflows. You can choose between GitHub and Bitbucket.
Organization Name Specify your username or organization's name in your version control system.
Project Name Specify the name of the project in your version control system
Parameters Specify an object containing pipeline parameters and their values.

Output

The output contains the following populated JSON schema:
{
"number": "",
"state": "",
"id": "",
"created_at": ""
}

Included playbooks

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

  • Get Artifacts List
  • Get Workflow Jobs List
  • Get Workflow Last Runs
  • Get Workflows List
  • Trigger Workflow

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

About the connector

CircleCI is a continuous integration and delivery platform that helps development teams to release code rapidly and automate the build, test, and deploy process. CircleCI can be configured to run very complex pipelines efficiently with caching, docker layer caching, resource classes, and many more. After repositories on GitHub or Bitbucket are authorized and added as a project to circleci.com, each code push triggers CircleCI run jobs. CircleCI also sends an email notification of success or failure after the tests are complete.

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

Version information

Connector Version: 1.0.0

FortiSOAR™ Version Tested on: 7.4.0r

CircleCI Version Tested on: v2

Authored By: Fortinet

Certified: Yes

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-circleci

Prerequisites to configuring the connector

Minimum Permissions Required

Configuring the connector

For the procedure to configure a connector, click here

Configuration parameters

In FortiSOAR™, on the Connectors page, click the CircleCI connector row (if you are in the Grid view on the Connectors page) and in the Configurations tab enter the required configuration details:

Parameter Description
Server URL URL of the CircleCI server to connect and perform automated operations.
API Key Specify the API Key used to access the CircleCI APIs and perform automated operations.
Version Control System Type Specify the version control system, you can choose between Github and Bitbucket.
Organization Name Organization is your username or organization name in your version control system.
Project Name Specify the name of the project in your version control system.
Verify SSL Specifies whether the SSL certificate for the server is to be verified or not.
By default, this option is set to 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:

Function Description Annotation and Category
Get Workflows List Retrieves summary metrics for a project's workflow. The workflow runs going back at most 90 days are included in the aggregation window. Metrics are refreshed daily, and thus may not include executions from the last 24 hours. get_workflows_list
Investigation
Get Artifacts List Retrieves the artifacts' list from the CircleCI job based on the job number provided. get_artifacts_list
Investigation
Get Workflow Jobs List Retrieves the jobs' list from the CircleCI workflow based on the ID of the workflow provided. get_workflow_jobs_list
Investigation
Get Workflow Last Runs Retrieves the recent runs of a workflow based on the workflow name provided. Runs going back at most 90 days are returned. get_workflow_last_runs
Investigation
Trigger Workflow Triggers a new pipeline on the project. trigger_workflow
Investigation

operation: Get Workflows List

Input parameters

Parameter Description
Version Control System Type Specify the version control system to use for getting the workflows list. You can choose between GitHub and Bitbucket.
Organization Name Specify your username or organization's name in your version control system.
Project Name Specify the name of the project in your version control system
Page Token Specify the token to retrieve the next page of results.
Fetch Data From Select the sources from where to fetch data. You can select from the following available options:
  • Retrieve Data From All Branches
  • Retrieve Data From A Specific Branch: Specify the branch of the version control system from which to fetch data. If left blank, the branch specified as default in the repository is used.
Reporting Window Select a time window to calculate summary metrics.

Output

The output contains the following populated JSON schema:
{
"next_page_token": "",
"items": [
{
"name": "",
"metrics": {
"total_runs": "",
"successful_runs": "",
"mttr": "",
"total_credits_used": "",
"failed_runs": "",
"median_credits_used": "",
"success_rate": "",
"duration_metrics": {
"min": "",
"mean": "",
"median": "",
"p95": "",
"max": "",
"standard_deviation": "",
"total_duration": ""
},
"total_recoveries": "",
"throughput": ""
},
"window_start": "",
"window_end": "",
"project_id": ""
}
]
}

operation: Get Artifacts List

Input parameters

Parameter Description
Job Number Specify the job number to retrieve its artifacts
Version Control System Type Specify the version control system to use for getting the artifacts list. You can choose between GitHub and Bitbucket.
Organization Name Specify your username or organization's name in your version control system.
Project Name Specify the name of the project in your version control system

Output

The output contains the following populated JSON schema:
{
"items": [
{
"path": "",
"node_index": "",
"url": ""
}
],
"next_page_token": ""
}

operation: Get Workflow Jobs List

Input parameters

Parameter Description
Workflow ID Specify the workflow ID to retrieve its jobs.

Output

The output contains the following populated JSON schema:
{
"next_page_token": "",
"items": [
{
"dependencies": [],
"job_number": "",
"id": "",
"started_at": "",
"name": "",
"project_slug": "",
"status": "",
"type": "",
"stopped_at": ""
}
]
}

operation: Get Workflow Last Runs

Input parameters

Parameter Description
Workflow Name Specify the name of the workflow from which to retrieve its last run details.
Version Control System Type Specify the version control system to use for getting workflows' last runs. You can choose between GitHub and Bitbucket.
Organization Name Specify your username or organization's name in your version control system.
Project Name Specify the name of the project in your version control system
Page Token Specify the token to retrieve the next page of results.
Fetch Data From Select the sources from where to fetch data. You can select from the following available options:
  • Retrieve Data From All Branches
  • Retrieve Data From A Specific Branch: Specify the branch of the version control system from which to fetch data. If left blank, the branch specified as default in the repository is used.
Start Date Select a start date to include only those executions that started on or after this date. This parameter must be specified if an end date is provided.
End Date Select an end date to include only those executions that started before this date. This parameter cannot be later than 90 days after the selected start date.

Output

The output contains the following populated JSON schema:
{
"next_page_token": "",
"items": [
{
"id": "",
"duration": "",
"status": "",
"created_at": "",
"stopped_at": "",
"credits_used": "",
"branch": "",
"is_approval": ""
}
]
}

operation: Trigger Workflow

Input parameters

Parameter Description
Version Control System Type Specify the version control system to use for triggering workflows. You can choose between GitHub and Bitbucket.
Organization Name Specify your username or organization's name in your version control system.
Project Name Specify the name of the project in your version control system
Parameters Specify an object containing pipeline parameters and their values.

Output

The output contains the following populated JSON schema:
{
"number": "",
"state": "",
"id": "",
"created_at": ""
}

Included playbooks

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