AWS and Azure Database Security: Encryption, Access Control, Network Isolation and Governance
Design database security across private access, IAM/Entra authentication, least privilege, encryption, secrets, audit and protected recovery paths.
Database security requires several controls working together: reachable networks, authenticated identities, narrowly scoped permissions, encryption, audit and recoverable data. A private address or an encrypted disk alone cannot establish the whole design.
AWS and Azure manage parts of the infrastructure, but organizations still own access decisions, application credentials, data permissions, network policy and recovery requirements.
This guide addresses technical controls and evidence; product support varies by engine, version and tier. Any monetary example uses illustrative USD assumptions.
1. Separate the control plane from database access
The control plane creates, modifies or deletes cloud resources. The data plane handles database logins and queries. Permission to view an instance in a console is not permission to read its tables, and a database administrator should not automatically control backup deletion or key destruction.
| Layer | Question |
|---|---|
| Network | Can the client reach the intended listener? |
| Authentication | Which human or workload identity is connecting? |
| Authorization | What may that identity read, change or administer? |
| Encryption | Are data and keys protected in storage and transit? |
| Audit | Can relevant activity be investigated and attributed? |
| Recovery | Can authorized responders recover protected data? |
Keep these boundaries visible when troubleshooting. Opening the network to fix an authentication error can create exposure without solving the login problem.
2. Public exposure and private connectivity
For RDS/Aurora, review public accessibility, subnet routing and security groups. Permit only required sources and ports. A broadly allowed listener remains a risk even when the application normally connects from inside a VPC.
An RDS API interface endpoint provides private access to management API operations. It is not the database engine’s SQL connection endpoint. AWS explicitly distinguishes these in its RDS PrivateLink documentation.
Azure SQL Database Private Endpoints provide a private access path with DNS requirements. Creating one does not automatically disable public access. Review the logical server’s public-network setting and firewall rules. Managed Instance uses a different networking model; do not copy every SQL Database endpoint procedure onto it.
Use the supported server FQDN in connection strings. For Azure SQL Database, connecting directly to the private IP or substituting the private-link hostname is not equivalent to using the normal server name. See Azure SQL Private Link.
3. IAM authentication versus database credentials
RDS IAM database authentication supports eligible MariaDB, MySQL and PostgreSQL versions. A signed token replaces a static password for establishing the connection; its 15-minute lifetime does not terminate an already established database session.
The database user and privileges still need configuration. An IAM policy granting an RDS management operation does not grant arbitrary SQL SELECT permissions. See IAM database authentication.
Do not generalize that mechanism to RDS SQL Server or Oracle. Engine-specific authentication, directory integration and service constraints need their own assessment.
IAM tokens require a compatible driver, TLS and appropriate identity permissions. Connection churn, token generation and pool behavior should be load-tested; moving to tokens does not remove the database’s connection limit.
4. Microsoft Entra authentication and least privilege
Microsoft Entra authentication supports centralized human and workload identity for Azure SQL. Managed identities can remove application-managed passwords, but a database principal and the correct permissions remain necessary.
For people, use individual identities or governed groups and appropriate conditional access. For services, use supported workload credentials and token renewal rather than designing around an interactive MFA prompt.
Separate application read/write roles, schema migration roles, operational access and emergency administration. A runtime application rarely needs to create logins, change audit policy or drop every table.
Review ownership, privilege changes and dormant access periodically. Disabling a human identity does not necessarily remove every independent SQL credential the person once created.
5. Encryption at rest and in transit
RDS encryption uses KMS for supported encrypted resources. Logs, replicas, automated backups and snapshots have related encryption behavior and constraints. Confirm key access in backup-copy and cross-account/region recovery paths.
Azure SQL TDE can use service-managed or customer-managed protection. Customer-managed TDE uses a protector in Key Vault or Managed HSM and introduces key lifecycle and permission responsibilities. See customer-managed TDE.
Encryption at rest protects stored media; it does not prevent a valid overprivileged login from reading decrypted data. Apply database permissions separately.
Enforce supported TLS and certificate validation on the client path. Do not disable hostname validation simply to make a private endpoint connect. Plan certificate rotation and test old clients before a provider certificate update.
6. Key and secret lifecycle is an availability dependency
Customer-managed keys provide control and separation of duties. Losing or revoking access to a required key can make a database or backup unavailable. Maintain the key versions and authorized access needed for retained recovery points.
Protect key deletion and recovery according to approved policy. Separate key administration from database access where practical. Test a recovery scenario involving the actual destination identity, rather than assuming an encrypted copy can always be opened elsewhere.
Where passwords remain necessary, use an approved secret store, scoped retrieval and a tested rotation process. Rotation must update consumers and handle existing pools. A newly rotated password stored in one system is insufficient if the application continues reconnecting with an old value.
Avoid credentials in source control, connection-string logs, exported diagnostics or migration scripts. Temporary migration accounts also need expiry and privilege removal.
7. Audit database activity, not only cloud API calls
CloudTrail and Azure Activity Log record relevant control-plane activity. They are not complete logs of every database query. Enable the engine/service audit path needed to investigate data access and permission changes.
Choose relevant events, destination, integrity, retention and access controls. Query text and parameters can themselves contain sensitive information, so logging policy must protect the evidence.
For a hypothetical monthly audit design, 300 GB of ingestion at $0.50/GB costs $150, retained storage at an assumed $18, queries at $20 and key/secret services at $5: $193 before networking and other components.
The goal is appropriate evidence, not zero logging. Filter unnecessary noise and use suitable retention tiers while preserving investigation and business requirements.
8. Protect backups and production access
A compromised administrator should not automatically be able to delete the database, every backup and all recovery keys. Use separation of duties and supported protected-copy/immutability mechanisms, checking the precise database integration.
Treat read replicas as copies of sensitive data. Apply network, identity and audit controls in every region, including test restores and temporary migration targets.
Use approved, attributable production access with time-bounded elevation where supported. Maintain a tested emergency path and record its use. A control that locks responders out during recovery is incomplete.
The database recovery guide explains why retained history and working keys matter alongside HA.
9. Demonstrate governance with evidence
| Requirement | Useful evidence |
|---|---|
| Restricted exposure | Listener settings, routes, rules and tested allowed/denied paths |
| Least privilege | Role assignments, database grants and access reviews |
| Encryption | Service settings, TLS tests and key policy |
| Attributable activity | Database audit and control-plane records |
| Recovery | Successful restore/failover exercise and key access |
| Change control | Reviewed migrations, approvals and rollback procedure |
A managed database’s certification does not automatically establish that your application configuration satisfies its obligations. Map the chosen controls to organizational requirements and keep evidence current.
Reassess after new replicas, endpoints, identities, engines, migration tools or retention policies are introduced.
10. How CloudVectra complements database controls
CloudVectra Cloud Security describes scheduled AWS/Azure posture assessment, exposed-resource and permission findings, and ownership-based follow-up. Cost analysis provides spending context for security and supporting services.
Combine those views with database-native enforcement, audit and recovery tools. A posture finding can initiate an owned review; engine-specific access tests and evidence establish whether the database is correctly protected.
Continue the database series
- - Previous: Queries, connections and indexes
- - Next: Redshift, Synapse and Fabric
- - All database and analytics articles