Title: Optionally store CLI authentication tokens in OS keyring · Issue #19403 · coder/coder · GitHub
Open Graph Title: Optionally store CLI authentication tokens in OS keyring · Issue #19403 · coder/coder
X Title: Optionally store CLI authentication tokens in OS keyring · Issue #19403 · coder/coder
Description: Feature Request: Secure Token Storage in OS Keyring Problem Currently, the Coder CLI stores authentication tokens in plaintext configuration files, which poses a security risk. Users' tokens are stored unencrypted and can be easily acces...
Open Graph Description: Feature Request: Secure Token Storage in OS Keyring Problem Currently, the Coder CLI stores authentication tokens in plaintext configuration files, which poses a security risk. Users' tokens are st...
X Description: Feature Request: Secure Token Storage in OS Keyring Problem Currently, the Coder CLI stores authentication tokens in plaintext configuration files, which poses a security risk. Users' tokens ar...
Opengraph URL: https://github.com/coder/coder/issues/19403
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Optionally store CLI authentication tokens in OS keyring","articleBody":"## Feature Request: Secure Token Storage in OS Keyring\n\n### Problem\nCurrently, the Coder CLI stores authentication tokens in plaintext configuration files, which poses a security risk. Users' tokens are stored unencrypted and can be easily accessed by other processes or users with file system access.\n\n### Proposed Solution\nImplement secure token storage using the OS keyring with graceful fallback to file storage when keyring is unavailable.\n\n### Acceptance Criteria\n\n- [ ] **CLI should by default store the token in the OS keyring** using a library like [zalando/go-keyring](https://github.com/zalando/go-keyring)\n - Keychain on macOS\n - GNOME Keyring on Linux (Secret Service dbus interface) \n - Wincred on Windows\n\n- [ ] **CLI should fallback to storing the token in text file** if the keyring is not available\n - Maintain backward compatibility\n - Ensure minimal disruption if keyring operations fail\n - Log appropriate warnings when falling back to file storage\n\n- [ ] **Address security considerations** from [GitHub CLI's keyring implementation discussion](https://github.com/cli/cli/pull/7023#discussion_r1113142082):\n - Consider the security implications of using `zalando/go-keyring` which shells out to the `security` command on macOS\n - On macOS, this grants access to the `security` binary rather than the specific application, which can weaken the security model\n - Document this limitation and consider future improvements to use native APIs\n - Despite this limitation, keyring storage is still significantly more secure than plaintext files\n\n### Implementation Considerations\n\n1. **Library Choice**: Use `zalando/go-keyring` for pure Go implementation without CGO requirements\n2. **Migration**: Handle existing plaintext tokens gracefully during the transition\n3. **Error Handling**: Robust fallback mechanism when keyring operations fail\n4. **Cross-platform**: Ensure consistent behavior across macOS, Linux, and Windows\n5. **User Experience**: Minimal prompts and clear messaging about keyring access\n6. **Testing**: Comprehensive tests for both keyring and fallback scenarios\n\n### Security Benefits\n- Tokens encrypted at rest using OS-provided security mechanisms\n- Reduced risk of accidental token exposure in config files\n- Better integration with enterprise security policies\n\n### References\n- [GitHub CLI keyring implementation](https://github.com/cli/cli/pull/7023)\n- [zalando/go-keyring library](https://github.com/zalando/go-keyring)\n- [Security discussion about macOS implementation](https://github.com/cli/cli/pull/7023#discussion_r1113142082)","author":{"url":"https://github.com/apps/blink-so","@type":"Person","name":"blink-so"},"datePublished":"2025-08-19T08:13:42Z","url":"https://github.com/coder/coder/issues/19403"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c19c242d-81dc-c06f-9e24-c9b73b360930 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D92:21AC3F:143B753:19B654C:6B0111CF |
| html-safe-nonce | 3257f588928d4a2c94762c5c1e9589fb87f0ed99267841d64dbdfdee17d1d554 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDkyOjIxQUMzRjoxNDNCNzUzOjE5QjY1NEM6NkIwMTExQ0YiLCJ2aXNpdG9yX2lkIjoiMzUyNzMxMzUyMDgwNDgyNzU5OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2da8e09f5de9e5df64b874464bbdacf423665c219f6585215d9b51c3f0e090e1 |
| hovercard-subject-tag | issue:3333387697 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/19403/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5bf4c176cad5ef9d4919cc5599ff37ab98ead113d28b1211d666f5fb2c588bc8/coder/coder/issues/19403 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5bf4c176cad5ef9d4919cc5599ff37ab98ead113d28b1211d666f5fb2c588bc8/coder/coder/issues/19403 |
| og:image:alt | Feature Request: Secure Token Storage in OS Keyring Problem Currently, the Coder CLI stores authentication tokens in plaintext configuration files, which poses a security risk. Users' tokens are st... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | blink-so[bot] |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width