How do you stop a compromised container from phoning home?
IntermediateProductionImage Security & Hardening
Answer
Put backend services on --internal networks, route outbound traffic through an egress proxy with an allow-list, use host or cloud firewalls on DOCKER-USER chain, and for Kubernetes apply NetworkPolicy or Cilium egress rules. Combine with read-only root and no shell so attackers cannot stage tools.
More on Image Security & Hardening
Why should containers not run as root, and how do you enforce it?BeginnerWhat is a distroless image and what are the trade-offs?BeginnerHow do you scan an image with Trivy and fail a CI build on serious findings?BeginnerHow do you manage Trivy false positives and accepted risks?IntermediateWhich `docker run` flags make up a hardened runtime baseline?BeginnerWhat does `no-new-privileges` protect against?Beginner