mirror of
https://gitlab.kube.huskypup.net/Scooby/Homelabv4.git
synced 2026-08-21 11:36:50 +00:00
34 lines
1003 B
YAML
34 lines
1003 B
YAML
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: {}
|