Core
Security
How opod core authenticates callers and workers, how to encrypt the north side, what it stores, and every network call it can make.
In short
Every caller needs an API key, and every leader-to-worker call is signed with a per-worker HMAC key. Opod core assumes a trusted network between its leader and workers (your LAN, or a VPN you run): it encrypts the north side when you give it a certificate, but it ships no mesh of its own. This page says what is protected, what is not, and how to lock a leader down.
Give the leader a certificate
OPOD_TLS_CERT=/etc/opod/tls.crt OPOD_TLS_KEY=/etc/opod/tls.key opod upMake workers trust exactly that certificate
OPOD_LEADER_CA=/etc/opod/ca.crt opod join "https://leader.example.com:8080?token=sk-orc-<node-token>"Give each person their own key, with an expiry
opod token create alice --ttl 30d opod token revoke k_abc # when alice leavesKeep the admin key off logs
The admin key lives in
~/.opod/admin.key. Do not paste it into tools;opod token create ops --adminmints another when you need one.
Check it worked
curl -s https://leader.example.com:8080/v1/models --cacert /etc/opod/ca.crt{"error":{"type":"missing_api_key","message":"Authorization header required"}}A request with no key is refused with 401. The same request with -H "Authorization: Bearer sk-orc-<alice-key>" answers 200. curl http://… (plain) to the TLS port fails.
API keys
- Format:
sk-orc-followed by 24 random bytes, base64url-encoded. - Stored as SHA-256 hashes. The plaintext appears once, when the key is created.
- One scope per key:
user(/v1/*),admin(/v1/*and/admin/v1/*) ornode(worker register and heartbeat). - Optional expiry:
--ttlor--expires-at. An expired key gets401 key_expired. - Revocable at any time with
opod token revoke.
A key is sent as Authorization: Bearer sk-orc-…. The gateway also accepts X-Api-Key: sk-orc-… (Anthropic style) and a ?key= query parameter (for clients that cannot set headers, such as a browser EventSource). A query-string key can end up in access logs that record URLs.
auth.require_keys: false (or OPOD_REQUIRE_KEYS=0) lets /v1 requests through without a key, for local development only. /admin/v1 always needs a key.
OPOD_REQUIRE_KEYS=0 opod up # local development onlyThe admin key file
The first standalone opod up saves the admin key to ~/.opod/admin.key with mode 0600, so CLI commands on that host work without typing it. Protect that file like an SSH key. A managed leader started with OPOD_ADMIN_TOKEN writes no key file.
Leader and worker authentication
- A worker joins with a
nodekey (the join token) or a client certificate. - After the join, every call between leader and worker is signed with HMAC-SHA256 using that worker's token. The header is
X-Opod-Auth: v=1,id=<node id>,ts=<unix seconds>,sig=<hex>. The signed string isv1, the method, the path and the timestamp, joined by newlines. A signature older or newer than 5 minutes is refused, so keep clocks in sync (NTP). - The body is not signed, and the traffic is not encrypted by opod.
- A worker also accepts a bearer token from the leader, for upgrades.
OPOD_REJECT_BEARER=1on the worker accepts HMAC only. - The leader stores each worker's token in the
nodestable. A stolenstate.dblets an attacker act as a worker; encrypt the disk if you cannot trust the host.opod node showandGET /admin/v1/nodesinclude the token.
Worker certificates
A worker can be identified by a client certificate instead of a token:
- On the worker:
OPOD_NODE_CERTandOPOD_NODE_KEY(PEM). The node id comes from the certificate's SPIFFE URI SAN,spiffe://<domain>/opod/node/<id>, read from the verified chain only. - On the leader, in the auth snapshot:
nodeMtls(off,alloworrequire),nodeCertCa(the CA PEM) andrevokedCerts(serial numbers, lowercase hex).
nodeMtls | Effect on register and heartbeat |
|---|---|
off or empty | Certificates are ignored. The token is the credential. |
allow | A certificate signed by nodeCertCa authenticates the worker. Without one, the token is used. |
require | A join or heartbeat without such a certificate is refused. |
The default is off. A worker that joins with a certificate and no token creates its own secret for HMAC and sends it to the leader over the TLS connection.
Encrypt the north side
Give the leader a certificate and it serves /v1, /admin/v1, the probes and the join path over HTTPS:
OPOD_TLS_CERT=/etc/opod/tls.crt OPOD_TLS_KEY=/etc/opod/tls.key opod upWorkers trust exactly that certificate through OPOD_LEADER_CA=/etc/opod/ca.crt. Leader-to-worker traffic stays plain HTTP, HMAC-signed. A reverse proxy (Caddy, nginx) in front of the leader is a fine alternative.
Two extra listeners trade encryption for convenience. Both are off by default:
| Setting | Serves | Use it when |
|---|---|---|
probe_listen / OPOD_PROBE_LISTEN | /healthz, /readyz, /loadz, /metrics only, always plain | a scraper or autoscaler should read numbers without the CA. Nothing authenticated is routed there. |
plain_listen / OPOD_PLAIN_LISTEN | the whole API, always plain | a load balancer cannot originate TLS to each leader. Prompts, answers and keys cross the network in clear text: bind it only where a firewall or network policy decides who connects. A leader that cannot bind it does not start. |
OPOD_TLS_CERT=/etc/opod/tls.crt OPOD_TLS_KEY=/etc/opod/tls.key \
OPOD_PROBE_LISTEN=:8081 opod up # probes and /metrics in plain on :8081
OPOD_PLAIN_LISTEN=:8082 opod up # the whole API in plain on :8082 — firewall itRequest data
- Request and response bodies are not stored. A usage row holds metadata only: key id, user, model, protocol, token counts, latency, time to first token, outcome and node.
- Spans carry serving facts only; no key, user or team is put on a span.
/healthz,/readyz,/loadz,/gatewayzand/metricsneed no key. They carry no prompts and no key ids.- Client address. Behind a proxy, the leader takes the caller's address from
True-Client-IP, thenX-Real-IP, then the leftmostX-Forwarded-Forentry; a value that is not an IP address is skipped. It uses that address only as a label, on the access log line and the request's span. It never trusts it: the loopback check on the bootstrap admin key and the audit actor read the TCP peer. Anyone can set these headers, so do not read the logged address as proof of who called. There is no trusted-proxy list.
Weights and catalog supply chain
opod fetchand model loads can pin a Hugging Face revision (OPOD_MODEL_REVISION) and check a SHA-256 (OPOD_MODEL_SHA256). A mismatch removes the file and fails the load.- Catalog files in directories can be signed with minisign and verified with
OPOD_CATALOG_PUBKEY;OPOD_CATALOG_REQUIRE_SIGNED=1refuses unsigned ones. See Models. block_private_targets: true(OPOD_BLOCK_PRIVATE_TARGETS=1) refuses outbound catalog-probe and similar calls to loopback, link-local and private addresses. For exampleOPOD_BLOCK_PRIVATE_TARGETS=1 opod up.trust_proxy_headersis off by default:X-Forwarded-HostandX-Forwarded-Protoare ignored when the leader builds its public URL. Turn it on only behind a proxy you control.
Container images
Release images are signed keyless with cosign (Sigstore) and carry an SPDX SBOM as an attestation:
cosign verify \
--certificate-identity-regexp 'https://github.com/opod-io/' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
ghcr.io/opod-io/opod-leader:<version>Pin images by digest. If verification fails, do not run the image.
Every network call opod can make
Opod sends no telemetry. With no OTLP endpoint configured, a leader calls only the engines and nodes you chose.
| Direction | When | How to turn it off |
|---|---|---|
| to the engine endpoint | every inference request | choose another engine |
| leader and workers | heartbeats every 5 s, model loads, requests; HMAC-signed | opod node remove, or do not join |
to Hugging Face (or HF_ENDPOINT) or the Ollama registry | when weights are pulled, and the HEAD check in model add | pre-place weights; set HF_ENDPOINT to a mirror; OPOD_SKIP_SOURCE_CHECK=1 |
to api.github.com and GitHub Releases | only when you run opod update | do not run it |
| to an OTLP collector (traces) | when OPOD_OTLP_ENDPOINT is set | unset it |
| to an OTLP collector (logs) | when OPOD_OTLP_LOGS_ENDPOINT is set | unset it |
to the policy's routing.fallbackUrl | only when a manager set one and the leader has no serving capacity | remove it from the policy |
Threat summary
| Threat | Mitigation |
|---|---|
| A worker is compromised | Workers hold no admin scope. Each worker's calls are signed with its own token. |
| A user key leaks | Revoke it. An expiry bounds its life. |
| Node traffic is sniffed | North side: TLS listener. Leader to worker: signed, not encrypted — use a VPN. |
| A leaked join token registers a node | Use worker certificates with nodeMtls: require; revoke serials in revokedCerts. |
| The leader is compromised | The leader is the trust root. Rotate admin keys. |
| Tampered weights or catalog | SHA-256 pins and signed catalog files. |
If it fails
| Symptom | Fix |
|---|---|
401 missing_api_key "Authorization header required" | Send Authorization: Bearer sk-orc-…, X-Api-Key, or ?key=. |
401 invalid_api_key "Invalid or revoked API key" | The key is wrong or revoked. Mint a new one. |
401 key_expired | Renew it: opod token renew ID --ttl 30d. |
A worker cannot join a TLS leader: x509: certificate signed by unknown authority | Set OPOD_LEADER_CA on the worker to the leader's CA. |
| Leader-to-worker calls refused after a reboot | Clock skew over 5 minutes. Fix NTP on both machines. |
401 this endpoint requires a worker client certificate (nodeMtls=require) … | Give the worker OPOD_NODE_CERT and OPOD_NODE_KEY, or set nodeMtls to allow. |
403 certificate revoked (serial …) | The serial is in revokedCerts. Issue the worker a new certificate. |
Report a vulnerability
Do not open a public issue. Open a private advisory at github.com/opod-io/opod-core/security/advisories/new. Fixes ship on main and in the next release; older releases are not patched.
Last updated · Source: content/docs/core/security.mdx · View as Markdown