Security Hardening Guide
This document provides guidance and instructions to achieve a secure deployment of Charmed MongoDB and Charmed Mongos. We discuss both charms since acknowledge that Charmed Mongos is a requirement clustered deployments. Additionally, we include guidance and instructions for setting up and managing a secure environment. The document is divided into the following sections:
- Environment, outlining the recommendation for deploying a secure environment
- Applications, outlining the product features that enable a secure deployment of Charmed MongoDB
- Additional resources, providing any further information about security and compliance
Environment
The environment where applications operate can be divided in two components:
- Cloud
- Juju
Cloud
Charmed MongoDB can be deployed on top of several clouds and virtualization layers:
Cloud | Security guide |
---|---|
OpenStack | OpenStack Security Guide |
AWS | Best Practices for Security, Identity and Compliance, AWS security credentials |
Azure | Azure security best practices and patterns, Managed identities for Azure resource |
Juju
Juju is the component responsible for orchestrating the entire lifecycle, from deployment to Day 2 operations, of all applications. Therefore, it is imperative that it is set up securely. Please refer to the Juju documentation for more information on:
Cloud credentials
When configuring the cloud credentials to be used with Juju, ensure that the users have correct permissions to operate at the required level. Juju superusers responsible for bootstrapping and managing controllers require elevated permissions to manage several kinds of resources, such as virtual machines, networks, storages, etc. Please refer to the references below for more information on the policies required to be used depending on the cloud.
Cloud | Cloud user policies |
---|---|
OpenStack | N/A |
AWS | Juju AWS Permission, AWS Instance Profiles, Juju on AWS |
Azure | Juju Azure Permission, How to use Juju with Microsoft Azure |
Juju users
It is very important that the different Juju users are set up with minimal permissions depending on the scope of their operations. Please refer to the User access levels documentation for more information on the access level and corresponding abilities that the different users can be granted.
Juju user credentials must be stored securely and rotated regularly to limit the chances of unauthorized access due to credentials leakage.
Applications
In the following, we provide guidance on how to harden your deployment using:
- Operating system
- Security upgrades
- Encryption
- Authentication
- Monitoring and auditing
Operating system
Charmed MongoDB and Charmed Mongos currently run on top of Ubuntu 22.04. Deploy a Landscape Client Charm in order to connect the underlying VM to a Landscape User Account to manage security upgrades and integrate Ubuntu Pro subscriptions.
Security upgrades
Charmed MongoDB and Charmed Mongos install a pinned revisions of the Charmed MongoDB snap, to provide reproducible and secure environments. New versions of Charmed MongoDB and Charmed Mongos may be released to provide patching of vulnerabilities (CVEs). It is important to refresh the charm regularly to make sure the workload is as secure as possible. For more information on how to refresh the charm, see the how-to upgrade guide.
Encryption
In both Charmed MongoDB and Charmed Mongos, encryption is not a requirement to use the database or router, but is a requirement of a hardened system. To do that, you need to relate Charmed MongoDB and Charmed Mongos to one of the TLS certificate operator charms. Please refer to the Charming Security page for more information on how to select the right certificate provider for your use case.
For more information on encryption setup, see the How to enable encryption guide.
Authentication
Charmed MongoDB supports the following authentication layers:
- MongoDB replica/shard/router communication (i.e. Internal Membership)
- KeyFile or TLS
- SASL authentication to MongoDB (SCRAM-based)
Monitoring and Auditing
Charmed MongoDB provides native integration with the Canonical Observability Stack (COS). To reduce the blast radius of infrastructure disruptions, the general recommendation is to deploy COS and the observed application into separate environments, isolated one another. Refer to the COS production deployments best practices for more information.
Refer to How-To user guide for more information on:
Additional Resources
For further information and details on the security and cryptographic specifications used by Charmed MongoDB, please refer to the Security Explanation page.