krci-audit

by sergk

Helm chartv0.2.0App 0.2.0Apache-2.0Verified publisher

A Helm chart for krci-audit — platform-agnostic Kubernetes admission audit capture & store

About this chart

krci-audit

A Helm chart for krci-audit — platform-agnostic Kubernetes admission audit capture & store

Homepage: https://docs.kuberocketci.io/

Maintainers

NameEmailUrl
epmd-edp[email protected]https://solutionshub.epam.com/solution/kuberocketci

Source Code

Values

KeyTypeDefaultDescription
affinityobject{}
apiobject{"enabled":true,"port":8080,"replicaCount":1,"resources":{"limits":{"cpu":"500m","memory":"128Mi"},"requests":{"cpu":"10m","memory":"32Mi"}}}Read-only audit API (initiator lookup + audit-events query). Runs as a separate Deployment and connects to PostgreSQL as the least-privilege audit_reader role, so it can never mutate the trail. Consumers reach it by in-cluster DNS at -api.:<api.port>.
captureobject{"failurePolicy":"Ignore","filter":{"groupResources":[{"group":"tekton.dev","resource":"pipelineruns"}],"groups":["v2.edp.epam.com"]},"includeSubresources":[],"level":"metadata","namespaces":[],"operations":["CREATE","UPDATE","DELETE"],"rules":[{"apiGroups":["v2.edp.epam.com"],"apiVersions":["*"],"resources":["*"],"scope":"*"},{"apiGroups":["tekton.dev"],"apiVersions":["*"],"resources":["pipelineruns"],"scope":"Namespaced"}],"storeRaw":false,"timeoutSeconds":1}Capture configuration. The webhook is wildcard-capable; the Vector filter selects which events are STORED, and can be changed at any time (edit values + helm upgrade) with no code change or rebuild. Defaults select KubeRocketCI objects.
capture.failurePolicystring"Ignore"never block platform mutations if auditing is down
capture.filterobject{"groupResources":[{"group":"tekton.dev","resource":"pipelineruns"}],"groups":["v2.edp.epam.com"]}Vector store filter (which of the received events are persisted). Default = KRCI objects.
capture.filter.groupResourceslist[{"group":"tekton.dev","resource":"pipelineruns"}]Store events matching a specific group+resource.
capture.filter.groupslist["v2.edp.epam.com"]Store any event whose request.resource.group is in this list.
capture.includeSubresourceslist[]Subresource policy: spec-level only by default. status/scale churn is dropped unless the subresource name is listed here (and a matching / webhook rule is added).
capture.levelstring"metadata"Object body capture level: "metadata" (default; bounds size/PII) or "full".
capture.namespaceslist[]Restrict which namespaces are audited, by name. Empty (default) = all namespaces. When set, the apiserver skips the webhook call entirely for every other namespace (cheaper than filtering downstream) — relies on the apiserver's automatic kubernetes.io/metadata.name namespace label (k8s >=1.21).
capture.ruleslist[{"apiGroups":["v2.edp.epam.com"],"apiVersions":["*"],"resources":["*"],"scope":"*"},{"apiGroups":["tekton.dev"],"apiVersions":["*"],"resources":["pipelineruns"],"scope":"Namespaced"}]Webhook rules registered with the API server (which admissions are sent to us).
capture.storeRawboolfalseStore the whole raw AdmissionReview payload for replay fidelity (off by default).
db.hoststring""Logical database. For pgo/simple the chart provisions this DB; host/port default to the provisioned instance and rarely need overriding. For external, set host (name/port too). required for external
db.modestring"external"Provisioning mode — choose how PostgreSQL is supplied: external — bring your own DB (nothing is provisioned; set db.host + db.owner.secretName) pgo — provision a Crunchydata PostgresCluster (requires the postgres-operator add-on) simple — provision a single plain PostgreSQL Deployment (dev / small installs)
db.namestring"krci-audit"
db.ownerobject{"passwordKey":"password","secretName":"","userKey":"user"}All DB credentials are a prerequisite: create the Secret(s) yourself before installing (e.g. kubectl create secret generic ..., or enable eso below). The chart only ever reads them. Default (secretName unset): a single pre-created Secret named -db-access with keys db-owner-username, db-owner-password (simple mode only), writer-password, reader-password (only if api.enabled). secretName overrides let owner/writer/reader each point at their own existing Secret with custom key names instead (owner.userKey/passwordKey, writer.passwordKey, reader.passwordKey). pgo mode ignores owner.secretName: it reads the operator's own pguser Secret (keys user/password).
db.owner.secretNamestring""if not defined: -db-access (simple mode); required for external
db.pgoobject{"backups":{"enabled":true,"image":"registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.52.1-1","storage":"2Gi"},"image":"registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.4-0","postgresVersion":16,"replicas":1,"storage":"2Gi"}pgo mode (Crunchydata postgres-operator). Provisions a PostgresCluster + owner user.
db.portint5432
db.reader.passwordKeystring"password"
db.reader.secretNamestring""if not defined: -db-access
db.simpleobject{"image":"postgres:16-alpine","persistence":true,"resources":{"limits":{"cpu":"1","memory":"512Mi"},"requests":{"cpu":"50m","memory":"128Mi"}},"storage":"2Gi"}simple mode. A single PostgreSQL Deployment (no HA, no backups) — suitable for dev.
db.simple.persistencebooltruefalse ⇒ emptyDir (ephemeral)
db.sslmodestring"disable"
db.writer.passwordKeystring"password"
db.writer.secretNamestring""if not defined: -db-access
esoobject{"apiVersion":"external-secrets.io/v1","aws":{"region":"","roleArn":""},"enabled":false,"secretPath":""}External Secrets Operator (AWS only): populates the -db-access Secret (see db.* above) from an AWS Parameter Store JSON value at secretPath containing whichever of db-owner-username/db-owner-password/writer-password/reader-password apply to your db.mode.
eso.aws.roleArnstring""IRSA role ARN, required when enabled
eso.secretPathstring""required when enabled: AWS Parameter Store path to the JSON value
fullnameOverridestring"krci-audit"
imageobject{"pullPolicy":"IfNotPresent","repository":"epamedp/krci-audit","tag":""}krci-audit app image: one image ships both binaries (krci-audit-migrate, krci-audit-api); the migration Job and read API Deployment select which one runs via command. Top-level (not under images) because this is the image the CD Pipeline Operator builds and promotes — it overrides Argo CD Helm parameters image.repository/image.tag/image.digest by convention (see edp-cd-pipeline-operator), so this chart must expose them at this exact path.
image.tagstring""defaults to .Chart.AppVersion
imagePullSecretslist[]
images.kubeAuditRestobject{"pullPolicy":"IfNotPresent","repository":"ghcr.io/richardoc/kube-audit-rest","tag":"ad68f71978e8cd610b5b06769fab301cf9ee74d0-distroless@sha256:2444c1207156681c4ed04e7bb02662820c9bfb31b50e8fe5b0112b3f8f577d42"}kube-audit-rest: the ValidatingWebhook that logs the raw AdmissionReview. Pin by digest.
images.vectorobject{"pullPolicy":"IfNotPresent","repository":"docker.io/timberio/vector","tag":"0.56.0-distroless-static"}Vector: tails the log and writes to Postgres. >=0.46 for the postgres sink; >=0.53 for TLS.
migrationobject{"enabled":true}Schema migration Job (Helm hook on install/upgrade).
nameOverridestring"krci-audit"
nodeSelectorobject{}
podAnnotationsobject{}
podLabelsobject{}
replicaCountint1
resources.kubeAuditRest.limits.cpustring"1"
resources.kubeAuditRest.limits.memorystring"32Mi"
resources.kubeAuditRest.requests.cpustring"2m"
resources.kubeAuditRest.requests.memorystring"10Mi"
resources.vector.limits.cpustring"1"
resources.vector.limits.memorystring"256Mi"
resources.vector.requests.cpustring"2m"
resources.vector.requests.memorystring"10Mi"
retention.createAheadMonthsint3Future monthly partitions to pre-create ahead of the current month (ingestion runway).
retention.enabledbooltrueEnable the retention CronJob.
retention.imagestring"postgres:16-alpine"Image providing the psql client. Match the PostgreSQL major version.
retention.monthsint12Months of history to keep (whole number; minimum 1). Retention is month-granular: expired data is dropped one whole monthly partition at a time, and a partition is removed only once every record in it has aged past this many months — so the current + boundary month persist until they fully elapse. The smallest effective window is ~1 month; sub-monthly windows (e.g. weeks) are not supported.
retention.resources.limits.cpustring"500m"
retention.resources.limits.memorystring"128Mi"
retention.resources.requests.cpustring"10m"
retention.resources.requests.memorystring"32Mi"
retention.schedulestring"0 2 * * *"Cron schedule (default: daily at 02:00).
serviceAccount.createbooltrue
serviceAccount.namestring""
sharedUIDint255999Both containers must share a uid: kube-audit-rest (lumberjack) writes the log file mode 0600 and the Vector sidecar reads it from the shared volume.
tlsobject{"createSelfSignedIssuer":true,"issuerRef":{"kind":"Issuer","name":"krci-audit-selfsigned"}}TLS serving cert for the webhook, cert-manager-managed. The webhook's caBundle is injected by cert-manager via inject-ca-from.
tls.createSelfSignedIssuerbooltrueCreate a self-signed Issuer in this namespace. Set false to use an existing issuer.
tolerationslist[]

Deploy krci-audit with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has krci-audit on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartkrci-audit is pinned at v0.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply