tom_secrets_service 0.16.0
tom_secrets_service: ^0.16.0 copied to clipboard
The secrets service of the Tom Secrets Manager: a background process that holds one user's unlocked vaults and answers local clients, the manager app and tsm.
Changelog #
0.16.0 #
- The browser prompt (protocol.md 5.5, decision 39, DP-44): the browser
host's
matchthat no grant covers asks the approvers once for the page's logins in the personal and shared vaults (approval_neededwithbrowserandurl;askBrowser);always/neverwrite grants for the host as started by its browser (exe-from, also from a remote approver),onceholds for that browser's host for 10 minutes across connections,folderis refused. No approver connected: no prompt. - The browser host never gets a system vault's value:
get,getManyandgetFileof one aredenied(reasonsystem_vault), audited. tomSecretsGrantSubjecttakesbrowser;tomSecretsLauncherOfmeasures the browser abovecmd.exeon Windows.
0.15.1 #
- After an OS unlock the app edits with the primary's composite key: the
primary's
keysofsaveandvault.movetakecompositeKey(base64, 32 bytes) in place ofpasswordandkeyFile(keyFilemay come beside it for the keychain); a further vault's keys still need the password. The service keeps the keychain's key file beside the composite key, sovaultKeysstill names it (pairing, the emergency sheet, a new vault sharing it), while the composite key opens the vault.
0.15.0 #
- The OS unlock (part-os-unlock, protocol.md 6.4, decision 38):
unlock {vault, bundle}opens the sealed key bundle with the admin connection's bundle key (HKDF of the admin key and both nonces): while locked it unlocks the service with the primary's composite key (a primary of another name locks again,not_found), unlocked it opens the store it names; a bundle that does not open isdeniedbad_bundleand counts as a failed authentication, a composite key that no longer opens the vault (re-keyed)bad_password; a connection that claimed the service sends none (unsupported). The service then holds the composite key in place of the password (TomSecretsHeldKeys.compositeKey,ofBundle) and the editing path'svaultKeySetcarries it askeys.compositeKey; the keychain adds no key file to it. - Lock mode (c) (
osUnlock): accepted bysettings.set,statussaysc; it relocks on idle like (b), and the app sendslockat the screen lock. - Needs
tom_secrets_client0.2.9,tom_secrets_core0.2.8,tom_kdbx_store0.2.5.
0.14.0 #
- "Sign in with GitHub" (part-key-rotation §3, DP-6, DP-83, DP-155,
protocol.md 6.3):
github.app(where the sign-in stands, never a token),github.app.configure(the App's client id into the primary's metadata, the manager app only),github.signIn(the device flow: the code to enter, then the eventgithub_sign_in),github.signOut. The service is the single owner of the device's user tokens (TomSecretsGitHubApp, keychain itemtsm.github-app.session): a signed-in device uses them for everygithub:vault, renewed before the 8 hours run out and once at GitHub's first 401; a refused refresh token leavessign_in_again. No client secret or App private key anywhere. statusReport.github; the keygithub-app:<device>(the refresh token's expiry) inkeysand the reminders; the device's record names how it reaches GitHub (githubAuth,githubTokenExpires), also aftertoken.set.- A keychain that says it is not available is not read at start.
TomSecretsServiceConfig.githubWebUrl. Ontom_secrets_core0.2.7.
0.13.0 #
- The git credential helper's side (part-os-integration, DP-52, DP-53):
matchtakesuserNameand, for the helpers,pick: one login of the host by the host rule — the one the client's grants cover, of several the one an allow grant names by its reference, else the user picks one of the host's logins at the app's prompt (approval_needed.pickandurl, answered byapprovewithpick):alwayswrites a grant for that login's reference (the helper's subject names the tool that started it,exe-from git => tsm),oncelets the connection read it once; refused, unanswered or with no approver connected, none. Over the approval link too. proposeis open to the helpers holding an allow grant; a credential the vaults hold already is ignored (acceptedwithknown).TomSecretsCoverage.named;tomSecretsIsHelperCall.
0.12.0 #
- The ssh-agent (part-os-integration, DP-48, DP-49, protocol.md 7.6): a
third endpoint,
agent.sockon Linux and macOS and the named pipe\\.\pipe\tsm-ssh-agenton Windows (FFI, overlapped I/O, the client's process fromGetNamedPipeClientProcessId), named inservice.jsonandstatusasagent. It lists and signs with the vaults'ssh-keyentries; its peers are measured as clients are. - Agent grants: the secret
ssh-key [host <fingerprints>] [forward] <target>, matched per destination host (session-bind) and forwarding; a forwarded request without a forwarding grant is refused without a prompt; a forwarded one with it, and a key or vault marked to confirm, is confirmed each time (approval_needed.confirmOnly, answeredonceornever).approval_needed.sshnames the key, the destination (with itsknown_hostsnames) and the purpose. approvetakessshHost(a lasting agent grant only for the destination) andwithParent(the subjectexe-from <parent> => <exe>, e.g. ssh started by git);grants.addtakes both forms.- Locked, the agent lists the keys kept with their grants
(
agent_keys.json) and a signature waits for an unlock. - The audit record has
ssh. TomSecretsSystemPeerMeasurer.measureProcessmeasures a process by its id.- On
tom_secrets_client^0.2.6.
0.11.8 #
- The phase-B client messages as features under protocol 1 (protocol.md
5.5, section 8):
welcome.featuresoffersbinary,getFile,matchandpropose, and the service keeps the ones the client'shellonames. getFile: an attachment or a field as bytes,file, binary chunks of 256 KiB (TomSecretsConnection.sendChunk),endwith its SHA-256; only for a client that namedbinaryandgetFile.match: the login entries of a page (tomSecretsMatchLogins) that anallowgrant of the client covers (TomSecretsLookupPolicy.coverage,TomSecretsCoverage), never a value; only for the browser host and the helpers (TomSecretsServiceConfig.browserHostExecutables,helperExecutables,tomSecretsLookupExecutables), no system vault for the browser host, audited.propose: a login of the browser host holding anallowgrant, passed to the attached manager app as the eventproposal;unavailable(no_app) with no app attached.- The rate limits count
getFile,matchandproposewithget.
0.11.7 #
- The approval link's listener survives a connection that drops before or during the handshake (a port scan, a peer that went away): the peer's address is read when the connection is accepted, and a failed write ends that session only. Before, reading the address of a closed socket for the log stopped the service.
0.11.6 #
- The pairing mode takes the handover's
approvalLink: it goes into the device settings the machine is set up with and, as this machine's link address, to the giving machine, whose service then opens the approval link at once (tsm pair --link). A link that is no approval link ends the pairing mode withhandoverbefore anything is sent. settings.setand the link server check an approval link withtomSecretsApprovalLinkProblem(tom_secrets_client0.2.4):settings.setnow refuses every interface (0.0.0.0,::) as the link server did.
0.11.5 #
vault.create(protocol.md 6.4, manager app only): a further vault created beside the primary. The app's new file is written where it lives (TomSecretsVaultOpener.create: afile:vault at its path, its folder made; agithub:vault in one commit throughTomSecretsVaultUnit.create), refused when a file is there (target_exists); only then is it listed in the primary with its keys, the token of a repository outside the primary's and its due date (keysDue), the primary written, and the vault served (TomSecretsVaultSet.create,TomSecretsService.createVault).
0.11.4 #
- The client endpoint's rate limits (protocol.md 11), per measured identity
(
TomSecretsRateLimits,TomSecretsServiceConfig.rateLimits): a token bucket of 20get/getManya second with bursts of 50 (rate_limited,reasonrequests,retryAfterMs); a 10 s wait per request for ten minutes after ten refusals in a minute; 16 open connections per identity and 256 in all (a connection over them is answeredrate_limited,reasonconnections, at itshello).
0.11.3 #
- The README rewritten: installing and starting, configuration (
bootstrap.yaml, device settings, environment), what the service does, limits, key types.
0.11.2 #
- The approver's links (
TomSecretsApproverLinks): the service keeps a session to every paired host it approves for, passes the host's prompts to the attached app (ids qualified<host>/<approvalId>) and carries the app's answers over the link (grants signed by this device; the client token with itsexe-tokengrant); a host's new link key is recorded. TomSecretsIdentity.fromJson,tomSecretsGrantSubject,tomSecretsTakeHostLinkKeypublic.
0.11.1 #
- The pairing mode (
tsm pair, part-sharing): started with aTomSecretsPairingHandover, the executable receives a pairing, reports it, sets the machine up with the master password tsm sends (TomSecretsFirstRun.runPaired) and ends (tomSecretsRunPairingMode). pair.recordrecords throughTomSecretsTrust.recordPeer.
0.11.0 #
- Pairing (manager app only, protocol.md 6.3, 9.8):
pair.identity: this device's public keys and link address.pair.record: a paired device recorded as an approver of this host and/or a host this device approves for, with the approval-token key, every key dated now, a device paired again replaced, and withrecordits device record in the primary.pair.revoke: what was recorded of the device goes and its record is marked revoked.pair.list: the device records.
0.10.0 #
- A host that rotated its own link key passes the new one to an approver
that connects under its previous key, first in that session (
linkKey, protocol.md 9.7); the host takes the approver's answer. The approver's side (tomSecretsDeliverOverLink(onHostLinkKey:)) records it for that host and answersok, and the service writes it into its trust material, so the approver connects under the new key from then on.
0.9.0 #
vault.move(manager app only, protocol.md 6.4): a store's outer encryption added or removed, which moves it to its locator with.kdbx.tsmxor.kdbx. The opener's newmovewrites the new file and then removes the old one (afile:store), or does both in one commit put on the branch without force (agithub:store); a stale copy, a file at the new place or a branch that moved refuses it and the old file stays. A further vault's entry in the primary takes the new locator and keys; for the primary, the bootstrap file'sprimary:and the keychain's key file and repository key under the new locator's handles follow.tomSecretsBootstrapWithPrimary: a bootstrap file with another primary, every other line kept.
0.8.0 #
keys.rotate {approver?, link?}(manager app only, protocol.md 6.3): this device rotates its own key pairs. A new approver pair: every grant and revocation it signed is signed again, and its key-change statement is written into the group of every host it approves for. A new link pair: the previous one stays in use for 14 days, for the hosts the new key has not reached and the approvers that connect here (the link server answers under it). Both go to every recorded host over the approval link at once (tomSecretsDeliverOverLink, the approver's side of the link); hosts not reached get the new link key at a later refresh.- A host takes key-change statements from its group of the vault at every
allow-list read (a host the link did not reach), and answers a statement
it took already
okover the link. keyList.keys[].ownmarks this device's own key pairs.
0.7.0 #
token.set {repository, token}(manager app only, protocol.md 6.3): renews a vault repository's GitHub token. The token is checked first (tomSecretsCheckGitHubToken: it sees the repository, a short-livedtsm-token-check-…branch is created and deleted to prove it may write, the expiry GitHub reports is taken), then it replaces the old one where that lives (the device keychain with its expiry, else the primary's vault entries for that repository) and every store is fetched again.
0.6.0 #
- Re-keyed saves (part-key-rotation, protocol.md 6.4): a further vault's
file that opens only with the keys the primary lists for it now is taken
as re-keyed; the primary's carries its new keys in
save'skeys, which then replace its key file and repository key in the device keychain. A re-keyed file is written as it is through the opener's newrekey(never merged;stale_basewhen the file moved), and the store's keys are the new ones from then on. A vault whose listed keys do not open it yet stays served with the keys held, and a vault not served keeps its copy while its file has not moved. compacttakesretentionDays, replacing the repository's retention (0 after a key change).
0.5.0 #
- A
github:store whose branch was rewritten without a compaction: after the refused save it reports the state (rewritten: {head}instatusReport.stores[]andstore_state), holds the refused edit and is not refreshed until the manager app answers withhistory.resolve(take: remotefollows the rewritten branch,take: mergemerges the held copy over it and commits on top; protocol.md 6.3, 6.4).
0.4.0 #
- The key reminders take the rotation age of the key pairs and the reminder
start of the other keys from the device settings (
keyPairAgeMonths,otherKeyWarningDays, DP-85) instead of constants;settings.setchecks the new settings' ranges.
0.3.0 #
settings.getandsettings.set(protocol.md 6.3): the device settings, the command-line approval switch and the stores the primary names; a write is accepted only from the manager app, checked (tomSecretsSettingsProblem), applied at once for the lock policy, the refresh, the timeouts, the cache and the reminder period, and answers which settings apply at the next unlock.
0.2.0 #
- A vault the primary lists that this machine does not serve can be edited
through the editing path (BP-15, protocol.md 6.4):
vaultKeySet.unservedlists such vaults,vaultKeysnaming one answers its keys withservedfalse,vaultFilenaming one reads it from its location and holds it for editing until the lock, andsavewrites it there (agithub:vault as a commit by this device). It is never served to clients.
0.1.0 #
- The service: the runtime directory with its owner and mode check, the
single-instance lock and
service.json; the client endpoint (Unix socket, or localhost TCP with the client token) withhello,get,getManyand the access policy; the admin endpoint with the mutual HMAC challenge,claim, the growing delay after failures,unlock,unlockStore,lock,status,subscribeandshutdown; lock modes (a) and (b) with the maximum unlocked time and the idle time per OS; the device settings container with its key modes; the starter, the handover and the admin client. - The unlock takes the primary's key file (when the request carries none)
and a
.tsmxprimary's repository key from the device keychain; the primary is opened, refreshed and written with its outer key. - The service admits the manager app of the distribution it is part of
(
tomSecretsDistributionApp: the app carriestsmand the service in itstsm/binfolder) besidestsmand the app beside it.