Skip to main content

More Info:

Namespaces provide administrative and security boundaries between sets of resources. Create dedicated namespaces to segregate workloads and apply scoped RBAC controls.

Risk Level

Low

Address

Security

Compliance Standards

  • CIS EKS

Triage and Remediation

Remediation

Manual Steps

  1. Inventory current namespaces and their workloads
    • Run on: any machine with kubectl access
    • Command:
    • Review whether business-critical, shared, and system workloads are clearly separated (e.g., kube-system, kube-public, provider-managed namespaces vs. your own application namespaces).
  2. Identify workloads running in default or shared namespaces
    • Run on: any machine with kubectl access
    • Command:
    • Determine which of these are your application workloads (not system or add-ons) and whether they should be isolated into dedicated namespaces (e.g., per team, environment, or application).
  3. Design a namespace strategy and plan moves
    • Decide target namespaces (e.g., team-a-prod, team-a-dev, shared-tools) and which workloads must be isolated for security, access control, or quota reasons.
    • For each workload in an inappropriate namespace, plan:
      • Target namespace name
      • Matching RBAC scope (ServiceAccounts, Roles, RoleBindings)
      • Any NetworkPolicies or ResourceQuotas/LimitRanges to apply.
  4. Create or update namespaces and associated policies
    • Run on: any machine with kubectl access
    • Command (example – adjust names and labels to your design):
    • Optionally add baseline policies per namespace, for example:
  5. Migrate workloads into their dedicated namespaces
    • Run on: any machine with kubectl access
    • Export and re-apply manifests into the new namespaces (update metadata.namespace):
    • Ensure related objects (Services, ConfigMaps, Secrets, ServiceAccounts, Roles/RoleBindings, NetworkPolicies) are also created in the target namespace and references are updated.
  6. Verify namespace boundaries and workload placement
    • Run on: any machine with kubectl access
    • Commands:
    • Confirm that:
      • Non-system workloads are no longer running in default or system namespaces unless explicitly intended.
      • Workloads are grouped into appropriate dedicated namespaces that align with your administrative and security boundaries.
What to look for (possible issues):
  • Only default, kube-system, kube-public, and kube-node-lease exist, but many workloads run in default.
  • Very old default namespace with many unrelated workloads suggests no logical separation.

What to look for:
  • Multiple unrelated applications (e.g., payments, logging, demo, staging, prod) all in the same namespace (often default).
  • Shared namespace between system components and business apps.

What to look for:
  • Labels like app=payments, env=prod, team=ml, etc., all in one namespace instead of being grouped into separate namespaces by environment, team, or function.
  • No clear correlation between labels and namespace boundaries.

What to look for:
  • Overuse of ClusterRoleBinding granting broad roles (e.g., cluster-admin) instead of namespace-scoped RoleBinding.
  • Critical or sensitive workloads in namespaces that share wide RBAC bindings with unrelated workloads.

What to look for:
  • A namespace mixing:
    • different environments (dev/test/prod),
    • different business domains (payments, analytics, logging),
    • different teams or tenants, all with similar RBAC permissions.
  • Lack of any dedicated namespaces for components that clearly should be isolated (e.g., security tools, logging, monitoring, prod workloads).

What to look for:
  • Long-lived application workloads or critical services in default instead of a dedicated namespace (e.g., payments-prod, team-a-dev, logging, monitoring).

What to look for:
  • Important logical groups (tenant, team, env, data-sensitivity) present only as labels but not used to define actual namespace boundaries (e.g., multiple teams or envs mixed in one namespace despite labels suggesting separation is desired).

If these commands show that unrelated teams, environments, or sensitivity levels are mixed in the same namespaces, or that most workloads live in default, the cluster likely lacks appropriate administrative boundaries and requires a human-designed namespace model and migration plan.