Google Cloud automatically encrypts all data at rest using the AES-256 algorithm, so stored information is unreadable if a physical disk is stolen. For organizations that need more control, Customer-Managed Encryption Keys (CMEK) let you manage your own keys through Cloud Key Management Service (KMS). With CMEK you control the entire key lifecycle: generating new keys, setting automatic rotation schedules, and disabling or destroying keys when they are no longer needed. This level of control is often required to meet industry regulations and provide audit evidence.
Google uses Envelope Encryption to balance security and performance. A Data Encryption Key (DEK) encrypts the actual data, and that DEK is then wrapped (encrypted) by a Key Encryption Key (KEK), which is stored in Cloud KMS. This approach centralizes key management while keeping the DEK close to the storage for fast access. Cloud KMS Autokey automates key provisioning for different services, creating the required Key Rings and granting permissions to service accounts whenever a new resource is built, ensuring consistent security practices across the organization.
A system architecture showing how a Data Encryption Key (DEK) encrypts data at rest while a Key Encryption Key (KEK) wraps the DEK. The KEK is stored in Cloud KMS, optionally protected by Cloud HSM, with Cloud KMS Autokey automating key provisioning.
Protecting data in transit is equally important. SSL/TLS protocols encrypt information moving between users and databases, making it unreadable to attackers. For higher security, Cloud HSM stores keys in hardware that meets FIPS 140-2 Level 3 standards, adding a physical layer of protection to the encryption process.
Securing cloud databases starts with the Principle of Least Privilege—granting only the minimum permissions needed for each user or service. IAM Group Authentication centralizes database user management so that adding or removing access for many people happens through a single group. Applications should use Service Accounts instead of personal user accounts to limit risk. Additional protections include 2-Step Verification and OS Login to guard against stolen passwords and unauthorized remote access.
A VPC Service Control perimeter acts as a digital wall around sensitive resources, preventing Data Exfiltration—the unauthorized transfer of data outside a secure environment. Inside a Private VPC, databases use private IP addresses to avoid exposure to the public internet. Key networking strategies include Private Google Access (allowing internal resources to reach Google APIs without using public routes), strict Firewall Rules that block all traffic except what is required, and Shared VPC to centralize network configuration across multiple projects.
For developers connecting to database servers, Identity-Aware Proxy (IAP) with TCP forwarding is safer than opening public ports. IAP checks the user’s identity and context-aware signals (such as location or device type) before allowing a connection, eliminating the need for External IP Addresses on sensitive virtual machines and reducing the risk of automated attacks. For on-premises connections, Cloud VPN or Cloud Interconnect provides a dedicated, encrypted tunnel to Google Cloud.
Data protection also requires encryption. Customer-Managed Encryption Keys (CMEK) give organizations control over key rotation and disabling. Databases must use TLS/SSL Certificates to encrypt data in transit. Unified Auditing and Security Command Center help monitor logs for suspicious activities like failed logins or over-privileged grants. For complex applications, a Cloud Service Mesh uses mTLS for mutual authentication between services, ensuring each service proves its identity before communicating. Token Exchange at the network edge swaps long-lived tokens for short-lived ones to prevent replay attacks. When security policies must be bypassed, administrators can use Kubernetes Network Policies for extra protection.
Private connectivity keeps database traffic off the public internet, reducing the risk of external attacks. By using a Private IP, applications communicate with Cloud SQL instances through internal Google Cloud networks, making the database unreachable from outside. During instance creation, the --no-assign-ip flag ensures no public address is assigned, and the --network flag links the instance to a specific Virtual Private Cloud (VPC). Key components for this setup include Shared VPC (multiple projects share a common network), an Allocated IP Range (reserved internal addresses), and Private Service Access (enables private communication between your VPC and Google services).
For even tighter security, the Cloud SQL Auth Proxy provides a secure connection without needing authorized networks. This tool creates a secure tunnel that automatically handles encryption and authentication using IAM credentials. Enforcing SSL/TLS encryption further protects data as it moves between the application and the database.
VPC Service Controls add another layer by creating a security perimeter around resources, preventing data exfiltration by ensuring only authorized requests can access the Cloud SQL Admin API. While perimeters protect the management plane, private networking keeps the actual data traffic isolated. Managing access uses Identity and Access Management (IAM) roles such as Cloud SQL Client, which grants the specific permissions needed to connect. The Security Recommender helps maintain isolation by identifying instances that should have public IP access disabled to comply with company security policies.
Fascinated by the world of cloud databases? Explore the methods for structuring, scaling, and securing database solutions on Google Cloud as you gear up for the Professional Cloud Database Engineer exam!
Prepare and test your skills
Prepare and test your skills
Envelope encryption protects data by using a Data Encryption Key (DEK) to encrypt the actual stored information, and then wrapping that DEK with a Key Encryption Key (KEK) stored in Cloud Key Management Service (Cloud KMS). This strategy centralizes key management while keeping the DEK close to the storage layer for fast performance.
Identity-Aware Proxy (IAP) with TCP forwarding allows users to connect without assigning external IP addresses to virtual machines or opening public ports. It verifies the user's identity and context-aware signals, such as device type or location, before granting access to reduce the risk of automated attacks.
The Cloud SQL Auth Proxy establishes a secure connection by creating a tunnel that automatically handles authentication and encryption using Identity and Access Management (IAM) credentials. This eliminates the need to configure authorized networks while enforcing SSL/TLS encryption for data in transit.
VPC Service Controls create a security perimeter around sensitive resources to block unauthorized data transfers outside the secure environment. This perimeter restricts access at the management plane, ensuring only authorized requests can interact with services like the Cloud SQL Admin API.