More Info:
Verifies each application namespace has a default-deny ingress NetworkPolicy. Without one, every pod is reachable from every other pod.Risk Level
HighAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
List non-system namespaces that need a default-deny NetworkPolicy (run on any machine with kubectl access):
-
For each application namespace that should be isolated (replace
my-namespacewith the actual namespace), create a default-deny ingress NetworkPolicy (run on any machine with kubectl access): -
(Optional but recommended) In each namespace where you created the default-deny policy, define explicit allow NetworkPolicies for the traffic that should be permitted (for example, allowing ingress from a specific namespace; run on any machine with kubectl access and adjust selectors as needed):
-
Verify that each non-system namespace now has at least one default-deny ingress NetworkPolicy (run on any machine with kubectl access):
Confirm that
is_compliant=trueis reported for the cluster and that each application namespace showsdefaultDenyPoliciesgreater than 0.
Using kubectl
Using kubectl
On any machine with Apply it:Or create it directly with
kubectl access:- List non-system namespaces that need a default-deny NetworkPolicy
- For each application namespace that is missing a default-deny ingress NetworkPolicy, create one. Example manifest (save as
default-deny-ingress.yamland apply per namespace):
kubectl (replace example-namespace each time):- Verification
kubectl access:Automation
Automation

