10_threat_model_k8s_telecom

Part 10: Threat Model - Kubernetes + Telecom

Learning Objective: Apply STRIDE threat modeling to Kubernetes-based telecom deployments.


K8s + Telecom Attack Surface

graph TB
    subgraph "K8s Control Plane"
        API[API Server]
        etcd[(etcd)]
        Scheduler[Scheduler]
    end
    
    subgraph "Worker Nodes"
        subgraph "Namespace: open5gs"
            AMF_Pod[AMF Pod]
            SMF_Pod[SMF Pod]
            UPF_Pod[UPF Pod]
        end
        
        subgraph "Namespace: ueransim"
            gNB_Pod[gNB Pod]
        end
    end
    
    Attacker[🔴 Attacker]
    
    Attacker -.->|❌ 1. Exploit
unauth API| API Attacker -.->|❌ 2. Container
escape| AMF_Pod Attacker -.->|❌ 3. etcd
access| etcd Attacker -.->|❌ 4. Network
policy bypass| UPF_Pod Attacker -.->|❌ 5. Malicious
Helm chart| SMF_Pod style Attacker fill:#ff9999 style API fill:#ffcccc style etcd fill:#ffcccc style AMF_Pod fill:#ffcccc

Threat Catalog

1. Container Escape from NF Pods (E)

Attack Vector:

Impact:

Mitigation:

Example Pod Security:

securityContext:
  runAsNonRoot: true
  runAsUser: 1000
  readOnlyRootFilesystem: true
  allowPrivilegeEscalation: false
  capabilities:
    drop:
      - ALL

STRIDE Score: E=Critical


2. K8s RBAC Misconfiguration (E, I)

Attack Vector:

Impact:

Mitigation:

Example Minimal RBAC:

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: amf-role
  namespace: open5gs
rules:
  - apiGroups: [""]
    resources: ["configmaps"]
    verbs: ["get", "list"]

STRIDE Score: E=High, I=High


3. NetworkPolicy Bypass (I, T)

Attack Vector:

Impact:

Mitigation:

Example NetworkPolicy:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: amf-ingress
  namespace: open5gs
spec:
  podSelector:
    matchLabels:
      app: amf
  policyTypes:
    - Ingress
  ingress:
    - from:
        - namespaceSelector:
            matchLabels:
              name: ueransim
      ports:
        - protocol: SCTP
          port: 38412  # N2 NGAP — uses SCTP per 3GPP TS 38.412, not TCP

STRIDE Score: I=High, T=Medium


4. Supply Chain: Malicious Helm Chart (T, E)

Attack Vector:

Impact:

Mitigation:

Example OPA Policy:

package kubernetes.admission

deny[msg] {
  input.request.kind.kind == "Pod"
  image := input.request.object.spec.containers[_].image
  not startswith(image, "open5gs/")
  msg := sprintf("Untrusted image: %v", [image])
}

STRIDE Score: T=Critical, E=Critical


5. etcd Exposure Leaking Subscriber Data (I)

Attack Vector:

Impact:

Mitigation:

Example Encryption Config:

apiVersion: apiserver.config.k8s.io/v1
kind: EncryptionConfiguration
resources:
  - resources:
      - secrets
    providers:
      - aescbc:
          keys:
            - name: key1
              secret: <base64-encoded-32-byte-key>
      - identity: {}

STRIDE Score: I=Critical


6. Service Mesh for NF-to-NF mTLS (S, T, I)

Attack Vector:

Impact:

Mitigation:

Example Istio PeerAuthentication:

apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: default
  namespace: open5gs
spec:
  mtls:
    mode: STRICT

STRIDE Score: S=High, T=High, I=High


7. Pod Security Standards (E)

Attack Vector:

Impact:

Mitigation:

Example PSS Enforcement:

apiVersion: v1
kind: Namespace
metadata:
  name: open5gs
  labels:
    pod-security.kubernetes.io/enforce: restricted
    pod-security.kubernetes.io/audit: restricted
    pod-security.kubernetes.io/warn: restricted

STRIDE Score: E=High


8. Secrets Management (I)

Attack Vector:

Impact:

Mitigation:

Example External Secrets Operator:

apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: mongodb-creds
  namespace: open5gs
spec:
  secretStoreRef:
    name: vault-backend
  target:
    name: mongodb-secret
  data:
    - secretKey: password
      remoteRef:
        key: mongodb/password

STRIDE Score: I=Critical


9. Resource Exhaustion (D)

Attack Vector:

Impact:

Mitigation:

Example Resource Limits:

resources:
  requests:
    memory: "512Mi"
    cpu: "500m"
  limits:
    memory: "2Gi"
    cpu: "2000m"

STRIDE Score: D=High


10. Admission Control (T, E)

Attack Vector:

Impact:

Mitigation:

Note

PodSecurityPolicy was removed in Kubernetes v1.25. Older clusters that still depend on it need a planned migration to Pod Security Admission or another admission-policy implementation.

Example Gatekeeper Policy:

apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sPSPPrivilegedContainer
metadata:
  name: deny-privileged
spec:
  match:
    kinds:
      - apiGroups: [""]
        kinds: ["Pod"]

STRIDE Score: T=High, E=Critical


Threat Summary Table

Threat S T R I D E Severity
Container Escape ✅ Critical
RBAC Misconfiguration ✅ ✅ High
NetworkPolicy Bypass ✅ ✅ High
Malicious Helm Chart ✅ ✅ Critical
etcd Exposure ✅ Critical
No Service Mesh ✅ ✅ ✅ High
Pod Security ✅ High
Secrets Exposure ✅ Critical
Resource Exhaustion ✅ High
No Admission Control ✅ ✅ Critical

Defense-in-Depth Checklist


Summary

Congratulations! You've completed the core Open5GS Telecom Security Lab Guide. Continue to the Real-World Attack Case Studies for deep dives into 20 actual telecom attacks. 🎉

Next: Part 11: Real-World Attacks — Core Signaling (SS7 / Diameter / GTP) →

Return to: Index