Fortinet Document Library

Version:


Table of Contents

1.0.0
Copy Link

About the connector

MySQL is the one of the most popular Open Source Relational SQL Database Management System. MySQL is used for developing various web-based software applications. The MySQL database server manages the databases and tables, controls user access, and processes the SQL queries.

This document provides information about the MySQL connector, which facilitates automated interactions, with a MySQL server using FortiSOAR™ playbooks. Add the MySQL connector as a step in FortiSOAR™ playbooks and perform automated operations, such as executing a query on MySQL database and listing table and column names present in the database.

 

Version information

Connector Version: 1.0.0

FortiSOAR™ Version Tested on: 4.11.0-1161

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

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

 

Prerequisites to configuring the connector

  • You must configure the MySQL database to which you will connect and perform automated operations on your local instance.
  • You must know the Hostname or IP Address of the instance on which you have installed the MySQL database server to which you will connect and perform automated operations and credentials (if required) to access the database.
  • 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, select the MySQL connector and click Configure to configure the following parameters:

 

Parameter Description
Server URL Hostname or IP Address of the instance on which you have installed the MySQL database server to which you will connect and perform automated operations.
Database Database name that is used while connecting to the MySQL server. This would be the database to which you will connect and perform automated operations
Username (Optional) Username to access the MySQL database to which you will connect and perform automated operations.
Password (Optional) Password to access the MySQL database to which you will connect and perform automated operations.

 

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 onwards:

 

Function Description Annotation and Category
Run Query Executes a query on the MySQL database.
You can execute any valid SQL query such as Create, Update, Delete, Insert or Select.
run_query
Investigation
List Tables Lists the names of all tables that are available in the MySQL database. list_tables
Investigation
List Columns Lists the names and details of the table that you specified retrieved from the MySQL database, based on the table name you have specified. list_columns
Investigation

 

operation: Run Query

Input parameters

 

Parameter Description
Query Query that you want to trigger on the MySQL database. You can perform all sorts of operations such as Create, Update, Delete, Insert, or Select, on the MySQL database using this query.
For example, CREATE TABLE Student(Id Int, Name Varchar(20);

 

Output

The JSON output contains the result of the query execution.

Following image displays the output of the Select * from table_name query:

Sample output of the Run Query operation

operation: List Tables

Input parameters

None.

Output

The JSON output contains a list of all table names that are available in the MySQL database.

Following image displays a sample output:

Sample output of the List Tables operation

operation: List Columns

Input parameters

 

Parameter Description
Table Name Name of the table whose list of columns you want to retrieve from the MySQL database.

 

Output

The JSON output contains the list of all columns of the table name you have specified, retrieved from the MySQL database.

Following image displays a sample output:

Sample output of the List Columns operation

Included playbooks

The Sample - MySQL - 1.0.0 playbook collection comes bundled with the MySQL connector. This playbook contains steps using which you can perform all supported actions. You can see the bundled playbooks in the Automation > Playbooks section in FortiSOAR™ after importing the MySQL connector.

  • List Columns
  • List Tables
  • Run Query

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.

 

About the connector

MySQL is the one of the most popular Open Source Relational SQL Database Management System. MySQL is used for developing various web-based software applications. The MySQL database server manages the databases and tables, controls user access, and processes the SQL queries.

This document provides information about the MySQL connector, which facilitates automated interactions, with a MySQL server using FortiSOAR™ playbooks. Add the MySQL connector as a step in FortiSOAR™ playbooks and perform automated operations, such as executing a query on MySQL database and listing table and column names present in the database.

 

Version information

Connector Version: 1.0.0

FortiSOAR™ Version Tested on: 4.11.0-1161

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

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, select the MySQL connector and click Configure to configure the following parameters:

 

Parameter Description
Server URL Hostname or IP Address of the instance on which you have installed the MySQL database server to which you will connect and perform automated operations.
Database Database name that is used while connecting to the MySQL server. This would be the database to which you will connect and perform automated operations
Username (Optional) Username to access the MySQL database to which you will connect and perform automated operations.
Password (Optional) Password to access the MySQL database to which you will connect and perform automated operations.

 

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 onwards:

 

Function Description Annotation and Category
Run Query Executes a query on the MySQL database.
You can execute any valid SQL query such as Create, Update, Delete, Insert or Select.
run_query
Investigation
List Tables Lists the names of all tables that are available in the MySQL database. list_tables
Investigation
List Columns Lists the names and details of the table that you specified retrieved from the MySQL database, based on the table name you have specified. list_columns
Investigation

 

operation: Run Query

Input parameters

 

Parameter Description
Query Query that you want to trigger on the MySQL database. You can perform all sorts of operations such as Create, Update, Delete, Insert, or Select, on the MySQL database using this query.
For example, CREATE TABLE Student(Id Int, Name Varchar(20);

 

Output

The JSON output contains the result of the query execution.

Following image displays the output of the Select * from table_name query:

Sample output of the Run Query operation

operation: List Tables

Input parameters

None.

Output

The JSON output contains a list of all table names that are available in the MySQL database.

Following image displays a sample output:

Sample output of the List Tables operation

operation: List Columns

Input parameters

 

Parameter Description
Table Name Name of the table whose list of columns you want to retrieve from the MySQL database.

 

Output

The JSON output contains the list of all columns of the table name you have specified, retrieved from the MySQL database.

Following image displays a sample output:

Sample output of the List Columns operation

Included playbooks

The Sample - MySQL - 1.0.0 playbook collection comes bundled with the MySQL connector. This playbook contains steps using which you can perform all supported actions. You can see the bundled playbooks in the Automation > Playbooks section in FortiSOAR™ after importing the MySQL 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.