Skip to main content

More Info:

Use namespaces to isolate your Kubernetes objects.

Risk Level

Low

Address

Security

Compliance 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)
  • 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

Manual Steps

  1. Inventory existing namespaces and workloads
    • Run on: any machine with kubectl access
    • Command:
    • Purpose: Understand what namespaces exist and which workloads currently run in each (especially in default, kube-system, and other shared namespaces).
  2. Identify workloads in inappropriate/shared namespaces
    • Run on: any machine with kubectl access
    • Commands (focus on default and other “catch-all” namespaces):
    • Purpose: Detect application components that are mixed together without clear separation (e.g., multiple teams, environments, or apps sharing default).
  3. Define intended administrative boundaries
    • Manual decision step (no command):
      • Decide how you want to separate resources, for example:
        • By environment: dev, stage, prod
        • By team: team-a, team-b
        • By application or domain: payments, analytics, etc.
      • Document a simple mapping: “Team/Environment/App → Namespace name”.
  4. Create or validate namespaces for each boundary
    • Run on: any machine with kubectl access
    • For each needed namespace NAMESPACE_NAME, if it does not exist:
    • Purpose: Ensure there is a dedicated namespace for each intended administrative boundary.
  5. Plan and migrate workloads into appropriate namespaces
    • Run on: any machine with kubectl access
    • For each deployment/statefulset/etc. currently in a shared or inappropriate namespace:
      1. Export its manifest:
      2. Edit the manifest file to set:
        and adjust any namespace-scoped references (ConfigMaps, Secrets, ServiceAccounts, etc.).
      3. Apply it to the target namespace:
      4. Delete the old resource from the original namespace after confirming it’s running correctly in the new one:
    • Repeat similarly for other resource kinds (Services, Jobs, CronJobs, ConfigMaps, Secrets, etc.), ensuring dependencies move together.
  6. Verify namespace-based separation is in place
    • Run on: any machine with kubectl access
    • Commands:
    • Check that:
      • Application components are grouped in their intended dedicated namespaces.
      • The default namespace and other shared namespaces no longer contain unrelated or multi-tenant workloads.
What to look for (potential problems):
  • Only default, kube-system, kube-public, kube-node-lease, and maybe one large custom namespace in use.
  • Many unrelated workloads (dev, test, prod, infra, third-party) all end up in default or a single shared namespace.

What to look for:
  • Business apps, CI/CD tools, monitoring, logging, and system components all mixed in the same namespace (especially default).
  • No clear separation by environment (e.g., dev/test/prod) or team/application.

What to look for:
  • Multiple teams or applications (seen in labels like app=, team=, environment=) colocated in the same namespace without a clear reason.
  • Lack of consistent labeling that would indicate intentional grouping within namespaces.

What to look for:
  • Very broad permissions in shared namespaces (e.g., roles that can manage “everything”) used by multiple teams or apps.
  • Critical infra or security-sensitive workloads in the same namespace as less-trusted or experimental workloads.

What to look for:
  • “Catch‑all” namespaces with a mix of:
    • Different applications
    • Different environments (e.g., dev and prod together)
    • Shared secrets or configmaps used by unrelated workloads
  • Absence of NetworkPolicy in a namespace that hosts mixed or sensitive workloads.

What to look for:
  • Users, groups, or service accounts with cluster‑wide admin permissions (cluster-admin or similar) that make namespace separation less effective.
  • Service accounts that belong to “low trust” workloads being bound at cluster scope instead of namespace scope.

What to look for:
  • A very high object count in default or a single namespace, with few or no other active namespaces.
  • Namespaces used only for one or two small workloads vs huge “everything” namespaces without a clear policy.

Additional Reading: