Back to all scenarios
Scenario #197
Networking
K8s v1.19, OpenShift

Cross-Namespace Network Isolation Not Enforced

Network isolation between namespaces failed due to an incorrectly applied NetworkPolicy.

Find this helpful?
What Happened

The NetworkPolicy intended to isolate communication between namespaces was not enforced because it was misconfigured.

Diagnosis Steps
  • 1Checked the NetworkPolicy with kubectl describe networkpolicy and found that the selector was too broad, allowing communication across namespaces.
  • 2Verified namespace communication and found that pods in different namespaces could still communicate freely.
Root Cause

The NetworkPolicy selectors were too broad, and isolation was not enforced between namespaces.

Fix/Workaround
• Refined the NetworkPolicy to more specifically target pods within certain namespaces.
• Re-applied the updated NetworkPolicy and validated the isolation.
Lessons Learned

Ensure that NetworkPolicy selectors are specific to prevent unintended communication.

How to Avoid
  • 1Always validate network policies before deploying to production.
  • 2Use namespace-specific selectors to enforce isolation when necessary.