How ingest works Ingest is how a run made on your own machine reaches your organisation in the lab. Your machine runs the lab's command-line tool, invocation, against your product, then sends the finished run to the lab server. The server checks the run before it stores it. This page says what is checked, what is refused, and how you see a refusal. Ingest is early access. What you need first An ingest token. An owner or admin of your organisation makes one on the tokens page, as described in Members, roles, invites and tokens. Save it in a file on your machine. The tool reads the token from that file and does not print it. Your signing key, trusted for your organisation. Your install signs each run with a key of its own. The public half is a file in the keys folder of your lab root, named after the key's id and ending in .pub. Send us that public file, and keep the private key to yourself. Someone at the lab then trusts that key for your organisation, and for no other, with an operator command on the lab server. Until that is done, a run your key signs is refused. Sending a run does not add your key by itself. The lab server's name, allowed on your machine. By default your install sends evidence to a server on the same machine and nowhere else. To send it to the lab, add the lab server's host name to the sync list of the [hosts] table in your lab.toml, for example sync = ["lab.example.net"], or name it in the INV_SYNC_HOSTS environment variable for one shell. A server on another machine is reached over https; an http address is refused. Sending a run Send a finished run with: invocation sync --to https:// --token-file The address can be the server's own address, or its ingest address, which ends in /api/v1/runs. You can also have a run sent as it goes. invocation run with --stream and --token-file shows the run on the lab server while it happens, and sends it there when it ends. Before anything leaves your machine, the tool checks the run's evidence itself. A run whose evidence does not verify, or a run that has not finished, is not sent, and the tool says why. What the lab checks on arrival The token comes first. The delivery carries your token as a bearer token. A missing or wrong token is refused. After too many failed tries from one address, the server refuses deliveries from that address for a while and asks you to wait a minute. A good token is refused too when your organisation's standing does not allow work, for example when it has no plan or has been limited to reading, and the answer says so. Then your limits: requests per minute, events in one run, the size of the extra files that come with it, and the space your organisation holds. A delivery over a limit is refused with a sentence naming the limit. Then the run's id. If another organisation already holds a run with that id, the delivery is refused, and you are asked to choose another. Then the evidence and who signed it. The server checks the run with the same verifier that invocation verify uses. The run must have finished. Its hash chain must be unbroken. Its findings must match the findings recorded in the chain. Its folder must hold one run's record, not parts of two. And its whole manifest must be signed, under the current rule (version 2), by a key the server trusts. A run signed under the old version 1 rule, which does not cover the verdict, is refused. The keys the server trusts are the lab's own published keys, plus the keys trusted for your organisation when the run comes with your organisation's own token. A server with no trusted keys to check against stores nothing, and says so. What is refused because of its signer A run signed by your organisation's key, but sent with a token that is not your organisation's own, is refused. A run signed by a key trusted for some other organisation is refused, and the answer says so without naming that organisation. When the lab revokes trust in a key, runs it signs from then on are refused. Runs it signed and that were stored before the revocation still verify. How you see a refusal The server answers with a status code and one plain sentence saying why. The answer names no file or folder on the server. The tool prints that the run was not delivered, names the server, and gives the status and the server's answer. It adds that the run is still on your machine and that nothing of it was lost, so you can send it again with invocation sync once the problem is fixed. The tool exits with code 3 when a delivery does not happen, so a script can tell a failed delivery apart from a run that failed its checks, which exits with code 1. When a run is stored A stored run gets status 201, and the tool prints that the run was accepted, with its count of events and findings. Sending the same run again gets status 200, and the answer says it is already present. Sending a different run under an id your organisation has already used is refused; choose another id. The run then appears in your organisation's runs list. To read it, see Reading a run. Next Reading a run.