The alert fired at 2:03 a.m. A service account was leaking database credentials, and the logs showed probing from an unfamiliar IP. The breach path was clear: database access controls had been bolted on too late.
This is why GCP database access security must shift left. The old model pushes security to the deployment or operations stage. By then, IAM roles, network rules, and secrets management are already entangled in production. Every fix is a risk.
Shifting left means defining GCP database access policies during development. Configure Cloud SQL IAM bindings, use private IP from the first build, and bind service accounts with the minimum roles needed. Enforce database access via Identity-Aware Proxy or VPC Service Controls before a single query runs.
When database access governance is embedded into CI/CD, you can automate least-privilege checks, block insecure schema migrations, and validate TLS settings before merge. A pull request should fail if it introduces broad roles like roles/cloudsql.client without scoping to specific resources. Security tests must run with the same weight as unit tests.