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
LowAddress
SecurityCompliance Standards
- CIS EKS
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
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).
-
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).
-
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.
- Decide target namespaces (e.g.,
-
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:
-
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.
-
Verify namespace boundaries and workload placement
- Run on: any machine with kubectl access
- Commands:
- Confirm that:
- Non-system workloads are no longer running in
defaultor system namespaces unless explicitly intended. - Workloads are grouped into appropriate dedicated namespaces that align with your administrative and security boundaries.
- Non-system workloads are no longer running in
Using kubectl
Using kubectl
- Only
default,kube-system,kube-public, andkube-node-leaseexist, but many workloads run indefault. - Very old
defaultnamespace with many unrelated workloads suggests no logical separation.
- 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.
- 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.
- Overuse of
ClusterRoleBindinggranting broad roles (e.g.,cluster-admin) instead of namespace-scopedRoleBinding. - Critical or sensitive workloads in namespaces that share wide RBAC bindings with unrelated workloads.
- 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).
- Long-lived application workloads or critical services in
defaultinstead of a dedicated namespace (e.g.,payments-prod,team-a-dev,logging,monitoring).
- 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.Automation
Automation

