Skip to content

security: require cookie bearer auth on private/wallet RPC - #127

Open
ekulkisnek wants to merge 18 commits into
LayerTwo-Labs:masterfrom
ekulkisnek:security/rpc-cookie-auth
Open

security: require cookie bearer auth on private/wallet RPC#127
ekulkisnek wants to merge 18 commits into
LayerTwo-Labs:masterfrom
ekulkisnek:security/rpc-cookie-auth

Conversation

@ekulkisnek

Copy link
Copy Markdown
Contributor

Summary

Unauthenticated private RPC exposes stop, seed import, transfers, and wallet control to anyone who can reach the port. This PR requires cookie bearer auth on the private (or combined) RPC server.

Changes

  • Generate a mode-0600 cookie at <datadir>/.cookie
  • Require Authorization: Bearer <token> on private/combined RPC
  • Add rpc_auth cookie load/create helpers + unit tests
  • Wire ValidateRequestHeaderLayer on private/combined servers
  • CLI, integration tests, and GUI pick up cookie or THUNDER_RPC_AUTH_TOKEN

Test plan

  • Confirm unauthenticated private RPC requests are rejected
  • Confirm authenticated requests with cookie / THUNDER_RPC_AUTH_TOKEN succeed
  • Confirm cookie file is mode 0600
  • Run relevant unit/integration tests

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.

3 participants