Expand description
A headless server accepts the attestation of a registered external host.
The CEF host proves the AgentMux windowโs connection with its IPC token
(operator_proof). A headless server reached through a separate host process has no CEF host,
and a shared secret would prove nothing, because every agent on the machine can read what srv
can. So the external host is a key pair: it keeps the private key, and srv holds only the public
key, registered once at boot (--external-host-key-file) before any connection or agent exists.
There is no route or call that registers or replaces it, so a later or second registration
cannot happen.
What the host attests is one connection, by the challenge nonce the connection asked srv for
(operator.challenge), for a short lease, naming the person. The host also gives each
connection it proxies an id of its own, signed, in the x-amx-conn header; srv binds the
challenge to that id, and the signed attestation carries it, so a connection that did not come
through the host (one opened on loopback by anything else) can never be attested.
Signed text, fixed field order, version first (the signature is Ed25519; fields are checked to
hold no |):
amx-conn/v1|<workspace>|<conn> the connection header
amx-attest/v1|<workspace>|<conn>|<nonce>|<person>|<valid_until> an attestation
amx-revoke/v1|<workspace>|<conn>|<issued_at> ending a connection's proof
amx-host/v1|<workspace>|<op>|<issued_at>|<args> a call of the host's own (`host_control`)Structsยง
- Attest
Request ๐ - Conn
Guard ๐ - Holds a connectionโs id while it is open and gives it back when it closes.
- Host ๐
- The registered host and the connections it proxied that are open now.
- KeyFile ๐
- Nonce
Request ๐ - Revoke
Request ๐
Constantsยง
- CONN_
HEADER - The header the host puts on the websocket upgrade of a connection it proxies:
<conn>.<signature>. - KEY_
FILE_ ๐VERSION - The key fileโs version.
- MAX_
LEASE_ ๐SECS - The longest lease srv grants, whatever the host signed: the host asks for five minutes.
- REVOKE_
WINDOW_ ๐SECS - How old a revocation, or a call of the hostโs own, may be.
Staticsยง
- HOST ๐
Functionsยง
- claim_
connection ๐ - A websocket upgradeโs host-proxied identity: the verified id and the guard that frees it.
Nonewhen no host is registered, the header is missing or not the hostโs signature, or the id is held. - conn_ok ๐
- handle_
attest ๐ POST /api/v1/host/external_attest: the registered host vouches for one connection.- handle_
nonce ๐ POST /api/v1/host/external_nonce: which host-proxied connection a challenge was issued to (its id), without spending the challenge. The host asks before it signs; a connection that did not come through the host answersnull.- handle_
revoke ๐ POST /api/v1/host/external_revoke: the registered host ends one connectionโs proof.- host ๐
- The registered external host, if srv was started with one.
- log_
registered ๐ - Say in the log, once logging is up, that an external host key was registered at boot. Only the public keyโs fingerprint is written: a person comparing it with what the host reports can tell the two hold the same key.
- nonce_
ok ๐ - not_
registered ๐ - person_
ok ๐ - plain ๐
- refused ๐
- register_
from_ ๐file - Register the external host from its key file, once, at boot. A second registration is refused.
- set_
once ๐ - workspace_
ok ๐
Type Aliasesยง
- Refusal ๐
- Why a call was refused: the status and a line for the host.