The guide: Signed Statements
Reach is in development. Its packages are not published.
For the owner and administrator of a Reach server, and for anyone who is handed a Statement and wants to check it.
What a Statement is, and what it is not#
A Statement is a signed snapshot of what Reach's agents (the read-only programs on your machines) last reported, as at a time by your server's clock. You hand it to someone outside your IT team, such as an auditor, a board or a client, so they can check that it came from your server unchanged. Its figures are the ones the console's Statement preview shows, signed by your Reach server's Statement key. The first thing on a Statement is what Reach could not see.
What the signature proves: that your server's key signed these figures at that time, by your server's clock.
What it does not prove:
- that the figures are true;
- that the clock was right;
- that the key belongs to the organisation named in the Statement. Only comparing the key's fingerprint with the one that organisation published shows that. Anyone can make a key, sign a file naming any organisation, and hand over that key with it;
- that no later Statement, or competing one, exists. A reader sees only the Statements handed to them.
A Statement issued on a server holding made-up data (reach-server demo-seed) says so inside its signed bytes. Its page, its print and statement verify all say "Demonstration data". Never use a server seeded with demonstration data for real. Its organisation stays marked as demonstration data for good, and so does every Statement it issues. Set up a separate server for real use.
It is not an assurance, an audit or a certificate.
Your own server makes every Statement, and Reach sends nothing to Sys-Ki.
Issuing one#
On Statement preview, an owner presses Issue a Statement. Admins and viewers cannot issue one; every role can read and check them.
The server then does the following, all at once:
- It checks the organisation's audit log.
- It builds the Statement from the figures as they are at that moment.
- It numbers the Statement: 1 for your first, then one more each time.
- It adds the previous Statement's ID, and the audit log's row count and head.
- It signs the Statement and stores its exact bytes.
- It writes the issue to the audit log, with who issued it.
If the audit log's chain does not hold, or is shorter than when the last Statement was issued, the server refuses to issue. In that case run reach-server audit verify and look into it.
The console has no way to change or remove a Statement once issued.
Each Statement has its own page. It shows the following:
- the figures as signed;
- the Statement's ID, which is the SHA-256 of its exact bytes;
- its number;
- the key's fingerprint;
- the previous Statement's ID;
- the time.
The printed page carries the ID, the key and the time at the top of every page.
From that page, download three files:
- the Statement (
reach-statement-<n>.json); - its signature (
reach-statement-<n>.sig); - the key (
reach-statement-public-key-<first 16 of the fingerprint>.pem).
The Statement key#
Made: the server makes the key the first time a Statement is issued, or when you run sudo -u reach-server reach-server statement key. That command prints the key in use, its fingerprint in groups of four, and the public key.
Kept: the private key is kept in the database, sealed with the server's kek file (keys.kek_file, AES-256-GCM), the same way as the server's other keys.
- A database copy on its own cannot sign: it holds only the sealed key.
- A backup is the database and the kek file together: see server administration. Keep them apart, as that page says.
Publish the fingerprint. Put it where the people you hand Statements to can find it without your server: your own website, a trust page, or a separate message. Read it out when asked.
A reader should compare the key with that published fingerprint, never with the Statement or its page. Anyone can make a page or a file that names a key.
List the keys: sudo -u reach-server reach-server statement keys lists every Statement key the server has had, in use and retired, with its fingerprint and dates. It does not need the kek file. Statement preview shows the same list, with how many Statements each key signed.
Checking a Statement#
With Reach, on any machine, with no server, database or network:
reach-server statement verify reach-statement-3.json --key reach-statement-public-key-1234567890abcdef.pem --fingerprint "1234 5678 90ab cdef ..." --previous reach-statement-2.json(The key name and fingerprint above are made-up examples.)
- What it checks: that the file is a Statement in its exact signed form, and that the signature holds for that key.
--fingerprint: compares the key with the fingerprint the organisation published. Spaces and colons are allowed.- Without it, the output says plainly that the key was NOT compared, and shows the fingerprint to compare by eye.
- A key that does not match fails.
--previous: checks that this Statement directly follows the earlier one you give: the same organisation, the next number, and the earlier Statement's ID as its previous.- It shows a gap, or an earlier Statement that was replaced, within the Statements you were handed.
- It cannot show a Statement you were never handed.
- It cannot show a second run of Statements from a restored backup (below).
- What it prints: every check runs before anything is printed.
- When any check fails, the output is one line starting
DOES NOT HOLD:with the reason, and the exit status is 1. - When all hold, it prints the ID, organisation, any demonstration marking, number, time, key, whether the key was compared, and what the signature proves and does not.
- When any check fails, the output is one line starting
- Exit status: 0 when everything holds, 1 when anything does not.
By hand, with OpenSSL 3.0 or later:
- The key's fingerprint, to compare with the published one:
bash openssl pkey -pubin -in reach-statement-public-key.pem -outform DER | openssl dgst -sha256
- The signature file is base64. Turn it back into the 64-byte signature:
bash base64 -d < reach-statement-3.sig > reach-statement-3.sig.bin
- Check the signature over the Statement's exact bytes:
bash openssl pkeyutl -verify -pubin -inkey reach-statement-public-key.pem -rawin -in reach-statement-3.json -sigfile reach-statement-3.sig.bin
- The file must begin with
{"schema":"reach.statement/1",, so a signature over another kind of file cannot pass for a Statement:
bash head -c 30 reach-statement-3.json
- The Statement's ID is the SHA-256 of the same bytes:
bash openssl dgst -sha256 reach-statement-3.json
The steps by hand check the signature, the kind and the ID. Only statement verify also checks the exact signed form and that one Statement follows another.
Changing the key#
Run sudo -u reach-server reach-server statement rotate-key.
- What changes: the key in use is retired and a new one is made. The old key does not have to be opened, so this works after a key was exposed.
- Statements already issued: they keep their signatures and still check with the old key. Keep its public key, or its fingerprint, where readers find it.
- New Statements: they are signed by the new key, which the command prints.
- Next steps: publish the new fingerprint. If the old key was exposed, tell your readers from which date they should no longer trust it. Changing the key is not enough on its own: a reader who does not hear of the change cannot know.
- In the console: Statement preview shows which key signed which Statement.
Losing the key, and restoring from backup#
- Restored together: a server restored from a backup of the database and its kek file has the same Statement key and goes on signing with it. This is tested.
- Restored without its kek file: the database cannot sign.
statement keysays the key "cannot be opened with this server's kek file", and the server itself does not start, because its other keys cannot be opened either.- The public keys are still in the database:
statement keyslists them without the kek file. - Statements already issued still check with them.
- This is tested.
- The public keys are still in the database:
- The kek file lost for good: the server's sealed keys are lost with it, and the server does not start on this database.
- Statements already issued: they still check with the old public key.
statement keysreads it from the old database without the kek file (tested), or use the copy of the key you kept from Statement preview. - Setting up again: follow server administration. A new server makes a new Statement key, and its Statements start again at number 1. Tell your readers the new fingerprint, and that the old run of Statements ended.
- Statements already issued: they still check with the old public key.
- Restored from a backup taken before the latest Statement: the server issues the next number again, with different content. Its sequence continues from the backup, and its audit log is the backup's.
- Neither the server nor
statement verifycan tell, from one run of Statements alone, that an earlier Statement with that number was handed out. Two different Statements with the same number, each following the same earlier one, both check (tested ininternal/document). - What to do: after restoring an older backup, tell the people you gave Statements to, so they can set the two side by side.
- Neither the server nor
- Before each issue, the server checks that the newest Statement it stores and the newest issue in its audit log name the same Statement, and refuses when they do not. That catches a Statement removed from one but not the other, not a whole database restored from an older backup.
Not in this version#
- the period a Statement covers;
- the method and evidence sections;
- a separate
reach-verifyprogram for readers who do not have Reach Server; - a key-change record signed by the old key.
These are planned and not built yet. The format, reach.statement/1, may still change until a Statement first leaves our own test machines. After that, every Statement issued must stay checkable for good.