We're implementing CiliumClusterwideNetworkPolicies with a default-deny strategy for ingress in our application namespaces. Currently, we've set explicit allow policies for each service, like the backend and frontend apps, tailored by source namespace and port when necessary.
I'm curious about how detailed we should be with these policies. For instance, should we also restrict infrastructure namespaces such as gateway-system and monitoring, or is that too much since those are maintained by the platform team? Also, for egress traffic, is it worthwhile to limit outbound connections for each service, or is having a default-deny for ingress alongside an allow-list sufficient for most threat models?
Has anyone experienced regret over being too granular with their policies, ultimately leading to more debugging than security benefits? I'm trying to balance being secure enough for SOC2 compliance while not causing constant breakage during deployments.
4 Answers
AI tools can really help streamline and clarify network policies, so don’t shy away from utilizing them. It's all about maximizing your security!
Focus on identifying what requires default access and what doesn’t. Your monitoring systems should have access to all workloads on any port, and it's wise to block all incoming internet traffic. Using a single identity-aware proxy for incoming traffic can improve security without complicating things too much. As for egress, only deny that if your security needs warrant it; otherwise, a simple default-deny ingress with an allow-list is usually fine. Maintaining system namespaces untouched can help avoid disrupting your cluster’s functionality.
The amount of effort you want to invest is key here. You want to set up ingress rules to prevent services from exposing too much but also need to control egress communication. If your egress is configured correctly, then ingress becomes less critical. But if your egress isn't well-managed, it can lead to unexpected access. So it may actually be best to get the egress right first, making those infrastructure namespaces less of a concern.
It's generally best to only make things as granular as necessary to meet your requirements. Being overly detailed creates complexity, and complexity can lead to issues down the line.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures