Skip to content

About

Unofficial Docker Secrets Engine implementation, via docker-credential-helpers

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

docker-secrets-engine-shim

CI codecov Dependabot

Docker's secrets engine resolves se:// references to real values when a container starts, keeping secret literals out of Compose files, .env files, and shell history.

Docker only releases secrets-engine as a proprietary, prebuilt binary, so this shim was created as an un-official open-source alternative which shims to the official docker-credential-helpers; providing the same base secrets-engine features via those instead.

What you get

  • A per-user daemon that resolves se:// secret references
  • docker pass, a Docker CLI plugin that manages secrets (set, get, ls, rm, run)
  • A dockerd plugin that injects resolved secrets into containers at creation

Requirements

  • Go 1.25+
  • Docker Engine 29.2+
  • A credential helper from docker-credential-helpers and a backend: pass (works headless) or secretservice (e.g. gnome-keyring)

Install

Arch Linux

docker-secrets-engine-shim is available on the AUR:

yay -S docker-secrets-engine-shim

Build from source

make all    # dist/docker-secrets-engine-shim

sudo install -Dm755 dist/docker-secrets-engine-shim /usr/bin/docker-secrets-engine-shim
sudo ln -sf docker-secrets-engine-shim /usr/bin/docker-pass
mkdir -p ~/.docker/cli-plugins
ln -sf /usr/bin/docker-secrets-engine-shim ~/.docker/cli-plugins/docker-pass

# the dockerd plugin is found via nri-opts.plugin-path in daemon.json
sudo install -d /usr/lib/docker/nri-plugins
sudo ln -sf /usr/bin/docker-secrets-engine-shim /usr/lib/docker/nri-plugins/10-secrets-engine

Enable se:// resolution in containers

sudo install -d /etc/docker/nri/conf.d
echo "uid: $(id -u)" | sudo tee /etc/docker/nri/conf.d/10-secrets-engine.conf
echo '{"nri-opts":{"enable":true,"plugin-path":"/usr/lib/docker/nri-plugins"}}' | sudo tee /etc/docker/daemon.json   # merge if one exists
sudo systemctl restart docker

Usage

docker-secrets-engine-shim
# or, with the unit from packaging/systemd/user/:
cp packaging/systemd/user/docker-secrets-engine-shim.service ~/.config/systemd/user/
systemctl --user enable --now docker-secrets-engine-shim.service
docker pass set mytoken=s3cr3t
docker run --rm -e TOKEN=se://mytoken alpine sh -c 'echo $TOKEN'   # s3cr3t
TOKEN=se://mytoken docker pass run -- env | grep TOKEN             # resolve without dockerd
docker mcp secret set apikey=sk-...                                # mcp-gateway interop

Set SECRETS_ENGINE_SHIM_LOG_LEVEL (e.g. debug) to change the daemon's log verbosity.

Security

The daemon only accepts connections from your own user and root. Secrets share the credential helper store with docker login registry credentials: only use se:// references you control. When a secret cannot be resolved, container creation fails, matching the official engine.

Differences from the official engine

  • Stores secrets via credential helpers instead of the engine's own keychain integration
  • Single user per host (the official Docker CE support has the same limitation)
  • No docker-auth or 1Password plugin - only support for docker-credential-helpers

About

Unofficial Docker Secrets Engine implementation, via docker-credential-helpers

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages