Simplify Security At Scale with Resource Policies in MongoDB Atlas
Innovation is the gift that keeps on giving: industries that are more innovative have higher returns, and more innovative industries see higher rates of long-term growth
1
. No wonder organizations everywhere strive to innovate. But in the pursuit of innovation, organizations can struggle to balance the need for
speed and agility
with critical security and compliance requirements.
Specifically, software developers need the freedom to rapidly provision resources and build applications. But manual approval processes, inconsistent configurations, and security errors can slow progress and create unnecessary risks.
Friction that slows down employees and leads to insecure behavior is a significant driver of insider risk.
Paul Furtado Vice President, Analyst, Gartner
Enter
resource policies
, which are now available in public preview in MongoDB Atlas. This new feature balances rapid innovation with robust security and compliance. Resource policies allow organizations to enable developers with self-service access to Atlas resources while maintaining security through automated, organization-wide ‘guardrails’.
What are resource policies?
Resource policies help organizations enforce security and compliance standards across their entire Atlas environment. These policies act as guardrails by creating organization-wide rules that control how Atlas can be configured. Instead of targeting specific user groups, resource policies apply to all users in an organization, and focus on governing a particular resource.
Consider this example: An organization subject to General Data Protection Regulation (GDPR)
2
requirements needs to ensure that all of their Atlas clusters run only on approved cloud providers in regions that comply with data residency and privacy regulations. Without resource policies, developers may inadvertently deploy clusters on any cloud provider. This risks non-compliance and potential
fines of up to 20 million euros or 4% of global annual turnover
according to article 83 of the GDPR.
But, by using resource policies, the organization can mandate which cloud providers are permitted, ensuring that data resides only in approved environments. The policy is automatically applied to every project in the organization, preventing the creation of clusters on unauthorized cloud platforms. Thus compliance with GDPR is maintained.
The following resource policies are now in public preview:
Restrict cloud provider:
Limit Atlas clusters to approved cloud providers (AWS, Azure, Google Cloud).
Restrict cloud region:
Restrict cluster deployments in approved cloud providers to specific regions.
Block wildcard IP:
Reduce security risk by disabling the use of 0.0.0.0/0 (or “wildcard”) IP address for cluster access.
How resource policies enable secure self-service Atlas access
Resource policies address the challenges organizations face when trying to balance developer agility with robust security and compliance. Without standardized controls, there is a risk that developers will configure Atlas clusters to deviate from corporate or external requirements. This invites security vulnerabilities and compliance gaps. Manual approval and provisioning processes for every new project creates delays. Concurrently, platform teams struggle to enforce consistent standards across an organization, increasing operational complexity and costs.
With resource policies, security and compliance standards are automatically enforced across all Atlas projects. This eliminates manual approvals and reduces the risk of misconfigurations. Organizations can deliver self-service access to Atlas resources for their developers. This allows them to focus on building applications instead of navigating complex internal review and compliance processes. Meanwhile, platform teams can manage policies centrally. This ensures consistent configurations across the organization and frees time for strategic initiatives.
The result is a robust security posture, accelerated innovation, and greater efficiency. Automated guardrails prevent unauthorized configurations. Concurrently, centralized policy management streamlines operations and ensures alignment with corporate and external standards. Resource policies enable organizations to scale securely and innovate without compromise. This empowers developers to move quickly while simplifying governance.
Creating resource policies
Atlas resource policies are defined using the open-source
Cedar policy language
, which combines expressiveness with simplicity. Cedar’s concise syntax makes writing and understanding policies easy, streamlining policy creation and management. Resource policies can be created and managed programmatically through infrastructure-as-code tools like Terraform or CloudFormation, or by integrating directly using the Atlas Admin API.
To explore what constructing a resource policy looks like in practice, let’s return to our earlier example. This is an organization subject to GDPR requirements that wants to ensure all of their Atlas clusters run on approved cloud providers only.
To prevent users from creating clusters on Google Cloud (GCP), the organization could write the following policy named “
Policy Preventing GCP Clusters
.” This policy forbids creating or editing a cluster when the cloud provider is Google Cloud. The body defines the behavior of the policy in the human and machine-readable Cedar language. If required, ‘
gcp
’ could be replaced with ‘
aws
’.
Figure 1.
Example resource policy preventing the creation of Atlas clusters on GCP.
Alternatively, the policy could allow users to create clusters only on Google Cloud with the following policy named “Policy Allowing Only GCP Clusters”. This policy uses the Cedar clause “unless” to restrict creating or editing a cluster unless it is on GCP.
Figure 2.
Example resource policy that restricts cluster creation to GCP only.
Policies can also have compound elements. For example, an organization can create a project-specific policy that only enforces the creation of clusters in GCP for the Project with ID
6217f7fff7957854e2d09179
.
Figure 3.
Example resource policy that restricts cluster creation to GCP only for a specific project.
And, as shown in Figure 4, another policy might restrict cluster deployments on GCP as well as on two unapproved AWS regions: US-EAST-1 and US-WEST-1.
Figure 4.
Example resource policy restricting cluster deployments on GCP as well as AWS regions US-EAST-1 and US-WEST-1.
Getting started with resource policies
Resource policies
are available now in MongoDB Atlas in public preview. Get started creating and managing resource policies programmatically using infrastructure-as-code tools like Terraform or CloudFormation. Alternatively, integrate directly with the Atlas Admin API. Support for managing resource policies in the Atlas user interface is expected by mid-2025. Use the resources below to learn more about resource policies.
Feature documentation
Postman Collection
Atlas Administration API documentation
Terraform Provider documentation
AWS CDK
AWS Cloud Formation documentation
1
McKinsey & Company
, August 2024
2
gdpr.eu
February 10, 2025