Fortinet white logo
Fortinet white logo
2.0.0

MongoDB v2.0.0

About the connector

MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling. Use the MongoDB connector to perform automated operations, such as inserting or updating documents, retrieving a list of all available collections from the MongoDB database, and querying the MongoDB database.

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

Version information

Connector Version: 2.0.0

FortiSOAR™ Version Tested on: 7.5.0-4015

MongoDB Version Tested on: 7.0.8

Authored By: Fortinet

Certified: Yes

Release Notes for version 2.0.0

Following enhancements have been made to the MongoDB Connector in version 2.0.0:

  • Updated the python dependency pymongo.
  • The input parameter Filter in the action Delete Documents action is now mandatory.
  • Fixed the issue where the health check failed when the optional parameters in the connector configuration were not provided.
  • A new input parameter Database has been added to the following actions:
    • Insert Documents
    • Query Documents
    • Update Documents
    • Delete Documents
    • Get Collections

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

Prerequisites to configuring the connector

  • You must have the credentials of MongoDB server to which you will connect and perform automated operations.
  • The FortiSOAR™ server should have outbound connectivity to port 443 on the MongoDB 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 MongoDB 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
Host MongoDB server host details. Host details can be the host address, the hostname or IP address, or the Unix domain socket path of a single MongoDB or multiple MongoDB instances to connect to which you will connect and perform the automated operations.
Database MongoDB database to which you will connect and perform the automated operations and for which you will provide authentication details.
Username Username that is used to access the MongoDB database to which you will connect and perform the automated operations.
Password Password that is used to access the MongoDB database to which you will connect and perform the automated operations.
Port Port number used for connecting to the MongoDB database. Defaults to 27017.
Auth Fields Other authentication fields, if required to connect to the MongoDB database. For more details, see https://pymongo.readthedocs.io/en/stable/api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.

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
Insert Documents Adds data to the MongoDB database in MongoDB collection you have specified. add_data
Investigation
Query Documents Queries a MongoDB collection and retrieves data from the MongoDB database, based on the filter you have specified. get_data
Investigation
Update Documents Updates documents in the MongoDB collection you have specified, based on the filter you have specified. update_data
Investigation
Delete Documents Deletes all documents in the MongoDB collection you have specified, based on the filter you have specified. delete_data
Remediation
Get Collections Retrieves a list of all available collections from the MongoDB database. list_tables
Investigation

operation: Insert Documents

Input parameters

Parameter Description
Collection Name Specify the collection name in the MongoDB database where you want to insert documents.
Data Specify the data that you want to insert in the MongoDB database.
Database Specify the MongoDB database to connect and perform this operation.

NOTE: Database that you specify here overwrites the database that you have specified as a configuration parameter.

Output

The output contains the following populated JSON schema:

{
    "status": "",
    "message": ""
}

operation: Query Documents

Input parameters

Parameter Description
Collection Name Specify the collection name in the MongoDB database to query for documents.
Filter (Optional) Specify the filter criteria based on which to retrieve documents from the MongoDB database.
Database Specify the MongoDB database to connect and perform this operation.

NOTE: Database that you specify here overwrites the database that you have specified as a configuration parameter.

Output

The output contains the following populated JSON schema:

{
    "status": "",
    "data": ""
}

operation: Update Documents

Input parameters

Parameter Description
Collection Name Specify the collection name in the MongoDB database in which to update documents.
Filter Specify the filter criteria to be applied to documents being updated in the MongoDB database. All documents matching the specified filter criteria will be updated.
Data to Update Specify the data to update in the filtered documents.
Database Specify the MongoDB database to connect and perform this operation.

NOTE: Database that you specify here overwrites the database that you have specified as a configuration parameter.

Output

The output contains the following populated JSON schema:

{
    "status": "",
    "message": ""
}

operation: Delete Documents

Input parameters

Parameter Description
Collection Name Specify the collection name in the MongoDB database from which you want to delete documents.
Filter Specify the filter criteria to be applied to documents to delete from the MongoDB database. All documents matching the specified filter criteria will be deleted.
Database Specify the MongoDB database to connect and perform this operation.

NOTE: Database that you specify here overwrites the database that you have specified as a configuration parameter.

Output

The output contains the following populated JSON schema:

{
    "status": "",
    "message": ""
}

operation: Get Collections

Input parameters

Parameter Description
Database Specify the MongoDB database to connect and perform this operation.

NOTE: Database that you specify here overwrites the database that you have specified as a configuration parameter.

Output

Output schema is not available at this time.

Included playbooks

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

  • Delete Documents
  • Get Collections
  • Insert Documents
  • Query Documents
  • Update Documents

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

MongoDB v2.0.0

About the connector

MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling. Use the MongoDB connector to perform automated operations, such as inserting or updating documents, retrieving a list of all available collections from the MongoDB database, and querying the MongoDB database.

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

Version information

Connector Version: 2.0.0

FortiSOAR™ Version Tested on: 7.5.0-4015

MongoDB Version Tested on: 7.0.8

Authored By: Fortinet

Certified: Yes

Release Notes for version 2.0.0

Following enhancements have been made to the MongoDB Connector in version 2.0.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-mongodb

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 MongoDB 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
Host MongoDB server host details. Host details can be the host address, the hostname or IP address, or the Unix domain socket path of a single MongoDB or multiple MongoDB instances to connect to which you will connect and perform the automated operations.
Database MongoDB database to which you will connect and perform the automated operations and for which you will provide authentication details.
Username Username that is used to access the MongoDB database to which you will connect and perform the automated operations.
Password Password that is used to access the MongoDB database to which you will connect and perform the automated operations.
Port Port number used for connecting to the MongoDB database. Defaults to 27017.
Auth Fields Other authentication fields, if required to connect to the MongoDB database. For more details, see https://pymongo.readthedocs.io/en/stable/api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.

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
Insert Documents Adds data to the MongoDB database in MongoDB collection you have specified. add_data
Investigation
Query Documents Queries a MongoDB collection and retrieves data from the MongoDB database, based on the filter you have specified. get_data
Investigation
Update Documents Updates documents in the MongoDB collection you have specified, based on the filter you have specified. update_data
Investigation
Delete Documents Deletes all documents in the MongoDB collection you have specified, based on the filter you have specified. delete_data
Remediation
Get Collections Retrieves a list of all available collections from the MongoDB database. list_tables
Investigation

operation: Insert Documents

Input parameters

Parameter Description
Collection Name Specify the collection name in the MongoDB database where you want to insert documents.
Data Specify the data that you want to insert in the MongoDB database.
Database Specify the MongoDB database to connect and perform this operation.

NOTE: Database that you specify here overwrites the database that you have specified as a configuration parameter.

Output

The output contains the following populated JSON schema:

{
    "status": "",
    "message": ""
}

operation: Query Documents

Input parameters

Parameter Description
Collection Name Specify the collection name in the MongoDB database to query for documents.
Filter (Optional) Specify the filter criteria based on which to retrieve documents from the MongoDB database.
Database Specify the MongoDB database to connect and perform this operation.

NOTE: Database that you specify here overwrites the database that you have specified as a configuration parameter.

Output

The output contains the following populated JSON schema:

{
    "status": "",
    "data": ""
}

operation: Update Documents

Input parameters

Parameter Description
Collection Name Specify the collection name in the MongoDB database in which to update documents.
Filter Specify the filter criteria to be applied to documents being updated in the MongoDB database. All documents matching the specified filter criteria will be updated.
Data to Update Specify the data to update in the filtered documents.
Database Specify the MongoDB database to connect and perform this operation.

NOTE: Database that you specify here overwrites the database that you have specified as a configuration parameter.

Output

The output contains the following populated JSON schema:

{
    "status": "",
    "message": ""
}

operation: Delete Documents

Input parameters

Parameter Description
Collection Name Specify the collection name in the MongoDB database from which you want to delete documents.
Filter Specify the filter criteria to be applied to documents to delete from the MongoDB database. All documents matching the specified filter criteria will be deleted.
Database Specify the MongoDB database to connect and perform this operation.

NOTE: Database that you specify here overwrites the database that you have specified as a configuration parameter.

Output

The output contains the following populated JSON schema:

{
    "status": "",
    "message": ""
}

operation: Get Collections

Input parameters

Parameter Description
Database Specify the MongoDB database to connect and perform this operation.

NOTE: Database that you specify here overwrites the database that you have specified as a configuration parameter.

Output

Output schema is not available at this time.

Included playbooks

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