Biometric Unlock for CLI #17934
jeanregisser
started this conversation in
Password Manager
Replies: 1 comment
-
|
✨ Thank you for your code contribution proposal! While the Bitwarden team reviews your submission, we encourage you to check out our contribution guidelines. Please ensure that your code contribution includes a detailed description of what you would like to contribute, along with any relevant screenshots and links to existing feature requests. This information helps us gather feedback from the community and Bitwarden team members before you start writing code. To keep discussions focused, posts that do not include a proposal for a code contribution will be removed.
Thank you for contributing to Bitwarden! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
✅ Code Contribution Proposal
Code Contribution Proposal
TL;DR: I want to add Touch ID support to CLI. Two approaches proposed: (A) keychain storage or (B) desktop app IPC. Seeking feedback on best approach before coding. Ready to contribute!
Background
There's significant community interest in adding biometric unlock support to the Bitwarden CLI:
Users currently work around this with unofficial scripts that store credentials in platform keychains, but these lack official support and have unclear security models.
I'm interested in contributing this feature and would like community/team feedback on the implementation approach before writing code.
Current State
Today, biometric unlock works great for:
$BW_SESSIONmanagement)The CLI's session model is well-designed (locked by default, explicit unlock, session tokens), but lacks the convenience of biometric auth that other clients enjoy.
Use Cases
Primary use case: CLI power users who:
bwcommands frequently in their terminal workflowExample workflow:
Proposed Implementation
I've researched the desktop app's biometric implementation and see two viable approaches:
Option A: Self-Contained Keychain Storage
How it works:
BW_SESSIONtoken in platform secure storage (macOS Keychain, Windows Credential Manager, etc.)kSecAccessControlUserPresence(macOS) or equivalentImplementation details (macOS):
Pros:
Cons:
Option B: Desktop App IPC Integration
How it works:
UnlockWithBiometricsForUsercommand (same as browser extension)Implementation details:
~/Library/Caches/com.bitwarden.desktop/s.bw(or App Group path if sandboxed)Pros:
Cons:
User Experience Mockup
Setup Flow
Usage Flow
Interactive (auto-detects biometric availability):
Explicit flag:
Management
Security Considerations
What's stored:
BW_SESSIONtoken (time-limited, revocable)Threat model:
Session lifecycle:
bw lockclears session (keeps biometric config)bw logoutremoves everything including biometric setupPlatform security:
kSecAccessControlUserPresenceCRED_TYPE_GENERIC+ Windows HelloImplementation Plan
Initial focus: macOS (can expand to other platforms later, or accept community contributions)
Example plan for Option A (would adjust based on chosen approach):
securitycommand or create NAPI module)bw config biometric-unlocksetup--biometricflagFuture expansion (community contributions welcome):
Important note on implementation: The
securitycommand-line tool does not support settingkSecAccessControlUserPresencedirectly. Shelling out tosecurityonly provides system authentication (which may or may not use Touch ID depending on system settings). For true Touch ID enforcement, would need to create a small NAPI module using the Rustsecurity-frameworkcrate (like the desktop app does).References & Prior Art
Similar features in other tools:
Bitwarden codebase references:
os-biometrics-mac.service.tsbiometric-message-handler.service.tsunlock.command.tsCommunity workarounds:
Feedback Requested
I'm ready to start implementing this, but want to ensure the approach aligns with Bitwarden's security philosophy, CLI architecture, and community needs.
Key questions:
securitycommand or create NAPI module? Acceptable to add native dependencies?Looking forward to your feedback! Happy to iterate on this design before diving into implementation.
Beta Was this translation helpful? Give feedback.
All reactions