Network and Perimeter Security on GCP: VPC Service Controls, IAP, Cloud Armor, Security Command Center and Zero Trust
Defense in Depth
text
Identity (IAM, MFA, federation)
└─ Perimeter (VPC Service Controls, Org Policy)
└─ Network (VPC, firewall, private access, Cloud Armor)
└─ Compute (Shielded VM, OS Login, Binary Authorization)
└─ Data (CMEK, DLP, backups)
└─ Detect and respond (SCC, logging, alerts)
VPC Service Controls
- Creates a service perimeter around Google-managed services (BigQuery, Cloud Storage and others) in selected projects
- Stops data exfiltration: even someone with valid IAM cannot copy data out to a project outside the perimeter
- Use ingress and egress rules for approved exceptions. Start in dry-run mode to see what would be blocked
- Complements IAM: IAM says who, VPC-SC says from where
bash
gcloud access-context-manager policies list --organization=987654321
gcloud access-context-manager perimeters create data-perimeter --policy=POLICY_ID --title="Data perimeter" \
--resources=projects/123456 --restricted-services=bigquery.googleapis.com,storage.googleapis.com --perimeter-type=regular
Identity-Aware Proxy (IAP) and Zero Trust
- Zero trust: do not trust a request because of its network. Verify the user, device and context every time
- IAP puts a login check in front of web apps and SSH/RDP to VMs. No VPN and no public IP needed
- Access levels can require a managed device, location or time
bash
# SSH to a VM that has no external IP, through IAP
gcloud compute ssh private-vm --zone=asia-south1-a --tunnel-through-iap
gcloud projects add-iam-policy-binding my-proj --member="group:ops@example.com" --role="roles/iap.tunnelResourceAccessor"
Cloud Armor
- A web application firewall and DDoS defense for the external Application Load Balancer
- Rules for IP allow or deny lists, geography, OWASP attacks (SQL injection, XSS), rate limiting and bot management
- Adaptive Protection uses machine learning to spot attacks
bash
gcloud compute security-policies create web-policy --description="WAF"
gcloud compute security-policies rules create 1000 --security-policy=web-policy --expression="evaluatePreconfiguredWaf('sqli-v33-stable')" --action=deny-403
gcloud compute backend-services update web-backend --security-policy=web-policy --global
Compute and Container Security
| Feature | What it does |
|---|---|
| Shielded VM | Secure boot and integrity monitoring against rootkits |
| Confidential VM | Encrypts data in use in memory |
| OS Login | Controls SSH with IAM instead of SSH keys |
| Binary Authorization | Only allow signed, trusted container images to deploy |
| Artifact Analysis | Scan images for vulnerabilities |
| GKE hardening | Private clusters, Workload Identity, network policies, node auto-upgrade |
Security Command Center (SCC)
- Central place to see misconfigurations, vulnerabilities and threats
- Security Health Analytics finds issues such as open firewalls and public buckets
- Event Threat Detection and Container Threat Detection spot attacks
- Premium and Enterprise tiers add more features, including compliance reports
Network Security Quick Rules
- No public IPs on VMs unless needed (use IAP, Cloud NAT and load balancers)
- Private Google Access so private VMs reach Google APIs
- Deny by default firewall design, allow by tag or service account
- Put Cloud Armor in front of public apps
- Enable VPC Flow Logs and Firewall Rules Logging for investigation
Practice
- Connect to a VM without a public IP using IAP tunnel
- Create a Cloud Armor policy that blocks one IP range
- Run a VPC-SC perimeter in dry-run mode and read the violation logs
- Find three findings in Security Command Center and decide fixes
Conclusion
Use layers: IAM for identity, VPC Service Controls for data perimeters, IAP for zero trust access, Cloud Armor for web attacks, hardened compute and SCC for detection. Start perimeters in dry-run and remove public IPs where possible.
Quick Summary: defense in depth; VPC-SC; IAP; Cloud Armor; compute security; SCC; rules.

