mirror of
https://gitlab.kube.huskypup.net/Scooby/Homelabv4.git
synced 2026-08-21 11:36:50 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: require-drop-all-capabilities
|
||||
annotations:
|
||||
policies.kyverno.io/title: Require Drop All Capabilities
|
||||
policies.kyverno.io/category: DoD STIG
|
||||
policies.kyverno.io/severity: high
|
||||
policies.kyverno.io/description: >-
|
||||
STIG V-242398: Containers must drop all Linux capabilities and only
|
||||
add back specific capabilities that are required. This follows the
|
||||
principle of least privilege for container security contexts.
|
||||
spec:
|
||||
validationFailureAction: Audit
|
||||
background: true
|
||||
rules:
|
||||
- name: require-drop-all
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Pod
|
||||
exclude:
|
||||
any:
|
||||
- resources:
|
||||
namespaces:
|
||||
- kube-system
|
||||
- rook-ceph
|
||||
- istio-system
|
||||
- prometheus
|
||||
- kyverno
|
||||
- argocd
|
||||
- cert-manager
|
||||
- cnpg-system
|
||||
- envoy-gateway-system
|
||||
- kiali-operator
|
||||
- mariadb-system
|
||||
- redis-operator
|
||||
- reloader
|
||||
- scylla-operator
|
||||
- vault
|
||||
- mqtt
|
||||
- gitlab
|
||||
- netbird
|
||||
- grafana
|
||||
- crowdsec
|
||||
- external-dns
|
||||
- nextcloud
|
||||
- home-assistant
|
||||
- guacamole
|
||||
- teslamate
|
||||
- unpoller
|
||||
- frigate
|
||||
- authentik
|
||||
- checkov
|
||||
- external-secrets
|
||||
validate:
|
||||
message: >-
|
||||
Containers must drop ALL capabilities (STIG V-242398).
|
||||
Add securityContext.capabilities.drop: ["ALL"] to each container.
|
||||
pattern:
|
||||
spec:
|
||||
containers:
|
||||
- securityContext:
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
=(initContainers):
|
||||
- securityContext:
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
Reference in New Issue
Block a user