Objective. Students will design and implement a secure network topology that places a managed database in a private subnet accessible only through defined private endpoints and security groups.
This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.
VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.
A database is the most valuable asset in most organizations. Placing it on a network without careful controls is the single most common cause of large-scale data breaches. This lesson focuses on three tools that, used together, create a layered defense: Virtual Private Clouds (VPCs) / Virtual Networks (VNets), private endpoints, and security groups / firewall rules. These concepts apply directly to the Microsoft DP-300 exam, the DAMA CDMP Associate data-governance body of knowledge, and real-world DBA practice on AWS and Azure.
A Virtual Private Cloud (VPC) in AWS—or a Virtual Network (VNet) in Azure—is a logically isolated section of a cloud provider's network that you define. You choose the IP address range (expressed as a CIDR block, such as `10.0.0.0/16`), divide it into subnets, and decide which subnets can reach the public internet and which cannot.
Keeping the database in a private subnet is the foundational control. Without it, all other security measures are far less effective.
A security group is a stateful virtual firewall attached to a resource (such as an RDS instance or a virtual machine). Rules specify allowed traffic by protocol, port, and source. Because security groups are stateful, return traffic for an allowed connection is automatically permitted without a separate outbound rule.
Best practice: never open a database port (for example, PostgreSQL port 5432 or SQL Server port 1433) to `0.0.0.0/0` (all internet addresses). Instead, write the inbound rule so that the source is the security group ID of your application tier—not an IP address range. This means only resources attached to the application-tier security group can reach the database, even if IP addresses change.
Network ACLs (AWS) operate at the subnet level and are stateless—both inbound and outbound rules must be written explicitly. They add a second layer but are harder to manage precisely. For most DBA work, security groups provide the primary control.
Even within a private subnet, a managed cloud database service (like Azure SQL Database) may, by default, still have a public endpoint—a DNS name that resolves to a public IP. Private endpoints solve this. A private endpoint creates a network interface inside your VNet or VPC with a private IP address that maps directly to the managed service. Traffic between your application and the database never leaves the provider's backbone network.
In Azure, enabling a private endpoint also allows you to disable public access entirely on the Azure SQL Database resource. After that, connection attempts from any IP outside the VNet will be refused at the network layer, regardless of firewall rules.
In AWS, Amazon RDS placed in a private subnet without a public IP achieves a similar result. You can also use VPC endpoints (AWS PrivateLink) for supporting services such as Secrets Manager or S3.
1. Publicly accessible database: The instance has a public IP or public endpoint enabled, and the security group allows inbound traffic on the database port from `0.0.0.0/0`. Any attacker can attempt to connect. Remediation: move to a private subnet, disable public access, and restrict source in security group rules.
2. Overly permissive inbound rules: The database is in a private subnet, but the inbound security group rule allows the entire VPC CIDR (for example, `10.0.0.0/16`) rather than only the application-tier security group. Any compromised resource anywhere in the VPC can reach the database. Remediation: replace the CIDR source with the specific application-tier security group ID.
3. Unencrypted transit: Traffic between the application and the database travels over the private network but without TLS/SSL. An attacker with access to the network path (or packet-capture tools such as Wireshark) can read queries and result sets in plaintext. Remediation: enforce TLS on the database listener and require encrypted connections in the application connection string. NIST SP 800-53 control SC-8 addresses transmission confidentiality and integrity.
Cloud network configuration changes can disrupt production services. Before changing any security group or firewall rule in a production environment, follow your organization's change-management process: document the change, obtain approval, schedule a maintenance window, and prepare a rollback plan. Treat credential files (such as AWS access keys or Azure service principal secrets) used in CLI labs as sensitive—never commit them to a source-code repository. When working with Wireshark or any packet-capture tool, capture traffic only on networks and systems you are authorized to inspect; unauthorized interception violates federal law (the Electronic Communications Privacy Act) and most acceptable-use policies.
The Microsoft DP-300 exam (Administering Relational Databases on Microsoft Azure) directly tests private endpoint configuration, VNet integration, and firewall rules for Azure SQL Database. The DAMA CDMP Associate exam covers data security principles including access control and network protection as part of the Data Security knowledge area. PostgreSQL CE (EDB) candidates should understand how `pg_hba.conf` host-based authentication interacts with network-layer controls—network controls stop unauthorized connections before PostgreSQL ever sees them.
Answer each question, then check it. Nothing is recorded; this is your own practice.
A free tech program — complimentary, as our commitment to get America working. Help us build VoTechWorks. Tell us what works, what doesn’t, and what you want to learn.