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). For security reasons, it is recommended to secure this port against external connections.

From Update 9 and above, it is possible to secure the connection with a certificate and have high level security. But even before Update 9, securing the servers' port that runs mongoDB ensures very good security.

This document explains how to do this.

Mono-server configuration

The procedure is the following:

Cluster configuration

In a 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

Direct access to mongoDB from third party applications is not recommended. All data stored in mongoDB should be available through REST web services from Web server. This method guarantees services stability and user rights compliance.

Installing certificates (from release 9)

In release 9, the installation procedure of MongoDB can be done with certificates. In this case, using a tool like robomongo requires a dedicated setup that is summarized here: