1οΈβ£2οΈβ£ Security - Overview¶
Learn how to secure applications on Google Cloud Platform.
π Table of Contents¶
- Introduction
- Security Layers
- Security Services
- Decision Framework
- Architecture Patterns
- Compliance
- Quick Reference
Introduction¶
GCP provides multiple layers of security to protect your applications, data, and infrastructure.
Security Stack¶
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Security Layers β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Identity & Access (IAM, Identity Platform) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Network Security (VPC, Firewall, Armor) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Data Protection (KMS, Secret Manager) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Threat Detection (SCC, Chronicle) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Security Layers¶
1. Identity & Access Management¶
Control who can access what resources
βββββββββββββββββββββββββββββββββββββββ
β Identity & Access β
βββββββββββββββββββββββββββββββββββββββ€
β Components: β
β β’ Cloud IAM β
β β’ Service Accounts β
β β’ Identity Platform β
β β’ Identity-Aware Proxy β
β β’ Workload Identity β
βββββββββββββββββββββββββββββββββββββββ€
β Capabilities: β
β β’ Fine-grained permissions β
β β’ Role-based access control β
β β’ Multi-factor authentication β
β β’ Single sign-on β
βββββββββββββββββββββββββββββββββββββββ
Key Concepts: - Principle of least privilege - Service accounts for applications - Workload identity for GKE - IAM conditions for context-aware access
2. Network Security¶
Protect network traffic and prevent attacks
βββββββββββββββββββββββββββββββββββββββ
β Network Security β
βββββββββββββββββββββββββββββββββββββββ€
β Components: β
β β’ VPC & Subnets β
β β’ Firewall Rules β
β β’ Cloud Armor (DDoS, WAF) β
β β’ VPC Service Controls β
β β’ Private Google Access β
βββββββββββββββββββββββββββββββββββββββ€
β Capabilities: β
β β’ Network isolation β
β β’ DDoS protection β
β β’ Web application firewall β
β β’ Private connectivity β
βββββββββββββββββββββββββββββββββββββββ
Key Concepts: - Defense in depth - Zero trust networking - Private service access - Perimeter security
3. Data Protection¶
Encrypt and protect sensitive data
βββββββββββββββββββββββββββββββββββββββ
β Data Protection β
βββββββββββββββββββββββββββββββββββββββ€
β Components: β
β β’ Cloud KMS (Key Management) β
β β’ Secret Manager β
β β’ Data Loss Prevention (DLP) β
β β’ Encryption at rest β
β β’ Encryption in transit β
βββββββββββββββββββββββββββββββββββββββ€
β Capabilities: β
β β’ Key management β
β β’ Secret storage β
β β’ Sensitive data detection β
β β’ Automatic encryption β
βββββββββββββββββββββββββββββββββββββββ
Key Concepts: - Encryption by default - Customer-managed keys (CMEK) - Secret rotation - Data classification
4. Threat Detection & Response¶
Detect and respond to security threats
βββββββββββββββββββββββββββββββββββββββ
β Threat Detection & Response β
βββββββββββββββββββββββββββββββββββββββ€
β Components: β
β β’ Security Command Center β
β β’ Chronicle (SIEM) β
β β’ Event Threat Detection β
β β’ Web Security Scanner β
β β’ Binary Authorization β
βββββββββββββββββββββββββββββββββββββββ€
β Capabilities: β
β β’ Vulnerability scanning β
β β’ Threat intelligence β
β β’ Security analytics β
β β’ Incident response β
βββββββββββββββββββββββββββββββββββββββ
Key Concepts: - Continuous monitoring - Automated threat detection - Security posture management - Incident response
Security Services¶
Service Matrix¶
| Service | Purpose | Use Case | Cost |
|---|---|---|---|
| Cloud IAM | Access control | All resources | Free |
| Secret Manager | Secret storage | API keys, passwords | $0.06/secret/month |
| Cloud KMS | Key management | Encryption keys | $0.06/key/month |
| Cloud Armor | DDoS/WAF protection | Web applications | $5/policy/month |
| Security Command Center | Security posture | Enterprise security | Varies |
| VPC Service Controls | Perimeter security | Data exfiltration prevention | Free |
| Identity Platform | User authentication | Customer-facing apps | Free tier available |
| Binary Authorization | Container security | GKE deployments | Free |
Decision Framework¶
Security Service Selection¶
What do you need to secure?
|
ββ> User access?
| ββ> Internal users β Cloud IAM
| ββ> External users β Identity Platform
|
ββ> Secrets/Keys?
| ββ> Application secrets β Secret Manager
| ββ> Encryption keys β Cloud KMS
|
ββ> Network traffic?
| ββ> DDoS protection β Cloud Armor
| ββ> Data exfiltration β VPC Service Controls
|
ββ> Overall security posture?
ββ> Security Command Center
Architecture Patterns¶
Pattern 1: Defense in Depth¶
Internet
|
v
βββββββββββββββββββββββ
β Cloud Armor β <-- DDoS/WAF Protection
β (DDoS Protection) β
ββββββββββββ¬βββββββββββ
v
βββββββββββββββββββββββ
β Cloud Load β
β Balancer (HTTPS) β
ββββββββββββ¬βββββββββββ
v
βββββββββββββββββββββββ
β Identity-Aware β <-- Authentication
β Proxy (IAP) β
ββββββββββββ¬βββββββββββ
v
βββββββββββββββββββββββ
β VPC Firewall β <-- Network Security
ββββββββββββ¬βββββββββββ
v
βββββββββββββββββββββββ
β Application β <-- Application Security
β (Cloud Run/GKE) β
ββββββββββββ¬βββββββββββ
v
βββββββββββββββββββββββ
β Database β <-- Data Encryption
β (Encrypted) β
βββββββββββββββββββββββ
Pattern 2: Zero Trust Architecture¶
βββββββββββββββββββββββββββββββββββββββ
β VPC Service Controls β
β (Security Perimeter) β
βββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββββββββββββββ β
β β Private Google Access β β
β ββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββ β
β β Workload Identity β β
β β (No service account keys) β β
β ββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββ β
β β IAM Conditions β β
β β (Context-aware access) β β
β ββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββ
Pattern 3: Secrets Management¶
Application
|
v
βββββββββββββββββββββββ
β Secret Manager β
β β’ API Keys β
β β’ Passwords β
β β’ Certificates β
ββββββββββββ¬βββββββββββ
|
(Encrypted with)
v
βββββββββββββββββββββββ
β Cloud KMS β
β β’ Encryption Keys β
β β’ Key Rotation β
βββββββββββββββββββββββ
Pattern 4: Container Security¶
Developer
|
v
βββββββββββββββββββββββ
β Source Code β
ββββββββββββ¬βββββββββββ
v
βββββββββββββββββββββββ
β Cloud Build β
β β’ Vulnerability β
β Scanning β
ββββββββββββ¬βββββββββββ
v
βββββββββββββββββββββββ
β Artifact Registry β
β β’ Signed Images β
ββββββββββββ¬βββββββββββ
v
βββββββββββββββββββββββ
β Binary β
β Authorization β <-- Policy Enforcement
ββββββββββββ¬βββββββββββ
v
βββββββββββββββββββββββ
β GKE Cluster β
β β’ Workload Identityβ
β β’ Network Policies β
βββββββββββββββββββββββ
Compliance¶
Certifications & Standards¶
GCP complies with major security and privacy standards:
Global Standards: - ISO/IEC 27001, 27017, 27018 - SOC 1, 2, 3 - PCI DSS - HIPAA - FedRAMP
Regional Standards: - GDPR (Europe) - CCPA (California) - PIPEDA (Canada) - LGPD (Brazil)
Compliance Tools¶
# Enable Security Command Center
gcloud services enable securitycenter.googleapis.com
# Run compliance scan
gcloud scc findings list ORGANIZATION_ID \
--filter="category='COMPLIANCE_VIOLATION'"
# Export audit logs
gcloud logging sinks create audit-logs-sink \
bigquery.googleapis.com/projects/PROJECT_ID/datasets/audit_logs \
--log-filter='logName:"cloudaudit.googleapis.com"'
Quick Reference¶
Secret Manager¶
# Create secret
echo -n "my-secret-value" | gcloud secrets create my-secret \
--data-file=-
# Access secret
gcloud secrets versions access latest --secret=my-secret
# Grant access
gcloud secrets add-iam-policy-binding my-secret \
--member=serviceAccount:SA_EMAIL \
--role=roles/secretmanager.secretAccessor
Cloud KMS¶
# Create key ring
gcloud kms keyrings create my-keyring --location=global
# Create key
gcloud kms keys create my-key \
--keyring=my-keyring \
--location=global \
--purpose=encryption
# Encrypt data
gcloud kms encrypt \
--key=my-key \
--keyring=my-keyring \
--location=global \
--plaintext-file=data.txt \
--ciphertext-file=data.enc
Cloud Armor¶
# Create security policy
gcloud compute security-policies create my-policy \
--description="My security policy"
# Add rule
gcloud compute security-policies rules create 1000 \
--security-policy=my-policy \
--expression="origin.region_code == 'CN'" \
--action=deny-403
# Attach to backend service
gcloud compute backend-services update my-backend \
--security-policy=my-policy
VPC Service Controls¶
# Create access policy
gcloud access-context-manager policies create \
--organization=ORG_ID \
--title="My Policy"
# Create service perimeter
gcloud access-context-manager perimeters create my-perimeter \
--policy=POLICY_ID \
--resources=projects/PROJECT_NUMBER \
--restricted-services=storage.googleapis.com
Best Practices¶
Identity & Access¶
β
Enable MFA for all users
β
Use service accounts for applications
β
Implement least privilege principle
β
Regular IAM audits
β
Use workload identity for GKE
β
Avoid service account keys
β
Use IAM conditions
β
Implement separation of duties
Network Security¶
β
Use VPC for network isolation
β
Implement firewall rules (deny by default)
β
Enable VPC Flow Logs
β
Use Private Google Access
β
Implement Cloud Armor for public services
β
Use VPC Service Controls
β
Enable DDoS protection
β
Regular security assessments
Data Protection¶
β
Enable encryption at rest (default)
β
Use CMEK for sensitive data
β
Store secrets in Secret Manager
β
Implement data classification
β
Enable audit logging
β
Regular key rotation
β
Use DLP for sensitive data detection
β
Implement data retention policies
Monitoring & Response¶
β
Enable Security Command Center
β
Set up security alerts
β
Regular vulnerability scanning
β
Implement incident response plan
β
Enable audit logging
β
Monitor security events
β
Regular security reviews
β
Security training for team
Next Steps¶
- Secret Manager - Secrets management
- Cloud KMS - Key management
- Cloud Armor - DDoS and WAF protection
- Security Command Center - Security posture
- VPC Service Controls - Perimeter security
- Best Practices - Security guidelines
Additional Resources¶
Last Updated: March 2026
Status: β
Complete