Skip to Content
IntegrationsSaaS

Secure MongoDB Atlas with Mondoo

Continuously scan your MongoDB Atlas organization and projects for misconfigurations and security issues.

To connect a MongoDB Atlas organization to Mondoo, you create an organization API key in Atlas and add it to a MongoDB Atlas integration in your space. Mondoo gets read-only access to the organization.

Mondoo adds the organization and every project in it to your space as assets:

  • The MongoDB Atlas Organization asset covers organization-wide identity and access, such as multi-factor authentication, API keys, and federation settings.
  • Each MongoDB Atlas Project asset covers the project's clusters, database users, network access, encryption, backups, and audit logging.

Before you begin

  • Editor or Owner access to the Mondoo space, or another role with permission to add integrations. To see every role, read Roles and permissions.
  • A MongoDB Atlas organization
  • Organization Owner access in Atlas, to create an API key for the organization

Create an Atlas programmatic API key

Mondoo authenticates to the Atlas Administration API with an organization programmatic API key.

  1. Log in to the Atlas console and select your organization.

  2. Open Organization Settings and note the Organization ID. You need it in the next section.

  3. Go to the organization's Access Manager and open API Keys.

  4. Create an API key with a description that identifies it as Mondoo's, and give it the Organization Read Only role. Mondoo only reads configuration, so it doesn't need a role that can make changes.

  5. Copy the public key and the private key. Atlas shows the private key only once.

  6. If your organization requires an IP access list for the Atlas Administration API, add the addresses Mondoo scans from to the key's access list. Otherwise, Atlas rejects Mondoo's requests. Contact Mondoo support for the current addresses.

To learn more, see Grant programmatic access to an organization in the MongoDB Atlas documentation.

Treat the private key like a password. Don't commit it to source control, and rotate it periodically.

Add a MongoDB Atlas integration

You need the Editor or Owner role, or another role with this permission. To see every role, read Roles and permissions.

In the Mondoo App, navigate to the space where you want to add the integration. Some integrations can also be added once at the organization level to cover every space with one connection. To see which ones, read Set up integrations once for your whole organization.

In the space's side navigation bar, select Integrations. In the top right, select INSTALL. On the Install Integration page, find the integration you want by browsing a category or searching by name:

  1. Under SaaS Security, select MongoDB Atlas.

    Add a MongoDB Atlas integration in Mondoo

  2. In the Choose an integration name box, enter a name that identifies the Atlas organization.

  3. In the Provide your MongoDB Atlas organization box, enter the organization ID.

  4. Under Provide a programmatic API key, enter the Public key and the Private key.

  5. (Optional) Under Enable security policies, review the policies that apply to MongoDB Atlas. The Mondoo MongoDB Atlas Security policy checks access control, network exposure, encryption, backup, and audit logging across the organization and its projects. If a policy isn't enabled in the space yet, select ENABLE. A policy you enable here applies to the whole space, not only this integration.

  6. Select CREATE INTEGRATION.

Mondoo starts the first scan as soon as the integration is created. To learn how policies work, read Manage Policies.

Verify the integration

When you select CREATE INTEGRATION, Mondoo starts the first scan and opens the integration's page. Status shows Active once the scan is queued, and Most Recent Activity lists each scan and any errors it reports.

The Integration Details section of an integration page, with the status Active and a SHOW ASSETS button

Mondoo adds the organization and project assets to the space inventory. To review them, navigate to the space and select Inventory. To see how the assets score against the policy, select Findings > Policies and choose Mondoo MongoDB Atlas Security. To learn what each integration status means, read Integration status and troubleshooting.

Troubleshoot

MessageCauseFix
the API key pair was rejected when you create the integrationThe public key and private key don't belong to the same API key, or the key was deleted.Enter both halves of one API key. If you no longer have the private key, create a new API key.
Scans are paused at the top of the integration pageThe integration's API key was rejected by Atlas.Create a new API key and rotate it in Mondoo.
ended in a scan error, so their results are missing in Most Recent ActivityThe API key doesn't have the Organization Read Only role.The message names the most common error. Give the key the role described in Create an Atlas programmatic API key.

Manage your integration

To open the integration, navigate to the space, select Integrations > MongoDB Atlas, and choose the integration.

From the integration detail page, you can:

  • Scan now. Select RUN.
  • Pause or resume scanning. Select the more actions menu, then Pause or Resume.
  • Edit settings. Select the pencil icon to rename the integration. If the integration stores its own API key, you can also rotate the key here. The organization ID is read-only.
  • Remove the integration. Select the trash can icon and confirm. Mondoo stops scanning the Atlas organization.

Rotate the API key

How you replace the key depends on how Mondoo stored it when the integration was created. Integrations added by someone with permission to create and view credentials store the key as a credential. Older integrations, and integrations added by someone without that permission, keep the key on the integration.

The public and private key rotate together, so in either case enter both halves of the new key.

  • If the integration uses a credential: The integration detail page shows a Credential section, and the edit form shows Managed by a credential in place of the key boxes. Select the credential's name to open it, then select Rotate and enter the new key. Every integration that uses the credential switches to the new key. To learn more, read Manage Integration Credentials.

    The Credential section of an integration page, showing a Healthy credential, its expiry date, and when it was last tested

  • If the integration stores its own key: Select the pencil icon. Under Rotate the programmatic API key, enter the public key and private key of the new API key, then select SAVE CHANGES.

Scan MongoDB Atlas from the command line

The integration scans continuously from the Mondoo Platform. To scan MongoDB Atlas from your workstation or a CI pipeline instead, see Secure MongoDB Atlas with cnspec.

Next steps

Last updated on

On this page