apiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: name: disallow-default-namespace annotations: policies.kyverno.io/title: Disallow Default Namespace policies.kyverno.io/category: DoD STIG policies.kyverno.io/severity: medium policies.kyverno.io/description: >- STIG V-242383: Workloads must not run in the default namespace. The default namespace lacks proper RBAC and network policy boundaries. spec: validationFailureAction: Enforce background: true rules: - name: validate-namespace match: any: - resources: kinds: - Pod - Deployment - StatefulSet - DaemonSet - Job - CronJob namespaces: - default validate: message: >- Workloads must not run in the default namespace (STIG V-242383). Create a dedicated namespace for your application. deny: {}