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.
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
Following enhancements have been made to the MongoDB Connector in version 2.0.0:
pymongo.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
For the procedure to configure a connector, click here
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. |
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 |
| 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. |
The output contains the following populated JSON schema:
{
"status": "",
"message": ""
}
| 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. |
The output contains the following populated JSON schema:
{
"status": "",
"data": ""
}
| 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. |
The output contains the following populated JSON schema:
{
"status": "",
"message": ""
}
| 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. |
The output contains the following populated JSON schema:
{
"status": "",
"message": ""
}
| 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 schema is not available at this time.
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.
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.
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
Following enhancements have been made to the MongoDB Connector in version 2.0.0:
pymongo.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
For the procedure to configure a connector, click here
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. |
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 |
| 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. |
The output contains the following populated JSON schema:
{
"status": "",
"message": ""
}
| 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. |
The output contains the following populated JSON schema:
{
"status": "",
"data": ""
}
| 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. |
The output contains the following populated JSON schema:
{
"status": "",
"message": ""
}
| 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. |
The output contains the following populated JSON schema:
{
"status": "",
"message": ""
}
| 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 schema is not available at this time.
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.