Repository navigation
feat(security): lock a namespace to your passkeys - #110
Merged
Merged
Conversation
…yet) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R1moYBoaoY4cZFbhBWqzEJ
Vault panel on each namespace's page (seal, unlock, lock, add and remove passkeys, make ordinary again), a PRF signing helper, a vault encrypting its files even with encryption.files off, vault_minutes validation, docs and changelog. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R1moYBoaoY4cZFbhBWqzEJ
Encrypt a namespace's files before its server key goes, catch up on unlock, remove a locked vault's working copies, guard admin passkey removal, owners-only lock and passkey owners, 409 on a key race, and no double encryption when a file is swapped mid-check. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R1moYBoaoY4cZFbhBWqzEJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Before: every namespace's data key was also wrapped by the server's key, so the server could always open its files.
After: an owner can turn a namespace into a vault from its page (Admin › Namespaces › Vault). Once it's a vault, only its passkeys open its files. Each unlock lasts
encryption.vault_minutes(60 by default). While it's locked, files answer 423 and queued work waits. Owners can add and remove passkeys while it's open (never the last one), lock it now, or make it ordinary again. There is no recovery code. Losing every passkey that opens a vault loses its files.How:
jobs.claimskips locked vaults. An admin's "remove all passkeys" is refused (409) while those passkeys are the only way into a vault, unlesslose_vaults=trueis passed.signWithPasskeyPrf/prfRequestOptionsinlib/auth/webauthn.ts, andcomponents/vaults/vault-section.tsx.Motivation and Context
Adeel asked for everything to be encrypted, with passkeys as the key. His decisions: passkeys are the only unlock factor, and vaults apply only to the namespaces he chooses. Builds on #77, #89 and #73.
Types of changes
!in the title)Checklist:
app/api/deps.pyare on main already).tests/api/test_vaults.py(7),__tests__/vault-section.test.tsx,__tests__/webauthn.test.ts.docs/accordingly (docs/encryption.md#vaults).## UnreleasedinCHANGELOG.md.No CI runner is connected, so the full local suites were run:
Known limit: the server can't prove that the PRF secret sent at seal time is one the passkey will reproduce. A buggy authenticator could therefore seal a vault that never opens again. Adding a second passkey right away is the mitigation, and the panel prompts for it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01R1moYBoaoY4cZFbhBWqzEJ
Generated by Claude Code