Skip to main content

Overview

Implement defense-in-depth security for MCP Server on GKE with 67 security controls achieving CIS GKE Benchmark compliance and SOC 2 readiness.

Security Controls

67 controls across 7 layers

Compliance

CIS, SOC 2, HIPAA-ready

Zero Trust

Network policies, mTLS, Workload Identity

Automated Scanning

Daily compliance checks

7-Layer Security Architecture

1

Layer 1: Infrastructure

  • VPC isolation
  • IAM boundaries
  • GKE Security Posture Dashboard
  • Audit logging
2

Layer 2: Compute (Shielded Nodes)

  • Secure Boot (verify boot integrity)
  • vTPM (hardware-based key storage)
  • Integrity monitoring (detect tampering)
Automatic in GKE Autopilot
3

Layer 3: Network

  • Private nodes (no public IPs)
  • VPC-native networking
  • Network policies (zero-trust)
  • Cloud Armor (DDoS protection)
4

Layer 4: Data

  • Encryption at rest (Google-managed or CMEK)
  • Encryption in transit (TLS required)
  • Secret Manager (no secrets in Git)
5

Layer 5: Identity

  • Workload Identity (no SA keys)
  • IAM least privilege
  • Master authorized networks
6

Layer 6: Application

  • Binary Authorization (image signing)
  • Container vulnerability scanning
  • Pod Security Standards (restricted)
7

Layer 7: Compliance

  • Audit logging
  • Policy enforcement (OPA/Gatekeeper)
  • Automated compliance scanning

Quick Security Setup

1. Enable Binary Authorization

1

Run Setup Script

2

Sign Images

3

Enable in Cluster

2. Configure Private Cluster

Use case: Production with external access needed

3. Restrict Control Plane Access

4. Enable Security Posture Dashboard

View Dashboard:

Security Checklist

Infrastructure ✅

  • GKE Security Posture enabled
  • Audit logging enabled
  • Shielded nodes (automatic in Autopilot)
  • Workload Identity enabled
  • VPC Service Controls (optional, high-security)

Network ✅

  • Private nodes (no public IPs)
  • VPC-native networking
  • Network policies enforced
  • Cloud NAT for egress
  • Private endpoint (optional)
  • Cloud Armor (enable via variable)

Application ✅

  • Binary Authorization ready
  • Container scanning (Trivy in CI/CD)
  • Pod security standards (restricted)
  • Non-root containers
  • Read-only root filesystem
  • Capabilities dropped (ALL)

Data ✅

  • Encryption at rest (Google-managed)
  • CMEK (optional, compliance)
  • Encryption in transit (TLS)
  • Secrets in Secret Manager
  • No secrets in Git/ConfigMaps
  • No service account keys

Identity ✅

  • Workload Identity (no SA keys)
  • IAM least privilege
  • Per-workload service accounts
  • RBAC policies
  • SA key creation disabled (org policy)

Security Testing

Automated Scans

Run daily compliance scans:
Scans include:
  • Terraform security (Trivy, tfsec, Checkov)
  • Kubernetes manifests (Trivy, kube-score)
  • CIS GKE Benchmark (kube-bench)
  • Secret scanning (Gitleaks, TruffleHog)

Manual Security Review

Should return: 0
At least 2 policies should exist

Compliance Frameworks

CIS GKE Benchmark

GKE Autopilot is pre-configured to meet CIS Benchmark requirements.
Key controls (auto-compliant):
  • ✅ 4.1.1 Workload Identity enabled
  • ✅ 4.2.1 Network Policy enabled
  • ✅ 4.3.1 Private cluster enabled
  • ✅ 4.5.1 Audit Logging enabled
Validate with kube-bench:

SOC 2 Type II

Required controls (all implemented):
  • ✅ Access control (Workload Identity + RBAC)
  • ✅ Encryption (at rest + in transit)
  • ✅ Audit logging (all access logged)
  • ✅ Change management (Terraform + GitOps)
  • ✅ Monitoring & alerting (Cloud Operations)
  • ✅ Incident response (runbooks documented)

HIPAA Compliance

Requirements:
  • ✅ Encryption at rest (enable CMEK recommended)
  • ✅ Encryption in transit (TLS required)
  • ✅ Audit logs (configure 6+ year retention)
  • ✅ Access controls (IAM + RBAC)
  • ✅ Business Associate Agreement (sign with Google)
Additional steps:

Security Monitoring

Critical Metrics


Incident Response

Security Incident Runbook

1

Detection

  • Security alert fires
  • Unusual activity in audit logs
  • Binary Authorization denial surge
2

Containment

3

Investigation

4

Remediation

  • Delete compromised pods
  • Rotate all secrets
  • Review and tighten IAM policies
  • Deploy patched version

Binary Authorization

Image signing and policy enforcement

Operations Runbooks

Security operations and incident response

Compliance Scanning

Automated security and compliance scanning

Security Best Practices

Additional security hardening best practices