Why regulated containers face bigger risks
Containers at banks and government agencies face far more risk than those at a typical startup. Banks and fintechs answer to Federal Financial Institutions Examination Council (FFIEC) guidance and National Institute of Standards and Technology (NIST) rules. For them, a container that breaks out of its limits, a user who gains extra rights, traffic between pods sent in plain text or a tainted base image can do serious harm.
To run Kubernetes safely in a regulated firm, you need layers of defense at every stage. Check where each base image came from. Block bad settings before a pod starts. Then watch what each container does while it runs, with eBPF.
Block unsafe pods before they start
The first defense is to reject a bad or unsafe pod before it reaches a node. Tools such as Kyverno or Open Policy Agent (OPA) Gatekeeper do this. They apply the Kubernetes restricted Pod Security Standard to every live namespace. The policy below blocks pods that run as root or that can write to their own file system:
# Kyverno Policy: Disallow Root Containers & Enforce Read-Only Root Filesystem
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: enforce-pod-hardening
spec:
validationFailureAction: Enforce
rules:
- name: check-security-context
match:
resources:
kinds:
- Pod
validate:
message: "Running as root or writeable root filesystem is strictly prohibited!"
pattern:
spec:
securityContext:
runAsNonRoot: true
containers:
- securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
Zero Trust between pods with Cilium and eBPF
Cilium is a network plugin for Kubernetes. It filters traffic inside the Linux kernel with eBPF, which gives you three strong controls:
- Rules at the application programming interface (API) level: Limit which pods may talk, not just by address or port, but by the web method and path they call.
- Encryption between nodes: All traffic between pods on different nodes is encrypted on its own, with WireGuard or Internet Protocol Security (IPsec).
- Deny by default: Each namespace starts with a rule that blocks all traffic. Pods can only talk when a written policy allows it.
Where to start
Start with the admission policy above, since it stops the most common mistakes. Then add default-deny network rules, one namespace at a time. Last, add image signing and runtime checks. Each step can be tested on its own, so you never need one big, risky change.
