How to secure mongoDB database

The mongoDB database can be accessed via different tools such as roboMongo. The access is done on a given port (27017 by default), and for security reasons, it is recommended to secure this port against external connections.

From update 9, it is possible to secure the connection with a certificate and have a very strong security. But even before, securing the port on the servers that runs mongoDB ensures a very good security.

This document explains how to do this.

Mono-server configuration

The procedure is the following:

Cluster configuration

In cluster configuration, mongodb servers must access each other. The recommended configuration is to setup the firewalls to allow port 27017 to relevant servers only.

Reading mongodb data from third party tools

We do not recommend direct access to mongodb from third party applications, every data stored in mongodb being available through REST web services from Webserver. This method guarantee services stability and user rights compliance.

Installing certificates (from release 9)

In release 9, the installation procedure of MongoDB can be done with certificates. If this has been done, using a tool like robomongo will require a dedicated set up, summarized here: