Skip to content

Security model

moirad holds the Docker socket, which is root on its host. Every rule here follows from that.

  1. client → moirad, over the network: pinned TLS plus a per-client bearer token.
  2. browser → moira ui, on the same machine: loopback only, Host and Origin checks, and a single-use login link.
  3. The deploy folder is trusted. Anyone who can write to it can already run arbitrary Compose as root, so moirad doesn’t defend against them.
  • On first start, moirad creates an ECDSA P-256 key and a self-signed certificate valid for 10 years. Its SAN and CN are the host of MOIRAD_URL.
  • Clients don’t use a CA. They pin the certificate’s SHA-256 fingerprint, which arrives inside the invite, so there is no trust-on-first-use. A mismatch is refused before any HTTP bytes are sent, and there is no fallback to an unpinned connection.
  • Rotating the certificate means deleting tls/ and re-enrolling every client.

An invite is moira1. followed by base64url JSON:

{ "host": "edge", "url": "https://192.0.2.10:7443", "fp": "sha256:<hex>",
"secret": "<32 bytes, base64url>", "exp": "<RFC 3339>" }
  • Created over the admin socket inside the container, so creating one requires access to the host.
  • Kept in daemon memory as a hash, valid for 15 minutes, accepted once, and dropped on restart.
  • --name fixes the client name, so a leaked invite can’t choose its own.
  • Failed enrollments are limited to five per minute per source address, and to eight concurrent attempts.
  • Pipe invites through stdin (… | moira server add -) to keep them out of process listings.
  • A token is moira_ followed by 32 random bytes. The server stores only its SHA-256; the client stores it in its config file (mode 600).
  • Every request except enrollment must carry Authorization: Bearer <token>. Unknown and revoked tokens get 401.
  • moirad clients revoke takes effect on the next request and closes the client’s open log streams.
  • There are no scopes yet: every enrolled client can do everything.

Keep :7443 on trusted networks (LAN or VPN). On hosts with a public interface, firewall the port before starting moirad. See Install moirad.

  • Env values are never logged by moirad or the client.
  • They travel only in the two env read responses, over authenticated TLS.
  • CLI diffs and web UI reviews are masked; the web UI reveals one key at a time on request.
  • Compose output is filtered against the stack’s env values before it is buffered, and hidden entirely when that can’t be done safely. Apply output after an env save is not shown.
  • Editor copies are mode 0600 in a private directory and deleted afterwards.

See Web UI → Security. Processes running as your OS user can read the client config and its tokens, so they are outside what the UI protects against.