mirror of
https://gitlab.kube.huskypup.net/Scooby/Homelabv4.git
synced 2026-08-21 11:36:50 +00:00
Add explicit CRD/API defaults to manifests that were causing ArgoCD's SSA dry-run to produce results different from live state: - HTTPRoutes: add group, kind, weight defaults to parentRefs/backendRefs - Kyverno ClusterPolicies: add skipBackgroundRequests, allowExistingViolations - Tetragon TracingPolicies: add return, maxData, resolve, returnCopy defaults - Gateway certificateRefs: add group="" default - Guacamole Gateway: add group="" to certificateRefs Add ignoreDifferences for resources that legitimately differ: - Cilium cert Secrets (auto-generated, data always differs) - Istio ValidatingWebhookConfiguration failurePolicy (istiod mutates) - Crowdsec LAPI Secrets (randomly generated) - ServiceMonitor/PodMonitor relabeling action defaults - StatefulSet volumeClaimTemplates apiVersion/kind defaults Persist argocd-cm ignoreDifferences config in ArgoCD Helm values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
71 lines
2.1 KiB
YAML
71 lines
2.1 KiB
YAML
apiVersion: kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: disallow-automount-sa-token
|
|
annotations:
|
|
policies.kyverno.io/title: Disallow Automount Service Account Token
|
|
policies.kyverno.io/category: DoD STIG
|
|
policies.kyverno.io/severity: medium
|
|
policies.kyverno.io/description: >-
|
|
STIG V-242382: Pods that do not need to communicate with the
|
|
Kubernetes API server should have automountServiceAccountToken
|
|
set to false to prevent credential exposure.
|
|
pod-policies.kyverno.io/autogen-controllers: none
|
|
spec:
|
|
validationFailureAction: Audit
|
|
background: true
|
|
rules:
|
|
- name: validate-automount
|
|
skipBackgroundRequests: true
|
|
match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- Pod
|
|
exclude:
|
|
any:
|
|
- resources:
|
|
namespaces:
|
|
- kube-system
|
|
- kube-public
|
|
- kube-node-lease
|
|
- kyverno
|
|
- istio-system
|
|
- cert-manager
|
|
- cnpg-system
|
|
- external-secrets
|
|
- vault
|
|
- rook-ceph
|
|
- prometheus
|
|
- argocd
|
|
- envoy-gateway-system
|
|
- kiali-operator
|
|
- mariadb-system
|
|
- redis-operator
|
|
- reloader
|
|
- scylla-operator
|
|
- crowdsec
|
|
- external-dns
|
|
- frigate
|
|
- gitlab
|
|
- grafana
|
|
- guacamole
|
|
- home-assistant
|
|
- mqtt
|
|
- netbird
|
|
- nextcloud
|
|
- teslamate
|
|
- unpoller
|
|
- authentik
|
|
- checkov
|
|
- n8n
|
|
- nessus
|
|
validate:
|
|
allowExistingViolations: true
|
|
message: >-
|
|
Pods should set automountServiceAccountToken to false unless API
|
|
access is required (STIG V-242382).
|
|
pattern:
|
|
spec:
|
|
automountServiceAccountToken: false
|