Skip to content

Transport Security Design

This document describes the transport-layer security architecture for the Graph OLAP Platform, covering encryption for all network communications.

Last Updated: 2025-12-20


  1. Defense in Depth: Multiple layers of encryption and authentication
  2. Zero Trust: Encrypt all traffic, even within the cluster
  3. Least Privilege: Network policies enforce minimal access
  4. Transparency: Encryption without application changes
Threat ModelMitigation
Internet eavesdroppingTLS 1.2+ on all external connections
Cloud provider snoopingTLS 1.2+ for managed services (Cloud SQL, GCS)
Cluster network eavesdroppingWireGuard encryption (Cilium)
Pod compromise lateral movementNetwork policies + encryption
Data exfiltrationFQDN-based egress filtering

Status:FULLY ENCRYPTED (TLS 1.2+)

Control Plane (Internal):

helm/charts/control-plane/values-production.yaml
ingress:
enabled: true
className: "gce-internal"
annotations:
networking.gke.io/managed-certificates: "graph-olap-internal-cert"
tls:
- secretName: graph-olap-tls
hosts:
- graph-olap.internal.hsbc.com

Protocol: TLS 1.2+ (GKE-managed) Certificate Management: GKE Managed Certificates (auto-renewal)


2. Database Connections (Application → Cloud SQL)

Section titled “2. Database Connections (Application → Cloud SQL)”

Status:FULLY ENCRYPTED (TLS 1.2+)

Terraform (infrastructure/modules/cloudsql/main.tf):

ip_configuration {
require_ssl = true # ✅ SSL/TLS required
ipv4_enabled = false # Private IP only
}

Connection String:

postgresql://user:[email protected]:5432/graph_olap?sslmode=require
# ^^^^^^^^^^^^^^^^
# SSL ENFORCED

Certificate Validation: Google-managed CA (trusted)


Status:FULLY ENCRYPTED (HTTPS)

All GCS operations use HTTPS by default:

  • Export Worker → GCS: gs:// URLs (HTTPS transport)
  • Ryugraph Wrapper → GCS: Google Cloud Storage SDK (HTTPS)

Certificate Validation: Google-managed CA (trusted)


4. External APIs (Application → Starburst)

Section titled “4. External APIs (Application → Starburst)”

Status:FULLY ENCRYPTED (HTTPS)

Configuration (export-worker/deploy/k8s/configmap.yaml):

STARBURST_URL: "https://starburst.example.com"
# ^^^^^
# HTTPS enforced

Certificate Validation: System CA bundle


5. Internal Pod-to-Pod Traffic (Within GKE)

Section titled “5. Internal Pod-to-Pod Traffic (Within GKE)”

Status:ENCRYPTED (WireGuard)

Architecture: GKE Dataplane V2 (Cilium-based)

Terraform (infrastructure/modules/gke/main.tf):

resource "google_container_cluster" "primary" {
# Enable GKE Dataplane V2 (Cilium-based)
datapath_provider = "ADVANCED_DATAPATH"
addons_config {
network_policy_config {
disabled = false # Required for Cilium network policies
}
}
}

Cilium WireGuard Configuration:

infrastructure/modules/gke-cilium-config/cilium-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: cilium-config
namespace: kube-system
data:
enable-wireguard: "true"
wireguard-persistent-keepalive: "25s"

How It Works:

  1. Cilium creates WireGuard tunnel between every pair of nodes
  2. All pod-to-pod traffic automatically encrypted in kernel
  3. No application changes required (transparent)
  4. ~5% CPU overhead (very efficient)

Encrypted Connections:

  • Control Plane → Ryugraph Wrapper
  • Export Worker → Control Plane
  • KEDA → Cloud SQL Proxy (if deployed)

Protocol: WireGuard (ChaCha20-Poly1305 encryption)


Architecture: Identity-based + FQDN-based policies

# Allow egress to specific destinations only
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: control-plane-policy
namespace: control-plane
spec:
endpointSelector:
matchLabels:
app: control-plane
egress:
# Allow to Wrapper pods
- toEndpoints:
- matchLabels:
app: ryugraph-wrapper
toPorts:
- ports:
- port: "8080"
protocol: TCP
# Allow to GCS/Starburst via FQDN
- toFQDNs:
- matchPattern: "*.googleapis.com"
toPorts:
- ports:
- port: "443"
protocol: TCP

Benefits:

  • Identity-based (not IP-based) - survives pod rescheduling
  • FQDN filtering - prevent data exfiltration
  • L7 visibility - see encrypted traffic in Hubble
  • No iptables overhead - eBPF performance

Terminal window
# Check WireGuard status
kubectl -n kube-system exec daemonset/cilium -- cilium status | grep Encryption
# Expected: Encryption: Wireguard [cilium_wg0 (Pubkey: ...)]
# View WireGuard peers
kubectl -n kube-system exec daemonset/cilium -- wg show
# Expected: List of peer nodes with handshakes and transfer stats
Terminal window
# Test external ingress
curl -v https://graph-olap.hsbc.com/health
# Expected: TLS 1.2+, valid certificate
# Test internal communication (should be encrypted by WireGuard)
kubectl -n control-plane exec deploy/control-plane -- curl http://wrapper:8080/health
# Expected: Success (HTTP in payload, WireGuard at network layer)
Terminal window
# This should be BLOCKED (export worker has no ingress allowed)
kubectl run test --rm -it --image=curlimages/curl -- curl http://export-worker:8080
# Expected: Timeout or connection refused
# This should work (allowed by policy)
kubectl -n control-plane exec deploy/control-plane -- curl http://wrapper.graph-instances:8080/health
# Expected: Success
Terminal window
# Check connection from Control Plane
kubectl -n control-plane exec deploy/control-plane -- psql "$DATABASE_URL" -c "SHOW ssl"
# Expected: on
# Check from Export Worker
kubectl -n control-plane exec deploy/export-worker -- psql "$DATABASE_URL" -c "SELECT * FROM pg_stat_ssl"
# Expected: ssl = true, cipher = TLS_AES_256_GCM_SHA384

Install Hubble CLI:

Terminal window
export HUBBLE_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/hubble/master/stable.txt)
curl -L --remote-name-all https://github.com/cilium/hubble/releases/download/$HUBBLE_VERSION/hubble-linux-amd64.tar.gz
tar xzvf hubble-linux-amd64.tar.gz
sudo mv hubble /usr/local/bin

Monitor Encrypted Flows:

Terminal window
# Port-forward Hubble Relay
kubectl -n kube-system port-forward svc/hubble-relay 4245:80 &
# Observe all flows
hubble observe --namespace control-plane
# Show only encrypted flows
hubble observe --verdict ENCRYPTED
# Show policy denials
hubble observe --verdict DROPPED
# Monitor Control Plane → Wrapper traffic
hubble observe --from-pod control-plane/control-plane --to-label app=ryugraph-wrapper

ComponentBaselineWith WireGuardOverhead
CPU100%105-110%+5-10%
MemoryBaseline+100-200Mi per nodeMinimal
Throughput10 Gbps9.5 Gbps<5%
Latency1ms1.05ms<0.1ms

Cost Impact:

  • n2-highmem-4 node: ~0.2 vCPU overhead
  • Negligible cost increase (<2%)
  • Security benefit >> cost

FeatureCilium (Our Choice)Istio
ArchitectureeBPF kernel-levelEnvoy sidecars
Performance✅ Minimal overhead (~5%)⚠️ Higher overhead (~15-20%)
Memory✅ 100Mi per node⚠️ 50-100Mi per pod
Setup✅ One config option⚠️ Complex (control plane + sidecars)
Encryption✅ WireGuard (kernel)⚠️ mTLS (userspace)
Observability✅ Hubble✅ Kiali/Jaeger
Network Policies✅ L3/L4/L7 + FQDN✅ L7 policies
Maintenance✅ GKE-managed⚠️ Self-managed

Recommendation: Cilium for production (better performance, native GKE integration)


Attack: Intercept traffic between browser and GKE Mitigation:

  • ✅ TLS 1.2+ with GKE Managed Certificates
  • ✅ HSTS headers (if enabled on ingress)
  • ✅ Certificate pinning (optional, for SDK)

Attack: GCP employee intercepts Cloud SQL traffic Mitigation:

  • ✅ TLS required for Cloud SQL connections
  • ✅ Google-managed encryption at rest
  • ✅ VPC Service Controls (optional, for data exfiltration)

Threat: Pod Compromise → Lateral Movement

Section titled “Threat: Pod Compromise → Lateral Movement”

Attack: Compromised pod tries to connect to other services Mitigation:

  • ✅ WireGuard encryption (attacker can’t sniff traffic)
  • ✅ Cilium network policies (attacker can’t make connections)
  • ✅ FQDN egress filtering (attacker can’t exfiltrate data)

Attack: Attacker with node access sniffs pod-to-pod traffic Mitigation:

  • ✅ WireGuard encryption (traffic is encrypted on the wire)
  • ✅ Private cluster (no public node IPs)
  • ✅ Shielded nodes (secure boot prevents OS compromise)

StandardRequirementStatus
PCI DSS 4.0TLS 1.2+ for card data✅ Compliant
SOC 2 Type IIEncryption in transit✅ Compliant
ISO 27001Network security controls✅ Compliant
GDPRData protection in transit✅ Compliant

External Traffic Encryption:

Terminal window
# Verify TLS version
openssl s_client -connect graph-olap.hsbc.com:443 -tls1_2
# Shows: TLS 1.2 or higher

Internal Traffic Encryption:

Terminal window
# Show WireGuard tunnels
kubectl -n kube-system exec daemonset/cilium -- wg show all
# Shows: Encrypted tunnels between all nodes

Database Encryption:

Terminal window
# Show SSL cipher
kubectl -n control-plane exec deploy/control-plane -- \
psql "$DATABASE_URL" -c "SELECT * FROM pg_stat_ssl WHERE pid = pg_backend_pid()"
# Shows: ssl=t, cipher=TLS_AES_256_GCM_SHA384

  • GKE cluster created with datapath_provider = "ADVANCED_DATAPATH"
  • Cilium WireGuard config deployed: kubectl apply -f cilium-config.yaml
  • WireGuard verified: cilium status | grep Wireguard
  • Network policies deployed and tested
  • Hubble observability enabled
  • TLS certificates configured (GKE Managed Certificates)
  • Cloud SQL require_ssl = true verified
  • Verify external HTTPS: curl -v https://graph-olap.hsbc.com
  • Verify WireGuard encryption: hubble observe --verdict ENCRYPTED
  • Verify network policies: Test blocked/allowed traffic
  • Monitor Hubble for policy violations: hubble observe --verdict DROPPED
  • Load test to verify performance impact is acceptable
  • Document any exceptions or deviations