Skip to main content

Workload Hardening

Every chart OLIVE ships is hardened at the pod level. Almost none of it is switchable — it comes with the charts — but it is worth knowing what is set, because it determines what the cluster must tolerate and what a Pod Security Standard will and will not accept.

Two of the controls are switchable, because not every host can enforce them: see AppArmor and seccomp on hosts that cannot enforce them.

Base images​

OLIVE uses distroless images where practical. A distroless image contains only the runtime components needed to execute the application and excludes package managers, shells and general-purpose utilities.

The security value is post-exploitation: an attacker who achieves code execution inside a container with no shell, no curl, no wget and no package manager has a materially harder time doing anything with it. Distroless images also carry fewer packages, which reduces both the vulnerability count a scanner reports and the effort of triaging it.

Where distroless is not feasible, slim variants are used; failing that, officially maintained images from a trusted source. In every case the base image is actively maintained, pinned, scanned and updated through a controlled process.

What is set on every pod​

ControlWhat it doesWhy it earns its place
AppArmor profileLinux kernel mandatory access control restricting, per process, which files, network operations and capabilities it may useConfines an attacker who achieves code execution — for example through a dependency vulnerability — to a narrow cage instead of the whole container. Requires Kubernetes > 1.31
seccomp: RuntimeDefaultFilters which syscalls the process may make; blocks roughly 44 risky calls including mount, ptrace, kexec_load, rebootMost container-escape techniques depend on precisely these syscalls. A Node.js application never needs them, so the risk drops with no loss of functionality
capabilities: drop ALLRemoves every Linux capability (NET_RAW, CHOWN, SETUID, …)Prevents raw socket access for spoofing or sniffing, and file ownership changes. An Express server on a port above 1024 needs no capability at all
readOnlyRootFilesystemMakes the container root filesystem immutable; writes go only to explicitly mounted volumes (/tmp via emptyDir)Breaks attack chains that depend on writing a binary, a web shell or tampered code to disk — including most persistence techniques
allowPrivilegeEscalation: falseSets the kernel no_new_privs flagPrevents the classic in-container escalation via setuid binaries, and is a prerequisite for the Restricted Pod Security Standard
Non-root executionThe workload runs as an unprivileged userRemoves the assumption that container root is harmless
Digest pinningThe image is referenced by immutable digest, not by tagA tag can be repointed in a registry, causing the cluster to pull different content with no manifest change
Restricted service-account permissionsLeast-privilege RBAC; tokens not auto-mountedWorkload identities authenticate to Vault, not to the Kubernetes API
Resource requests and limitsBounded CPU and memoryContains resource exhaustion to the offending workload

Charts hardened: express (the shared chart behind the Express services), couchdb, seaweedfs, auth-proxy, keycloak-setup, tenant-setup, vault-secrets-setup, workflow-engine-postgres, schedule-trigger-cron-job, vault-infra.

AppArmor and seccomp on hosts that cannot enforce them​

AppArmor and seccomp are the two controls in the table above whose enforcement depends on the host, not on Kubernetes. Both default to on, and both can be switched off:

global:
appArmor: true # default. Set false on hosts without AppArmor
seccomp: true # default. Leave on unless the container runtime cannot apply it
ValueDefaultTurn it off when
global.appArmortrueThe host uses SELinux rather than AppArmor — RHEL, Rocky, CentOS Stream, OpenShift — or the node simply has no AppArmor, which is the case on some managed Kubernetes offerings
global.seccomptrueRarely. RuntimeDefault is supported by every current container runtime. Turn it off only if the runtime rejects the profile
The symptom is pods that never start, and the message is clear

A node that cannot apply the profile does not ignore it — the kubelet rejects the pod, with an event along the lines of Cannot enforce AppArmor: AppArmor is not enabled on the host. The pod never reaches Running, and no amount of restarting changes it.

If that is what you are seeing, set global.appArmor: false and re-sync. Confirm the host's state first rather than switching it off on suspicion:

# On the node: does AppArmor exist and is it enabled?
cat /sys/module/apparmor/parameters/enabled # Y when enabled

Keep the value the same across every chart in a cluster, in the shared values file — a cluster where some charts request the profile and others do not is one where half the workloads start. The five infrastructure charts read the same global.appArmor and global.seccomp.

Switching AppArmor off removes a control, and nothing else compensates

Dropping the profile does not weaken the other controls in the table — non-root, read-only root filesystem, dropped capabilities, no_new_privs and seccomp all still apply — but the per-process confinement is gone. On an SELinux host, SELinux provides mandatory access control of its own, which is the reason the trade is acceptable there. On a host with neither, it is a real reduction: record the decision, and raise it in your production readiness review. See Production Readiness Checklist.

Alongside these: Temporal's PostgreSQL superuser access is disabled and its application role reduced after initialisation, the Temporal operator APIs are better protected, the Redis container behind the auth proxy is hardened, Vault jobs run as non-root, and default log levels were reduced where they were set to debug and could capture identity data.

No package installation at runtime​

Several Kubernetes jobs previously started from a generic base image with root privileges, downloaded and installed packages at runtime, and then ran the actual workload. That pattern has been replaced with purpose-built images.

The argument is about reproducibility and about who gets root. Installing at runtime means the runtime environment is never fully reviewed: package versions vary with whatever the repository serves that day, which can introduce vulnerable dependencies with no validation step. And because the installation runs as root, a compromised repository, mirror, dependency or install script effectively receives elevated privileges inside the container. A purpose-built image can be scanned, pinned, tested and signed before deployment; the job then runs from a known, immutable artefact instead of modifying itself at startup. It is also faster and removes a runtime dependency on external registries being available.

ChartJobPackages formerly installed at runtime
keycloak-setupimport-keycloak-realm-jobcurl, jq, coreutils, gettext
schedule-trigger-cron-jobschedule-trigger-cron-jobcurl, jq

Pod Security Admission​

tenant-setup labels the tenant namespace:

podSecurity:
enabled: true
enforce: baseline
audit: restricted
warn: restricted
version: latest

enforce: baseline blocks the container-escape primitives — privileged containers, host namespaces, hostPath, most capabilities — without breaking the Vault agent sidecars the injector adds, which do not satisfy restricted.

audit and warn are already restricted, so restricted-level violations are reported without blocking. Check them before moving enforce to restricted:

kubectl get events -n <namespace> --field-selector reason=FailedCreate

Readiness and liveness probes​

Probes reflect real dependency health — for example whether the service can actually reach its storage — rather than merely whether the process is running. A probe that reports healthy while the service cannot serve requests degrades both availability and the reliability of any alert built on it.

Under an ambient mesh, probes arrive from a SNATed link-local address rather than the node IP; see Service Mesh and mTLS.