The guide: Enrolment and tokens
Reach is in development. Its packages are not published.
What it is#
Enrolment is how a machine joins a Reach server for the first time. An administrator makes an enrolment token in the console (Add machines page) and gives it to the machine. The Reach agent (the read-only program installed on the machine) uses it once to register, and from then on the machine has its own identity.
Why it matters#
The token is the only thing that lets a new machine in, so it controls who may report to your server. The identity is what the server trusts afterwards, so it matters what happens to it when a server is rebuilt or a clock is wrong.
How it works#
The token. In the console you give a token a label and three limits:
| Limit | Allowed values | Default |
|---|---|---|
| Lifetime | 1 to 365 days | 30 |
| Maximum uses | 1 to 1000 machines | 1 |
| Rate limit | 1 to 10000 per hour | 200 |
The token is shown once, on screen, when you create it. It holds the server's address, a secret, and, when the server uses its own evaluation certificate (self-signed mode), a pin of the server certificate's key. The console keeps the secret sealed with the server's key-encryption key (the KEK: see server administration).
Enrolling. reach-agent enrol --token-file <file> makes a new Ed25519 key pair on the machine, proves it holds the token's secret without sending the secret, and registers the public key. The server replies with the machine's ID and a salt, signed so the agent can check the reply came from the pinned server. The agent stores the identity and deletes the token file. Commands for each system are in the install guides: Rocky Linux, Ubuntu, Windows. macOS is not part of this evaluation.
After enrolment. Every request the agent sends is signed with its key and carries the time. The server accepts a request whose time is within 5 minutes of its own clock. Between 5 minutes and 24 hours apart the server answers with its own signed time and the agent corrects itself once; beyond 24 hours the agent refuses to send. See the clock.
The pin. In self-signed mode the token pins the server certificate's key; with your own certificate (--tls files) the token carries no pin and agents use the operating system's trust store. With a pin, if the server is rebuilt and its certificate key changes, enrolment and sending fail with a message that says the certificate does not match the pin. You make a new token and enrol again with --force. See re-enrolling.
Two kinds of identity. On a machine with the service you enrol the machine (--machine, as the reach-agent account). Running enrol as an ordinary user makes a per-user identity for the one-shot mode (scan --send). Doing both on the same computer lists it twice in the console, so follow the install guide for the mode you use.
What it does not do#
- Revoking a token does not disconnect a machine that has already enrolled. A revoked token only stops further enrolments. Retiring an enrolled machine from the console is not built yet; to stop it, stop or remove the agent on that machine (Look after agents).
enrol --forcedoes not delete anything on the server. The server treats the new identity as a new machine, and the old record stays and goes silent.- The token is not a password for the console. People sign in with their own accounts.
- A used-up, expired or revoked token cannot be revived. Make a new one.
Check your understanding#
- You revoke a token that a machine used last week. Does that machine stop reporting? Why?
- What does the agent do with the token file after a successful enrolment?
- The server was rebuilt and its certificate changed. What do you do on each machine, and why will
--forcealone not fix a clock problem?
Next: findings, rules and alerts.