Governance and Data Protection on GCP: Organization Policies, Cloud KMS, Secret Manager, Audit Logs and DLP

Google Cloud Platform Architect 55 min min read Updated: Nov 17, 2026 Intermediate
Governance and Data Protection on GCP: Organization Policies, Cloud KMS, Secret Manager, Audit Logs and DLP
Intermediate Topic 2 of 3

Guardrails: Organization Policy

IAM says who can act. Organization Policy says what is allowed at all, no matter who asks. Policies attach at the organization, folder or project level and are inherited.

ConstraintWhat it does
constraints/gcp.resourceLocationsAllow resources only in chosen regions (data residency)
constraints/iam.disableServiceAccountKeyCreationStop key file creation
constraints/compute.vmExternalIpAccessBlock public IPs on VMs
constraints/storage.uniformBucketLevelAccessForce uniform bucket access
constraints/iam.allowedPolicyMemberDomainsOnly your domain can be granted access
constraints/compute.requireShieldedVmRequire Shielded VMs
bash gcloud resource-manager org-policies enable-enforce constraints/iam.disableServiceAccountKeyCreation --organization=987654321 gcloud org-policies list --project=my-proj

Encryption

  • At rest: Google encrypts all customer data by default with Google-managed keys
  • In transit: TLS between you and Google and between Google services
  • Envelope encryption: data is encrypted with a data key, and the data key is encrypted by a key in KMS
Key optionWho manages the keyUse when
Google-managed (default)GoogleMost workloads
CMEK (customer-managed, Cloud KMS)You control rotation, disable, destroyCompliance asks for key control
CMEK with Cloud HSMKeys in hardware security modulesStricter assurance
Cloud EKMKeys stay in an external key managerKeys must remain outside Google
CSEKYou supply the key on each requestRare, limited products

Cloud KMS in Practice

bash gcloud kms keyrings create app-ring --location=asia-south1 gcloud kms keys create data-key --keyring=app-ring --location=asia-south1 --purpose=encryption --rotation-period=90d --next-rotation-time=2027-02-01T00:00:00Z # Use it as CMEK for a bucket gcloud storage buckets update gs://reports --default-encryption-key=projects/my-proj/locations/asia-south1/keyRings/app-ring/cryptoKeys/data-key # Let the Cloud Storage service agent use the key gcloud kms keys add-iam-policy-binding data-key --keyring=app-ring --location=asia-south1 \ --member="serviceAccount:service-123456789@gs-project-accounts.iam.gserviceaccount.com" --role="roles/cloudkms.cryptoKeyEncrypterDecrypter"
  • Key rings and keys are in a location that should match the data
  • Separate key admins from key users
  • Destroying a key makes data unreadable (there is a scheduled destruction delay as a safety net)

Secret Manager

bash printf 's3cr3t-password' | gcloud secrets create db-password --data-file=- --replication-policy=automatic gcloud secrets versions access latest --secret=db-password gcloud secrets add-iam-policy-binding db-password --member="serviceAccount:report-app@my-proj.iam.gserviceaccount.com" --role="roles/secretmanager.secretAccessor"
  • Store passwords, API keys, certificates here, not in code, images or environment files
  • Versions allow rotation and rollback
  • Cloud Run and GKE can mount secrets directly

Audit Logs

Log typeContentDefault
Admin ActivityChanges to configuration (create VM, change IAM)Always on, free
Data AccessReads and writes of dataOff for most services (turn on where needed), may cost
System EventGoogle system actionsAlways on
Policy DeniedAccess blocked by security policyOn

Send logs to a log bucket, BigQuery or Cloud Storage with a sink, and keep them in a separate security project.

Sensitive Data Protection (DLP)

  • Finds and protects personal data such as card numbers, emails and national IDs in Cloud Storage, BigQuery and Datastore
  • Actions: inspect, mask, tokenize, de-identify
  • Useful for PII handling and privacy compliance

Compliance Basics

  • Google Cloud has certifications such as ISO 27001, SOC 2, PCI DSS and supports HIPAA with a signed agreement. You still must configure services correctly
  • Assured Workloads applies controls for regulated sectors
  • Download audit reports from the Compliance Reports Manager
  • Use Access Transparency and Access Approval to see and approve Google staff access in sensitive cases

Practice

  1. Apply an organization policy limiting resources to one region
  2. Create a key and a bucket that uses it as CMEK
  3. Store a password in Secret Manager and read it from a VM
  4. Turn on Data Access logs for Cloud Storage and read one entry
  5. Run a DLP inspection on a sample file

Conclusion

Organization Policy sets guardrails, Cloud KMS gives key control, Secret Manager keeps secrets out of code, audit logs record activity and DLP finds sensitive data. Combine them for governance and compliance.

Quick Summary: org policy; encryption; KMS; secrets; audit logs; DLP; compliance.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators