More Info:
Verifies the default namespace has no workloads so RBAC, quotas and NetworkPolicies can be scoped per tenant.Risk Level
MediumAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
List all workloads in the
defaultnamespace (run on any machine with kubectl access): -
For each workload type in
default, export its manifest to a file (replace placeholders with actual names from step 1; run on any machine with kubectl access): Deployments:StatefulSets:DaemonSets:Jobs/CronJobs: -
Edit each exported manifest to target a purpose-specific namespace (run on any machine with kubectl access):
If the
metadata.namespacefield is missing, add it undermetadata::Repeat for each manifest. Ensure the<target-namespace>already exists, or create it: -
Apply the modified manifests into the new namespace (run on any machine with kubectl access):
-
After confirming the workloads are running correctly in the new namespace, delete the originals from
default(run on any machine with kubectl access): -
Verification (derived from the audit command; run on any machine with kubectl access):
Confirm that
podCount=0andis_compliant=true.
Using kubectl
Using kubectl
On any machine with kubectl access:Edit
- Identify all workload types in the
defaultnamespace
- Choose or create a purpose-specific namespace (example:
team-a)
- Export existing workloads from
defaultand edit their namespace
/tmp/default-workloads.yaml:- For every object, set:
- Remove runtime-only fields under
metadatasuch as:creationTimestampresourceVersionuidannotationsthat are managed by controllers (e.g.deployment.kubernetes.io/revision)generation
- Remove status sections:
- Apply workloads into the new namespace
- Delete old workloads from the
defaultnamespace
kubernetes Service.- Verify no pods remain in the
defaultnamespace (benchmark audit)
Automation
Automation

