Why run OpenBao from a distroless container image
A platform team running OpenBao in containers usually wants the smallest runtime it can operate safely. The openbao-distroless image, added in OpenBao 2.6, contains only the OpenBao binary. There is no shell, no package manager and no general-purpose userland in the image. For the team, that means fewer packages to patch, fewer tools an attacker could use after a container compromise, and a smaller set of findings for the vulnerability scanner to report. The trade-off is that every operational task you would normally run inside the container now has to happen from outside it, through the Kubernetes API, a sidecar, a debug container or the host.
The teams that benefit most are those that already run OpenBao as a fixed, declaratively managed service and do not expect to log into the container to fix things. Typical candidates are clusters where configuration comes from manifests or a Helm chart, where the unseal and initialization steps run through a controlled procedure, and where image provenance and scanning results are reviewed as part of a release. Before you adopt the image, confirm its exact tag, its contents and its supported entrypoint against the OpenBao release notes for your target version, because the image was introduced in the 2.6 line and the naming and contents may change in later releases. Record the tag you deploy so that your change records match what is running.
A standard image with a shell is still the better choice when your operators depend on exec-ing into pods to run bao commands, inspect files or test network paths during incidents, or when your tooling assumes a shell exists in the container. It is also the safer default for a first deployment, a lab or a cluster where the team is still learning the unseal and recovery workflow. Plan the choice before go-live, because moving between the two images later means revalidating health checks, init scripts and debugging runbooks. Decide which operational tasks must remain possible without a shell, then test them on a non-production cluster before you commit.
How the distroless image differs from a standard image
This table compares the distroless OpenBao image with a standard image and an HSM-enabled image across shell access, debugging, health checks, patching and vendor libraries. Read each row as a trade-off, not a ranking, because the right image depends on how your team operates and where your keys are held. Treat every cell as a starting point to verify against the documentation for your exact release.
| Aspect | Distroless image | Standard image | HSM-enabled image |
|---|---|---|---|
| Shell access | No shell or package manager is included, so operators cannot exec into the container for ad hoc commands. | A shell and common utilities are available for interactive troubleshooting inside the container. | Generally follows the distroless model, but confirm whether any shell or helper tools are included for HSM diagnostics. |
| Debugging tools | Debugging relies on logs, the audit device, metrics and an ephemeral debug container or sidecar attached to the pod. | Standard tools such as curl, ps and text editors can be run directly in the container. | Vendor client utilities for the HSM may be present or absent, so confirm which tools your release ships. |
| Health-check methods | Checks should call the HTTP health endpoint from outside the container, since no in-container probe binaries exist. | Health checks can use shell commands or bundled utilities inside the container as well as HTTP endpoints. | Use the same HTTP endpoint approach, and confirm how the HSM connection status surfaces in health output. |
| Package patching | Fewer system packages reduce the patch surface, but you rely on new image tags for base-layer fixes. | System packages are updated through the base image and may need separate patch cycles. | Adds vendor libraries that carry their own update cadence, so patching depends on both the image and the vendor. |
| Vendor library handling | Vendor libraries are not expected to be present, so HSM use usually requires a separate image. | Vendor libraries are generally not included unless you build a custom image. | Vendor PKCS#11 libraries are bundled or must be mounted, so confirm licensing and the exact library path for your HSM. |
| Verification before rollout | Test that seal, unseal and audit logging work under the image's entrypoint and filesystem layout. | Test that startup, storage access and config paths match your existing deployment. | Test the HSM seal path end to end, including failover and recovery, before any production cutover. |
| Confirm before you choose | Check the image documentation for your release for each cell in this row group before you plan a rollout. | Check the image documentation for your release for each cell in this row group before you plan a rollout. | Check the image documentation for your release for each cell in this row group before you plan a rollout. |
Where the binary, probes, config and HSM library sit
The diagram starts at the image, which holds only the OpenBao binary, and shows the config and TLS files mounted in from outside. The probe path reaches the server over its listener, and the server writes encrypted data to the storage backend in a separate trust boundary. The optional HSM client library is mounted into the container and talks to the HSM across the network, so check which side of the node boundary each file and key lives on. A separate debug container sits beside the pod for troubleshooting, not inside the image.
Image contents, mounts, probe path and trust boundaries for an OpenBao pod.
How to set up a distroless OpenBao container
This sequence takes a team from choosing the right image to a running, initialized and unsealed OpenBao node that restarts cleanly. Each step has a check, so the team can confirm the container behaves as expected before it joins any HA cluster or serves production workloads.
Confirm the image tag matches your release
The platform team matches the openbao-distroless tag to the OpenBao release line it plans to run, using the OpenBao releases page to confirm the exact version. The distroless image is available from release 2.6 onward, so older lines need a different image. Pull the image and run the binary's version command directly with a one-off container. The check passes when the reported version matches the tag and the release notes for that version.
Mount configuration and certificates read-only
Place the server configuration file and TLS certificate and key files in a host directory, then mount that directory into the container as read-only. Confirm that the non-root user the image runs as can read these files but cannot modify them. Keep private keys out of the image and out of any build context. The check passes when the mount shows as read-only in the container inspection output and a write attempt to the configuration path from inside a second test container fails.
Set the storage backend and listener
Define the storage stanza and a TCP listener with TLS in the configuration file, along with the API and cluster address values. Choose integrated Raft or PostgreSQL based on your team's operating model, after reading the OpenBao storage backends documentation. The data directory must be a writable volume, and it should be the only writable path in the container. The check passes when the container starts, the logs show the listener bound to the expected address, and the node reports as uninitialized.
Define health probes without a shell
Because the image contains no shell or utilities, health checks must use HTTP or TCP probes from the orchestrator or from the container runtime. Point an HTTP probe at the health endpoint in the OpenBao API, and confirm in the API documentation which status codes indicate uninitialized, sealed and active states. Set your orchestrator to treat those states as expected, so a sealed node is not restarted in a loop. The check passes when the probe returns the sealed or uninitialized status before initialization.
Initialize and unseal through the API
Run initialization and unseal from a client host that has the bao CLI or curl installed, setting the address variable to the listener URL, since the container has no tools for these steps. Record the generated key material according to your custody plan, and keep it out of logs and shell history. Repeat the unseal call until the threshold is met. The check passes when the health endpoint reports initialized and unsealed, and a test secret can be written and read back.
Verify clean restart and sealed behavior
Restart the container with the same configuration and data volume. Without auto-unseal, the node starts sealed, so confirm that your unseal procedure and key holders are available before go-live. Check the logs for configuration warnings or permission errors. The check passes when the node comes back sealed, unseals with the documented procedure, and returns the test secret written earlier, which shows that the data volume and configuration persisted.
What changes for debugging and health checks
Without a shell, every probe and troubleshooting step has to run over the network. A distroless image has no sh, no curl, no wget and no package manager, so an exec-based readiness or liveness probe has nothing to execute. Replace these with HTTP probes that call the OpenBao API from the kubelet, a load balancer or the orchestrator. Point the probe at the health endpoint on the listener you actually expose, and decide in advance which status codes mean the node is ready to receive traffic, is sealed, or is a healthy standby. Confirm the exact status codes and query parameters the health endpoint returns for your version, because standby and sealed states are reported differently and your probe thresholds depend on that behavior.
Seal status is best read from outside the container through the API. Your operators can query the seal status endpoint from a bastion or monitoring host that holds network access to the listener, and collect the same answer from the logs the process writes to stdout. Keep the monitoring identity narrow: a token or auth method that can read health and seal status but cannot read secrets or change configuration. For troubleshooting that needs more than the API, do not add a shell to the production image. Instead, use an ephemeral debug container that shares the pod's process namespace, or node-level tooling that inspects the container runtime, and remove it when the work is done. Ask your platform team to write this as a named, approved procedure with audit records, so the exception is visible and repeatable. Your security team should confirm that the debug path cannot be used to read the OpenBao data directory or the unseal material.
Where distroless images fit: Kubernetes, Compose and HSM hosts
Kubernetes is where a distroless image fits most naturally, because the platform already supplies probes, security contexts and ephemeral debugging. The main change is that habits built on a shell inside the pod stop working, so the pod spec and your troubleshooting runbook both need updating.
- Probes: Exec probes that call a shell or helper binary will fail because the image has none. Use HTTP probes against the health endpoint your OpenBao version exposes, and set timeouts that allow for sealed and standby states.
- Pod security settings: Set
runAsNonRoot, a fixed numeric user, dropped Linux capabilities, a seccomp profile andallowPrivilegeEscalation: false. - Read-only root filesystem: Enable
readOnlyRootFilesystemand mount writable volumes only for paths OpenBao writes to, such as its data and temporary directories. - Ephemeral debug containers: Attach a tooling image with
kubectl debugand share the process namespace, so diagnostic tools exist only for the session and never enter the production image. - Admission policy: Confirm the namespace's Pod Security admission level accepts these settings before the first rollout.
Confirm the image's default user, the health endpoint path for your version, every path that needs a writable volume, and whether your cluster policy permits ephemeral containers.
On single container hosts, the image runs with standard runtime settings, but the operator loses the shell for inspecting files, configuration and permissions. Most early problems come from file ownership, storage paths and log handling, so those are the settings to verify before first start.
- Volume mounts: Mount configuration and TLS material read-only where possible, and confirm the numeric user inside the container owns the writable data directory.
- Ownership without a shell: You cannot run
chowninside the container, so set host-side ownership before start and check it withstatfrom the host. - Restart policy: Choose a policy such as
unless-stoppedoron-failureand test what happens after a host reboot. A node may come up sealed or wait for unseal, depending on your seal configuration, and automation must expect that state. - Log drivers: OpenBao writes operational logs to standard output. Confirm your log driver, rotation and retention settings, and whether audit devices write to a file path that a log shipper reads.
- Rootless Podman: Rootless runs change port binding and UID mapping. Test both before production, because the numeric user seen inside the container may map to a different host user.
Confirm the image tag and digest, mount paths, UID mapping, restart behavior after reboot and where audit output lands.
HSM-backed unseal changes the image more than any other setting, because the PKCS#11 module is a vendor shared library loaded at runtime. A minimal image without that library cannot load the module, so the HSM variant must include the library and its dependencies, and the team must confirm the vendor supports that packaging.
- Vendor library path: Place the module at a fixed path inside the image or mount it read-only, then reference that exact path in the seal stanza. Confirm the library's own dependencies are present in the image.
- Device access: Pass the HSM device into the container through explicit device mapping or a Kubernetes device plugin. Confirm group membership gives the non-root user access without running the container privileged.
- PKCS#11 configuration: Set the module path, slot or token label, key label and PIN source. Load the PIN from a file or secret mount, and confirm the PIN never appears in logs or in the process arguments.
- Image provenance: Confirm who builds the HSM image, whether the vendor permits redistribution of its library in a container, and how you verify the image digest before deployment.
- Failure behavior: Test that the HSM is reachable after a node restart and that an HSM outage blocks unseal, so operators know the failure mode before go-live.
Confirm the vendor's container support statement, the library path and dependencies, device permissions for the runtime user and the unseal test procedure on the exact image digest you plan to run.
Security settings that matter for a distroless OpenBao container
A distroless image removes most of the software an attacker could use after a foothold, but it moves some risk into configuration, secret delivery and update discipline. The cards below cover the settings that decide whether the container stays small in practice, and the checks to run before and after each change.
Reduced attack surface and its limits
The openbao-distroless image, added in 2.6, contains only the OpenBao binary, so there is no shell, package manager or general-purpose utilities for an attacker to use. This does not remove risk from the OpenBao process itself, from the configuration it loads, or from the storage and network paths it trusts. Check that your deployment still needs the ports and listeners you expose, and that no sidecar or init step adds a shell back into the pod.
OpenBao overviewRead-only root filesystem
Mount the root filesystem as read-only and list every writable path OpenBao still needs, such as the data directory for file-based storage, a temporary directory if your configuration uses one, and any audit log file path. Keep these as explicit volume mounts with the narrowest permissions. Test a cold start and a seal and unseal cycle under the read-only setting, because failures often appear only on the first restart after a change.
Running as a non-root user
Set a fixed non-root UID and GID in the pod or container spec, and confirm that the files OpenBao reads, including TLS keys and the configuration file, are readable by that identity but not writable by it. Without a shell, you cannot fix ownership from inside the container, so set it in the image build or through volume ownership settings. Verify the effective user with the orchestrator, not only with the image metadata.
Secrets in environment variables or files
Environment variables are visible to anyone who can read the pod spec or inspect the process, and they often leak into logs and crash dumps. Prefer mounted files with restricted permissions for TLS material, unseal configuration and any credentials used to reach the storage backend. Avoid putting unseal keys or root tokens in environment variables. Confirm which values your orchestrator writes into its own API objects and who can read them.
Image signing and digest pinning
Pin the image by digest in manifests rather than by a mutable tag, so a changed tag cannot swap the binary without a review. Verify signatures or provenance for the image and check them in admission control before the pod starts. Record the digest you deployed alongside the OpenBao version it contains, so you can answer which binary ran during any given period. Ask the project and your registry team which signing and attestation formats are published for each release.
Patch timing for images and binaries
Distroless images reduce the number of packages to patch, but the OpenBao binary and the base layers still need updates. Track the project's security advisories and patch releases for your minor line, then rebuild and redeploy the image with the matching digest. Set a written window for applying critical fixes, and test the new digest against a non-production cluster that uses your real unseal and storage setup before promoting it.
OpenBao releasesRunning HSM-enabled images without a shell
An HSM-backed OpenBao needs the vendor's PKCS#11 library loaded at start-up and access to the HSM device from inside the container, so the image contents change. The library is a shared object with its own dependencies, and a distroless image that holds only the OpenBao binary needs that library and any runtime files it loads added, or mounted from a volume. The HSM device must also be passed through to the container. Your seal stanza then points at the library path, the token or slot, and the key label, while the PIN comes from a secured file or environment variable so it stays out of configuration files. Check each of these before the first build, because a missing library or device often shows up only when the container starts.
Treat the unseal path as a dependency that the team tests on every restart and every node replacement. Start a clean container from the exact image you plan to run, with no cached state, and confirm that OpenBao unseals against the HSM without manual key entry. Repeat the test after a node is replaced and after the image is rebuilt for a patch release. Verify the library version against the HSM vendor's stated compatibility with your OpenBao release, because a library that loads on one minor line may not match another. Confirm the exact seal configuration keys and the supported library handling in the OpenBao unseal documentation, and ask the vendor which library version it supports for your HSM model.
Failures show up in the startup logs and in seal status, so decide in advance what monitoring will watch. A library that cannot be loaded, a device that is not visible inside the container, or a wrong PIN or key label should leave the node sealed while the process keeps running. An orchestrator may then report the container as healthy while it serves no requests. Check seal status through the health endpoint at sys/health and alert on any node that stays sealed after a restart. Ask the HSM vendor which library errors appear in these cases, and confirm the matching OpenBao log lines in the unseal documentation before you write alert rules that depend on them.
Limits to confirm before you standardize on distroless
A distroless image trades shell access and package tooling for a smaller attack surface. Each card below names one assumption that a standard image hides, who can confirm it, and what to test in your own cluster before the image becomes the default.
Available tags per release line
Confirm which openbao-distroless tags exist for the release line you run, and whether the tag you pin matches the exact patch version in your change record. Check the OpenBao release notes for the minor line you target, since the 2.7.x and 2.6.x lines are both current and shipped on the same dates. Do not rely on a latest tag for production pinning. Ask the team's own test cluster to pull the pinned tag before the change window opens.
- Latest patch cited
- 2.7.1
HSM variant availability
Confirm whether a distroless build exists for the HSM variant you need, and whether it bundles the PKCS#11 library your hardware module requires. Your HSM vendor must confirm that its client library loads from a minimal filesystem with no shell or package manager. If no distroless HSM image exists, plan a separate, hardened base image and treat it as a distinct artifact in your build pipeline.
Health endpoint responses
Confirm what the health endpoints return in your configuration, including sealed, standby and uninitialized states, because load balancers and orchestrator probes often map those codes to pass or fail. Without a shell, exec-based probes will not run, so the probe must be an HTTP check. Test each state on the test cluster and record the status codes your probe expects.
OpenBao HA docsUpgrades and rollbacks without a package manager
Confirm your upgrade and rollback path when the image has no package manager, no shell and no way to patch files in place. Every change becomes a new image digest, so rollback means redeploying the previous pinned image. Confirm that your storage layout and migration steps work across the two images, and rehearse a rollback on the test cluster before you rely on it in production.
Monitoring and log agent compatibility
Confirm whether your monitoring and log collection agents can run beside the OpenBao container. Sidecars that need a shell, writable paths or host access may fail, and some agents require a base image with libraries that a distroless image omits. Also confirm that the metrics listener and audit log paths are reachable by the agent. Test each agent in the test cluster and record any required volume mounts.
Image content evidence for audits
Confirm how you will show auditors what is inside the image. A minimal image has fewer packages to list, but your assessor will still ask for a software bill of materials, the build provenance and the digest deployed in each environment. Ask the OpenBao release notes and your own build pipeline to supply those artifacts, and store them alongside the change records that link each digest to an approved release.
Questions buyers ask before running OpenBao distroless
How much effort does moving from a standard OpenBao image to distroless take?
The effort depends more on what your containers depend on than on the image itself. The openbao-distroless image contains only the OpenBao binary, so the server process, configuration and endpoints stay the same, but anything the standard image provided must be found and replaced. Common examples are init scripts, helper binaries, shell-based health checks, sidecars that call a shell and file permissions set in the image build. Teams with documented deployments and a non-production cluster to test on usually have less to change than teams that customize containers by hand. Ask for a written scope that lists each container dependency found, the test cluster used to prove the switch and the rollback step if a node fails to start after the change.
What drives the cost of running OpenBao from distroless images?
The image is not the main cost. Most of the spend is people's time for build, test, rollout and run work, and it rises with the number of moving parts. The main drivers are:
- The number of clusters and environments, each needing its own build, test and rollout.
- The storage backend and HA design, since integrated storage (Raft) and PostgreSQL are the officially supported HA backends and each has its own operating steps.
- Whether an HSM image is involved, which adds device access, vendor libraries and testing against the hardware.
- How many pipelines, runbooks and monitoring rules depend on tools that a distroless image does not include.
One-time costs cover the migration, pipeline changes and testing. Recurring costs cover upgrades, image updates and on-call support. DeployOpen issues a quote from a written scope, so ask any provider to price each item separately.
Can our own team run the distroless migration without outside help?
Often yes, if your team already runs OpenBao in containers and can test changes outside production. The skills that matter are container builds, your orchestrator's health probe configuration, OpenBao configuration and unseal operations, and the storage backend you run. Teams that have never debugged a container without a shell should close that gap before cutover. The OpenBao migration guide describes in-place replacement of the server process, but it was tested only against Vault 1.14.1 community edition, so teams moving from Vault should validate that path in their own environment. An outside partner can take the work as a fixed-scope engagement or support a team that keeps the run work. Decide by naming who owns rollbacks and who holds unseal material during the change.
How long does a pilot of OpenBao on distroless images take?
No duration is published for this work, so the length should come from a written scope. A typical pilot covers one non-production cluster, a build of the image in your own registry, a test of startup, unseal, health checks and restart, and a documented rollback. The elapsed time depends on how many dependencies your current containers have, how quickly your change approval process moves and how fast your team can provide test access and data. Ask the provider to state the pilot's entry criteria, its exit criteria and the number of environments in scope, and whether the pilot's results carry over to production or the production steps are tested again.
What do we need to provide for a distroless OpenBao engagement?
The engagement needs access, configuration details and acceptance criteria from your side. Provide:
- Cluster access in a non-production environment, with rights to create test workloads, read pod events and change deployments.
- Storage details: the backend you run, where it lives, how it is backed up and who can restore it.
- Unseal and recovery details: whether you use Shamir keys, an auto-unseal mechanism or an HSM, and who holds that material.
- Current container manifests, build files and pipeline definitions.
- Test plans and acceptance criteria, including the health checks your load balancer and orchestrator depend on.
If an HSM image is in scope, also provide device details and the access path for the device library. Confirm these items in the written scope before work starts.
How do we debug OpenBao when the container has no shell?
Plan your debugging approach before the switch. A distroless image contains only the OpenBao binary, so shells, package managers and common Linux utilities are not available inside the container. Most teams move diagnosis outside the container: they read logs and metrics through their platform, run bao status from a separate admin pod or host that can reach the API and attach an ephemeral debug container where the platform supports it. Confirm with your platform team that ephemeral debugging is allowed under your security policy, since it changes who can inspect a running process. Write runbooks for seal status, leader checks and audit log review, and test them before cutover.
Does an HSM image change how we check health and protect keys?
Yes. The HSM variant needs its own review because the device, its client library and its access path become part of the container build. Confirm with the HSM vendor which PKCS#11 library and drivers your device requires and whether they can be included in a minimal image without a shell. Test health checks with the device attached and detached, since a failing device path can look like a sealed or failed node. Key custody stays with your organization: decide who can use HSM credentials, how those credentials are rotated and where recovery material is kept. Request a separate scope and test plan for the HSM image.
How DeployOpen scopes and supports distroless OpenBao
DeployOpen plans, builds, tests, documents and supports OpenBao in your own infrastructure, including how the server runs from a distroless image. Engagements are fixed-scope, with scope and deliverables agreed in writing before work starts, and ongoing support is available as a retainer.
How we scope
- Inventory your container platform, registry rules and whether the image must run in a build-time or runtime HSM setup.
- Record which debugging, health check and log collection methods your operators rely on today.
- Agree in writing which OpenBao version line, image variant and storage backend the engagement covers.
How we build
- Deploy the openbao-distroless image with your orchestrator, using health checks that rely on the API instead of shell commands.
- Configure ephemeral debug containers or sidecar patterns so operators can inspect a running server without adding tools to the image.
- Test HSM-enabled image variants against your key custody design, with the vendor's module and driver confirmed in your environment.
How we hand over
- Deliver a runbook covering image pinning, upgrade steps, debugging procedures and the on-call steps for failed health checks.
- Document the image provenance and digest verification steps your security team can repeat during reviews.
- Walk your platform and operations teams through a test restart, a failed health probe and a version upgrade in your own environment.
How we support
- Retest the image after each OpenBao patch release and record changes to debugging or health check behavior.
- Review new minor-line releases against your deployment before you change the pinned image version.
- Offer retainers for ongoing upgrades, monitoring of security advisories and continuous testing of the running setup.

