Skip to content

Secrets and org keys

Connection secrets typed in the console are encrypted in the browser to a node’s key and stored by InCentru Cloud only as references the org’s nodes can open. The key that opens them, the org key, is created on the first node and passed to each new node of the organisation, wrapped to that node’s own key, so InCentru Cloud never holds it in clear.

Only nodes the organisation trusts with it hold the org key. InCentru Cloud grants it to nodes with a tag the org gives keys to (every org starts with key-holder, which the bundled node carries) and says so when the node connects. A node takes the key only while that grant stands, and drops it once the grant is withdrawn. A node tagged local (a laptop, say) or locked with org_key: never never asks for it.

Restoring the org key from a recovery kit. If every node that held the org key is gone, the organisation’s recovery kit brings it back. When a node that may hold the key connects with no copy and no holder is online, InCentru Cloud sends it the kit’s copy of the org key, and the node logs “received the recovery copy of the org key”. Then, on that node, run incentru recover (in a container, docker exec -it <node> incentru recover) and type the kit when asked; the input is hidden. The node opens the copy, holds the key and sends InCentru Cloud its own copy. It says “this is not your organisation’s current kit” when the kit is not the one the organisation has now, and “no recovery copy received (a node that holds the key may be online)” when nothing was sent. A node locked org_key: never refuses. The kit never goes to disk, the logs or InCentru Cloud: the command passes it to the running node over a socket in the state directory (control.sock, readable by the node’s user only).

Rotating the org key. An administrator rotates the org key from the console. One node that holds the key makes the new one and sends InCentru Cloud its copy; once InCentru Cloud sends that copy back, the new key is current on that node and then on every other. While older data moves, nodes keep the earlier key in memory, as they keep the current one, and open what was encrypted under it: secret references, the run’s data and its history, chats and poll events. They also make fingerprints under an earlier key when a task names it. Everything new is encrypted and written under the current key only. A node that joins during a rotation gets the earlier key too. Nodes that do this declare the org-key-rotation capability.

Retiring an earlier org key. Then the earlier key is retired, so that no copy of it is left. A connected node that holds both keys and declares the org-key-retire capability takes Reseal tasks, which move the older data to the current key in batches: the node opens each blob or secret reference under the key the task names, encrypts it again under the current key as the same kind of data, and returns only ciphertext, references and fingerprints, never a value in clear. Each item is written back only if it did not change in the meantime. When all of it has moved, InCentru Cloud sends each node RetireOrgKey: the node moves its own run history to the current key, deletes its copy of the earlier key, keeps the key’s id on disk and answers OrgKeyRetired. A node that is offline does this when it reconnects. A node refuses to delete its current key or the key it is rotating to, and is asked again; one that holds no current key deletes the earlier key all the same, and history it could not move ages out as usual. From then on a node refuses every copy of a retired key, a recovery kit’s included. Nodes under the owner lock org_key: never move nothing. A copy of older data taken before the rotation can still be opened by someone who also has the old key.

Pinning the administrators’ keys. A node encrypts for a member’s device only when an administrator approved it, and it checks that approval against the administrators’ keys it trusts. It trusts the version of those keys its setup key pins (the key’s admins field), never one InCentru Cloud names: from that version it verifies each later version InCentru Cloud sends and keeps the newest in <state-dir>/admins.json, never going back to an older one. A node enrolled with a key that pins nothing logs so and trusts no member device until its owner pins it: run incentru trust <fingerprint> on the running node, with the 32-character fingerprint an administrator sees in the console under Organisation → Security → Member approvals. A pin only moves forward. incentru status prints the administrators: code (16 characters in groups of 4): compare it with the code an administrator sees. A pinned node also wraps the org key to a recovery kit only when its verified administrators’ keys list that kit.

Admitting a node to the org key. A pinned node wraps the org key to another node only when an administrator admitted that node. An administrator does that by making the setup key in the console: the browser keeps the key’s secret, gives InCentru Cloud only its public key, and signs a statement (incentru-setup-key:v1) naming the key, its public key, tags, locks and expiry. The node that enrols with the key signs its encryption key with the secret. Before it shares, a key-holding node checks the statement’s signature against its verified administrators’ keys and the enrolling node’s proof against the statement’s key. So a node enrolled with a setup key minted through the API, by a script, or by a since-removed administrator runs without the org key, and so does one whose setup key had expired when a holder was asked to share, tags it local or locks it org_key: never. Refusals are recorded as org_key lock refusals. Anyone holding the setup key text is admitted, as intended: keep it as secret as a password.

Admitting a node that is already enrolled. A node enrolled without an administrator’s setup key can be admitted later. An administrator makes a setup key for that node in the console, and the node’s operator gives it to the running node:

Terminal window
incentru admit <setup key> # or with no argument: typed hidden, or one line on stdin
docker exec -it <node> incentru admit # a node in a container

The node proves it holds the setup key as it does at enrolment, over a new signing request made with the key it enrolled with and over its encryption key; the key’s secret never leaves the node. Key-holding nodes check that admission as they check an enrolment’s, and from then on take the copies of the org key the node makes. The node must be running (incentru up). It refuses with this node is not enrolled with InCentru Cloud, this node enrolled before nodes kept their admission key: enrol it again, this key is for another InCentru Cloud installation, not connected to InCentru Cloud; try again once it is, or, when its owner locked the org key out (org_key: never), this node's owner locked the org key out (org_key: never).

Variable Effect
INCENTRU_SHARE_ORG_KEY=false Sets the lock org_key: hold: this node holds the org key but does not pass it to new nodes.
INCENTRU_SECRET_<NAME> A secret workflows can use by name: smtp.password is INCENTRU_SECRET_SMTP_PASSWORD.
INCENTRU_MASKING_FLOOR Sets the lock masking_floor (layout, masked or real): InCentru Cloud’s masking settings are never applied looser than this level. An invalid value stops the node before it enrols.
INCENTRU_LOCKS_FILE The node locks file (or --locks-file); default /etc/incentru/locks.json. See Locks.
INCENTRU_SECRETS_DIR A directory of named secrets, one file per name.
INCENTRU_STREAM_ENDPOINT host:port (or a host, meaning port 443) of InCentru Cloud’s node stream (or --stream-endpoint), when it has moved since the node enrolled and the old address no longer answers. The node keeps the new one. While the old address still answers, InCentru Cloud tells the node the new one itself.