LevelBlue Completes Acquisition of Trustwave to Form the World's Largest Pure-Play MSSP.  Learn More

LevelBlue Completes Acquisition of Trustwave to Form the World's Largest Pure-Play MSSP.  Learn More

Services
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Offensive Security
Solutions to maximize your security ROI
Operational Technology
End-to-end OT security
Microsoft Security
Unlock the full power of Microsoft Security
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Microsoft Security
Unlock the full power of Microsoft Security
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats

Understanding DocumentDB’s Network Security Trade-Offs: The VPC Challenge

AWS DocumentDB by default is securely isolated within a VPC, unreachable from the public internet, what could be more secure? This security architecture can create unexpected challenges and complexity. The root cause? The very VPC isolation designed to protect DocumentDB can introduce a complex web of networking requirements, operational considerations, and architectural decisions that require careful management to maintain security.

Understanding VPC Isolation: Benefits and Challenges

AWS designed DocumentDB’s VPC-only deployment as a key security feature, and the security benefits are real: your database is isolated in a private AWS network, unreachable from the public internet, and protected by AWS enterprise-grade networking infrastructure. However, like many security measures, VPC isolation involves trade-offs that organizations need to understand and manage diligently. The challenge is not that VPC is inherently problematic; it is that the networking requirements it creates can introduce complexity that, if not properly managed, may create new security considerations.

 

The SSH Tunnel Connection Challenge

Since DocumentDB operates exclusively within VPCs, accessing it from outside AWS requires careful planning. AWS recommends SSH tunneling as one approach for external connectivity, but this solution requires thoughtful implementation to maintain security.

 

The Standard SSH Tunnel Pattern

The most common approach for connectivity is using a bastion EC2 instance to access the DocumentDB in an isolated VPC.

Method 1:

ssh -i your-key.pem ec2-user@bastion-host-ip  
mongosh docdb.cluster-endpoint.amazonaws.com:27017 --tls --tlsCAFile tls-budle.pem
retryWrites=false --username aduser --password ****


Method 2:

ssh -i your-key.pem -L 27017:docdb-cluster-endpoint:27017 ec2-user@bastion-host-ip -N  
mongosh --host localhost:27017 --username dbuser --password ** --tls --tlsCAFile tls-budle.pem

While the above approach enables secure connectivity, it also introduces networking complexity that requires careful security considerations.

 

Security considerations with SSH tunneling

1. Bastion Host Security Requirements

The bastion host becomes a critical component in your security architecture. A properly secured bastion host is essential, with regular security updates, monitoring, and hardening required. Some of the security considerations include:

  • Credential management for SSH keys and access control
  • Network monitoring for unusual access patterns
  • Regular security updates and vulnerability management
  • Audit trail management for compliance requirements

Anticipate and adapt with resilient data protection from Trustwave Database Security.

Learn More

2. Monitoring and Tooling Integration

Monitoring tools and database management utilities need special consideration with VPC-isolated databases. Use dedicated monitoring infrastructure within VPC, implement secure credential management, and establish network paths. Recommended approaches include:

  • VPC monitoring infrastructure like VPC Flow Logs and Traffic Mirroring
  • Secure credential management services like Secrets Manager and Lambda
  • Clear network architecture
  • Regular review of monitoring access and permissions

 

Security Group Configuration: Managing Complexity

DocumentDB, as hosted in an isolated VPC, is heavily reliant on Security Groups for fine-grained network control and requires careful configuration to maintain the principle of least privilege.

 

Avoiding Overly Permissive Configurations

DocumentDB and other resources benefit from starting within a restrictive security group. It is also recommended to have specific and targeted access, avoiding broad network access unless specifically required.

Example:

aws ec2 authorize-security-group-ingress --group-id sg-DocumentDB-1 --protocol tcp --port 27017 --source-group sg-specific


Best practices include:

  • Applying the principle of least privilege for network access
  • Regular review and audit of security rules, tracking configuration changes using tools like AWS Config
  • Documenting access requirements and justifications

 

Managing Multi-VPC Architectures

If an organization is using multiple VPCs, additional networking considerations apply. Choose between VPC Peering (for low latency and 2–3 VPCs) or Transit Gateway, and consider the security implications of each connection.

Example:

aws ec2 create-vpc-peering-connection --vpc-id VPC-1 --peer-vpc-id VPC-2


Real-world DocumentDB deployments can develop complex security group configurations. Considerations include:

  • Clear naming conventions and descriptions for security groups
  • Regular audit processes for security group rules
  • Infrastructure as Code (like AWS CloudFormation) for consistent configuration
  • Change management processes for security group modifications, tracking changes using AWS Config

 

Conclusion: Understanding VPC Trade-offs

DocumentDB’s VPC isolation provides important security benefits through network-level protection and integration with AWS security services. However, like any architectural decision, it involves trade-offs that organizations need to understand and manage effectively. Key considerations include:

  • VPC isolation provides real security benefits when properly configured and managed
  • Networking complexity requires planning and expertise to implement securely
  • Operational processes are essential for maintaining secure configurations over time

DocumentDB’s VPC approach can provide excellent security when it matches your needs and when your team can implement and maintain it effectively.

ABOUT TRUSTWAVE

Trustwave, A LevelBlue Company, is a globally recognized cybersecurity leader that reduces cyber risk and fortifies organizations against disruptive and damaging cyber threats. Our comprehensive offensive and defensive cybersecurity portfolio detects what others cannot, responds with greater speed and effectiveness, optimizes client investment, and improves security resilience. Learn more about us.

Latest Intelligence

Discover how our specialists can tailor a security program to fit the needs of
your organization.

Request a Demo