Interview Prep/DevSecOps/Kubernetes Security Posture

Why are ResourceQuotas and LimitRanges a security control, not just a cost control?

BeginnerProductionKubernetes Security Posture
Answer

A compromised or buggy workload without limits can starve the node (denial of service for neighbours) or scale to mine crypto at our expense. Quotas cap how much a namespace can consume, and LimitRanges give every container default requests and limits.

apiVersion: v1
kind: ResourceQuota
metadata: {name: team-quota, namespace: payments}
spec:
  hard:
    requests.cpu: "40"
    limits.memory: 160Gi
    pods: "200"
    services.loadbalancers: "2"

Capping services.loadbalancers and services.nodeports also stops teams from accidentally exposing services publicly.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security Posture