Security model
moirad holds the Docker socket, which is root on its host. Every rule here follows from that.
Boundaries
Section titled “Boundaries”- client →
moirad, over the network: pinned TLS plus a per-client bearer token. - browser →
moira ui, on the same machine: loopback only, Host and Origin checks, and a single-use login link. - The deploy folder is trusted. Anyone who can write to it can already run arbitrary Compose
as root, so
moiraddoesn’t defend against them.
- On first start,
moiradcreates an ECDSA P-256 key and a self-signed certificate valid for 10 years. Its SAN and CN are the host ofMOIRAD_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.
Invites
Section titled “Invites”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.
--namefixes 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.
Tokens
Section titled “Tokens”- A token is
moira_followed by 32 random bytes. The server stores only its SHA-256; the client stores it in its config file (mode600). - Every request except enrollment must carry
Authorization: Bearer <token>. Unknown and revoked tokens get401. moirad clients revoketakes effect on the next request and closes the client’s open log streams.- There are no scopes yet: every enrolled client can do everything.
Network exposure
Section titled “Network exposure”Keep :7443 on trusted networks (LAN or VPN). On hosts with a public interface, firewall the
port before starting moirad. See Install moirad.
Secrets in env files
Section titled “Secrets in env files”- Env values are never logged by
moirador 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
0600in a private directory and deleted afterwards.
moira ui
Section titled “moira ui”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.