More Info:
Use network policies to isolate traffic in your cluster network.Risk Level
LowAddress
SecurityCompliance Standards
- APRA CPS 234 (Australia)
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CIS EKS
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- DPDPA
- Digital Operational Resilience Act (EU)
- Essential 8
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
List namespaces that currently lack any NetworkPolicy (run on any machine with kubectl access):
-
For each namespace in the list, decide the default isolation behavior you want:
- Most restrictive (recommended starting point): deny all ingress and egress by default, then create additional NetworkPolicies later to allow required flows.
- Ingress-only isolation: deny all ingress but allow all egress.
- Custom: define specific allowed selectors/ports/namespaces as needed.
-
To apply a default deny all ingress and egress NetworkPolicy for one namespace (replace
TARGET_NAMESPACEwith the namespace name; run on any machine with kubectl access): -
If you prefer to only deny ingress and leave egress open for a namespace (replace
TARGET_NAMESPACE; run on any machine with kubectl access): -
For critical namespaces (for example
kube-system, monitoring, logging), review application requirements before applying default deny:- List pods and labels to plan selectors:
- Start with default deny (Step 3 or 4), then iteratively add additional NetworkPolicies that:
- Select specific pods via
podSelector.matchLabels - Allow required
ingress/egressbased onfrom/to(e.g., namespaceSelector, podSelector, ipBlock) andports.
- Select specific pods via
- List pods and labels to plan selectors:
-
Verify that all namespaces now have at least one NetworkPolicy (run on any machine with kubectl access):
Using kubectl
Using kubectl
On any machine with kubectl access:Apply it to the target namespace:Repeat editing
- Identify namespaces without NetworkPolicies (reuse the audit logic)
- For each listed namespace, create at least one NetworkPolicy. Below is a conservative default‑deny ingress and allow‑all egress policy you can apply per namespace (replace NAMESPACE_HERE each time):
namespace: NAMESPACE_HERE and applying for each namespace in $ns_without_np. Example loop to generate and apply identical policy to every namespace missing one:- Verification (same machine with kubectl):
Automation
Automation

