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 missing a default-deny NetworkPolicy
    Run on: any machine with kubectl access
  2. Pick one non-compliant application namespace to fix
    From the previous output, note the value after name= for each line with is_compliant=false. Choose one namespace (for example app-namespace) and substitute that name exactly in the following commands.
  3. Create a default-deny ingress NetworkPolicy manifest for that namespace
    Run on: any machine with kubectl access (local file creation)
    Replace every occurrence of app-namespace with the actual namespace name you are fixing.
  4. Apply the default-deny ingress NetworkPolicy
    Run on: any machine with kubectl access
  5. Repeat for remaining non-compliant namespaces
    For each other namespace shown with is_compliant=false, repeat steps 3–4, adjusting the filename and the namespace: field each time (or reuse the same filename and overwrite it before each kubectl apply).
  6. Verify all non-system namespaces now have a default-deny ingress NetworkPolicy
    Run on: any machine with kubectl access
    Confirm there are no lines with is_compliant=false.
Create a manifest template for the default-deny ingress NetworkPolicy:
Apply the default-deny ingress NetworkPolicy to each non-compliant namespace:
Verification: