Skip to main content

More Info:

Verifies each application namespace has a default-deny ingress NetworkPolicy. Without one, every pod is reachable from every other pod.

Risk Level

High

Address

Security

Compliance Standards

  • Cloudanix Best Practice

Triage and Remediation

Remediation

Manual Steps

  1. List non-system namespaces that are not compliant (run on any machine with kubectl access):
  2. For each non-compliant application namespace (replace APPLICATION_NAMESPACE with the actual name), create a default-deny ingress NetworkPolicy manifest file (run on any machine with kubectl access):
  3. Apply the default-deny NetworkPolicy to that namespace (run on any machine with kubectl access):
  4. (Optional but recommended) For each application, create additional NetworkPolicies in its namespace to allow only required ingress flows (run on any machine with kubectl access). For example, create a file:
  5. Repeat steps 2–4 for each non-system, non-compliant namespace reported in step 1.
  6. Verify that all non-system namespaces now have at least one default-deny ingress NetworkPolicy (run on any machine with kubectl access):
    Confirm that there are no lines with is_compliant=false.
On any machine with kubectl access:
  1. Identify non-compliant namespaces (replace the jq path if needed, but this is the same logic as the audit):
Assume this prints (example):
  1. Create a default-deny ingress NetworkPolicy manifest for each non-compliant namespace.
Example for team-a:
Apply it:
Repeat for each namespace that needs the policy, changing only the namespace: field and filename:
  1. Verification (same logic as the audit, run from any machine with kubectl):