Access control and allowlists

Access control and allowlists

A relay can't read your Restricted content, so the choice it makes is whose code it holds and who may read it. That choice is the allowlist. Grants, a separate thing, decide who reads which file.

What each list allows

A key on…May
--allow (the push allowlist)Push; pull, clone and fetch everything the relay holds; ask it to honour a burn; and deliver grants, unless --allow-grant is given
--allow-grant (the grant allowlist)Deliver grants to the relay's mailbox, and nothing else
NeitherCollect grants addressed to its own key, and read /info

--allow-grant replaces the default instead of adding to it. A push also delivers grants, so list your pushers in it too, or their pushes end with a 403 on the grant step.

/info answers anyone who can reach the relay, and it lists both allowlists. The keys you admit are not a secret.

An open relay

Start a relay with no --allow and it is open: any validly signed push is accepted, and anyone who can reach it can clone everything it holds, Internal content included. It prints a warning to stderr every time it starts. Open suits a throwaway on 127.0.0.1 or a network you trust, and nothing reachable from the internet.

Add or remove a key

The lists are read once, at startup. To change them, edit the command line and restart the relay. Nothing is lost: the data directory is unchanged, and a push cut off by the restart can be re-run.

--allow takes the OpenSSH line or 64 hex characters. To get the hex from a line, which is easier to put in a unit file:

loot whoami --pubkey | cut -d' ' -f2 | base64 -d | tail -c 32 | od -An -tx1 | tr -d ' \n'

A newcomer can't loot clone a relay that doesn't list them: a clone would mint a key the relay hasn't listed, so it refuses before creating anything. They make the key first:

# the newcomer
mkdir project && cd project
loot init --identity bob
loot whoami --pubkey                        # send this to the operator

# the operator adds --allow <bob's key> and restarts; then bob:
loot remote add origin https://relay.example.com
loot pull

Someone already listed from another machine clones with that key instead, using --identity-file (see Work on a second machine). A refused pull or push names the key and the list that refused it.

Removing a key stops its future pushes and reads. It does not take back anything already pulled. A relay knows nothing of account key retirement, so after someone rotates their key (see Rotate a leaked key), add the new key and remove the old one yourself.

The allowlist governs the host; grants govern content

Being on the allowlist lets someone pull from the relay. What they can read in what they pull is decided by keys: Internal for everyone who pulls, and Restricted only with a grant. A grant doesn't get anyone past the allowlist, and the allowlist hands out no grants. To share a Restricted file through your relay, the reader needs both (see Share a private file).