Skip to content

security(cli): prefer file/stdin/env over --private-key argv (#4032) - #4096

Open
Chessing234 wants to merge 6 commits into
block:mainfrom
Chessing234:security/private-key-file-deprecation
Open

security(cli): prefer file/stdin/env over --private-key argv (#4032)#4096
Chessing234 wants to merge 6 commits into
block:mainfrom
Chessing234:security/private-key-file-deprecation

Conversation

@Chessing234

Copy link
Copy Markdown
Contributor

Summary

  • Adds --private-key-file and --private-key-stdin; keeps BUZZ_PRIVATE_KEY.
  • Warns when --private-key appears on argv (shell history / ps).
  • Docs: CLI README, SECURITY.md, AGENTS.md, TESTING.md.

Fixes #4032

Test plan

  • cargo test -p buzz-cli private_key
  • cargo test -p buzz-cli cli_definition_is_valid
  • buzz --private-key-file /tmp/nsec channels list (with valid key)
  • printf '%s' "$NSEC" | buzz --private-key-stdin channels list
  • buzz --private-key nsec1… … prints deprecation warning

Made with Cursor

@Chessing234
Chessing234 requested a review from a team as a code owner August 1, 2026 11:19
@Chessing234
Chessing234 force-pushed the security/private-key-file-deprecation branch from 5a71669 to 62b1396 Compare August 1, 2026 11:52
@Chessing234

Copy link
Copy Markdown
Contributor Author

Rebased with Signed-off-by so DCO Check is green.

@Chessing234

Copy link
Copy Markdown
Contributor Author

Friendly review ping for @block/buzz-oss-team — CI/DCO are green on the latest push and this is ready for a maintainer pass when you have bandwidth. Happy to rebase or split if that helps review.

Chessing234 and others added 6 commits August 2, 2026 09:27
Implements preference order and argv detection so --private-key can be
deprecated without dropping BUZZ_PRIVATE_KEY support (block#4032).

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Taksh <takshkothari09@gmail.com>
Wires the new flags through clap and run(), warning when the secret is
passed on argv into shell history / process listings.

Signed-off-by: Taksh <takshkothari09@gmail.com>
Documents the safer identity sources and links block#4032 for the argv leak.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Taksh <takshkothari09@gmail.com>
Cross-links block#4032 next to the existing BUZZ_PRIVATE_KEY keyring guidance.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Taksh <takshkothari09@gmail.com>
Keeps the manual test script aligned with the safer auth sources.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Taksh <takshkothari09@gmail.com>
Keeps agent docs aligned with the block#4032 argv deprecation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Taksh <takshkothari09@gmail.com>
@Chessing234
Chessing234 force-pushed the security/private-key-file-deprecation branch from 62b1396 to e9ee13a Compare August 2, 2026 03:58
@Chessing234

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main with Signed-off-by on all commits and force-pushed. CI should re-run shortly — still ready for @block/buzz-oss-team review when you have bandwidth.

@Chessing234

Copy link
Copy Markdown
Contributor Author

@tlongwell-block @wesbillman @wpfleger96 mind taking a look when you get a chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security: --private-key as a CLI argument leaks the key into shell history and process listings

1 participant