feat(opa): add conftest OPA policies and pre-commit hook #167
Open
unkinben
wants to merge 1 commits from
benvin/opa_policies into main
pull from: benvin/opa_policies
merge into: unkin:main
unkin:main
unkin:benvin/consul-dns-k8s
unkin:benvin/consul-k8s-servers
unkin:benvin/kea-operator-v0.1.6
unkin:benvin/drop-acme-apex-ns
unkin:benvin/agent-observability-rbac
unkin:benvin/kubeconform-helm-kubeversion
unkin:benvin/jellyfin-sso-valkey-state
unkin:benvin/compiler-cert-helpers
unkin:benvin/revert-artifactapi-oauth2
unkin:benvin/oauth2-proxy-image-fix
unkin:benvin/media-apps-argocd
unkin:benvin/traefik-ldaps-entrypoint
unkin:benvin/externaldns-fix
unkin:benvin/litellm-sso
unkin:benvin/resolver-validate-except
unkin:benvin/grafana-schemas
unkin:benvin/grafana-operator
unkin:benvin/add-bind-operator
unkin:benvin/artifactapi-tf-signing
unkin:benvin/kubeconform-crd-schemas
unkin:fix-kanidm-replication-config
unkin:issue-155-open-webui-litellm
unkin:benvin/postfix
unkin:benvin/stalwart
unkin:benvin/externaldns-debug-logging
unkin:benvin/fix-externaldns-crashing
unkin:benvin/argocd-image-updater-deploy
unkin:benvin/helm_virtual
unkin:benvin/artifactkeeper
1 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
d0b3c26223 |
feat(opa): add conftest OPA policies and pre-commit hook
Adds three policy files under policy/ plus a pre-commit hook that
runs conftest against all staged YAML manifests (excluding chart
templates).
Policies:
no_ingress.rego
Deny Ingress resources — cluster uses Gateway API only.
gateway_api.rego
HTTPRoute/TLSRoute: require explicit group/kind on parentRefs and
group/kind/weight on backendRefs (PR #162, #165).
Gateway: require explicit group on certificateRefs (PR #153).
All fields are defaulted by the controller; omitting them causes
permanent ArgoCD OutOfSync.
resource_normalization.rego
CPU integer: deny unquoted integer cpu values (PR #163).
CPU milliCPU: deny values like 1000m/2000m that normalise to "1"/"2" (PR #164).
Memory Mi→Gi: deny 1024Mi/2048Mi etc. that normalise to 1Gi/2Gi (PR #163).
clusterIP null: deny Service with explicit null clusterIP (PR #166).
Also fixes all existing violations found by the new policies across
puppet deployments and reposync cronjobs (resource normalization).
kanidm/tlsroute.yaml and puppet/service_puppetdb.yaml are excluded
from this commit as they are addressed in PRs #165 and #166.
|