mirror of
https://gitlab.kube.huskypup.net/Scooby/Homelabv4.git
synced 2026-08-20 23:16:49 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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: {}
|
||||
Reference in New Issue
Block a user