bedrock

Admission policies

#Kyverno policies

Files are in tenant-workload/kyverno/.

PolicyChecksNamespacesActionIf Kyverno is down
disallow-latest-tagEvery container, init container and ephemeral container has an explicit tag that is not latestapplication, node-agentsDenyFail closed
require-resource-limitsCPU and memory limits on containers and init containersapplication, node-agentsDenyFail closed
harden-run-as-nonrootFills in runAsNonRoot, seccompProfile, allowPrivilegeEscalation: false and drop: ALLapplicationMutateFail closed
registry-allowlist-strictImages come from an allowed publisherapplication, node-agents, reloaderDenyFail closed
registry-allowlist-dataImages come from an allowed publishergarage, openbao, secrets-store, falco, nats, valkey, kafka, prometheus-operator, bedrock-failoverDenyFail open
registry-allowlist-databaseImages come from an allowed publisherAny namespace labelled bedrockctl.com/database: "true", such as a replica added with make add-replicaDenyFail open
restrict-priority-classesReserved priority classes are used only where allowedallDenyFail open

bedrock-replica-secret-sync and bedrock-replica-ca-sync in tenant-workload/kyverno/generate/replica-secret-sync.yaml are generate policies. They copy the replication certificate and the CA’s ca.crt from cluster-1 into cluster-2 and cluster-3 and keep them in sync. bedrock-peer-cluster-2-to-cluster-3, in the same file, does the same from cluster-2 into cluster-3, so cluster-3 can follow cluster-2 after a failover. make add-replica adds one more of these for each new replica.

bedrock-failover-ca-sync in tenant-workload/kyverno/generate/failover-secret-sync.yaml copies each database cluster’s ca.crt into bedrock-failover. The CA private keys are never copied. Kyverno may only write ConfigMaps in bedrock-failover, through a Role in that namespace.

#Allowed image publishers

RegistryAllowed
Docker Hubgrafana/*, falcosecurity/*, nats, valkey/valkey, dxflrs/garage, alpine/k8s
ghcr.iocloudnative-pg/*, opencost/*, stakater/reloader, sassendes/bedrock-failover
quay.ioprometheus/*, prometheus-operator/*, strimzi/*, kiwigrid/k8s-sidecar, openbao/openbao, openbao/openbao-csi-provider
registry.k8s.iokube-state-metrics/kube-state-metrics, csi-secrets-store/driver, sig-storage/csi-node-driver-registrar, sig-storage/livenessprobe

#ValidatingAdmissionPolicy

bedrock-reserved-priority-classes in tenant-workload/platform/priorityclasses.yaml runs inside the API server and needs no webhook. It denies pod creation when:

  • bedrock-storage is used outside garage
  • bedrock-data is used outside falco, bedrock-failover and namespaces labelled bedrockctl.com/database: "true"
  • system-cluster-critical or system-node-critical is used outside kube-system and kyverno

The failover controller adds seven more in tenant-workload/failover/admission.yaml. They decide what the observers, the verifier, the checker and the decider may write, and they are described on the failover controller page.

bedrock-openbao-db-ca-writers in tenant-workload/kyverno/generate/openbao-ca-sync.yaml lets no workload but Kyverno’s background controller write a db-ca-* ConfigMap in openbao. OpenBao trusts those CAs when it connects to PostgreSQL, so a foreign CA there would let a fake server pass as the database.

#Pod Security Admission

The restricted level is enforced on every namespace except node-agents, falco and longhorn-system, which are privileged, and the namespaces created by RKE2 and upstream bundles. See namespaces.