Menu ▾ ▴

#23 [Feature]: Mount runtime secrets through an ephemeral file interface

open
nobody
2026-09-24
2026-09-11
Anonymous
No

Originally created by: thomijasir
Originally owned by: thomijasir

Feature description

Allow dopbase run to supply secrets through a protected ephemeral path instead of environment variables.

Current behavior

Runtime secrets are injected as environment variables into the child process.

Why we need this

Some applications require a credentials or configuration file. Environment variables may also be visible to child processes or diagnostic tools that do not need every secret.

Proposed CLI interface

  • dopbase run ENVIRONMENT --mount ./secrets.json --format json -- command
  • dopbase run ENVIRONMENT --mount ./app.env --format dotenv --mount-max-reads 32 -- command

Expected behavior

  • When --mount is present, do not inject secret variables into the child.
  • Set DOPBASE_SECRETS_PATH to the absolute mount path for the child process.
  • On Unix, create a named pipe with permission mode 0600 and fail if the path already exists.
  • Serve the selected serialized payload each time the pipe is opened until the read limit is reached or the child exits.
  • Default --mount-max-reads to 32. Treat zero as unlimited.
  • Infer dotenv, JSON, or YAML from the mount filename unless --format is supplied.
  • Remove the named pipe after normal exit, child startup failure, Ctrl+C, SIGTERM, or an internal error.
  • Keep child exit codes and signal forwarding unchanged.
  • On unsupported platforms, fail before fetching secrets with an actionable message.

Security and compatibility

  • Never create a persistent plaintext fallback file.
  • Do not inject secret variables while mount mode is active.
  • Do not overwrite an existing file, pipe, or symlink.
  • Write only secret names, never values, to diagnostics.
  • Keep the mount path out of structured secret output.

Out of scope

  • Native Windows named-pipe support.
  • Template rendering.
  • Mounting several files in one invocation.

Acceptance criteria

  • [ ] The child can read the selected payload from DOPBASE_SECRETS_PATH.
  • [ ] Secret variables are absent from the mounted child environment.
  • [ ] The pipe has mode 0600 and cannot replace an existing path.
  • [ ] Read limits work, including zero for unlimited reads.
  • [ ] Cleanup runs for success, failure, and termination signals.
  • [ ] Unsupported platforms fail without leaving files or fetching plaintext.
  • [ ] All supported formats match normal export serialization.

Test scenarios

  • Add Unix integration tests under app/tests/cli/ and compile-time platform tests for unsupported systems.
  • Cover permissions, repeated reads, limits, existing paths, symlinks, serialization, environment isolation, child failure, signals, and cleanup.

Documentation

Document supported platforms, path lifetime, read limits, format selection, and why mount mode does not inject environment variables.

Dependencies

Reuse the serializers introduced by [#18]. No server change is required.

Related

Tickets: #18

Discussion

  • Anonymous

    Anonymous - 2026-09-11
     

Log in to post a comment.