Skip to content

Scanner RPC Security Requirements #8142

Description

@teor2345

Motivation

We want to provide secure access to the shielded blockchain scanner.

Goals

Based on the discussion in this week's Zebra team sync, we have the following goals for the RPC interface:

  • Authenticates connections to make sure they are authorised to add or remove keys, or get results
  • Encrypts connections to avoid leaking keys or results
  • Requires proof of knowledge of keys before accessing results or deleting that key
  • Can be used via Tor

Additional security requirement:

  • The client should authenticate the server before sending private viewing keys.

Background & Security Notes

zcashd authentication

zcashd currently authenticates using either:

  • proof of knowledge of the contents of a local cookie file, or
  • username and password.

Passwords might be deprecated, we should ask the ECC team why that happened, and if they've made a final decision.

Tor compatibility

To be used via Tor, the RPC library must communicate over either:

Tor onion addresses authenticate the server, but not the client. Tor did have client authentication in v2 onion services, but I'm not sure if it is implemented in v3. (v2 has been disabled.)

Authentication

Typically, proof of knowledge uses a challenge-response protocol, to avoid response re-use. A rough sketch of that protocol is:

  • The server provides a random challenge value.
  • The client responds with a hash of: a fixed prefix unique to this authentication method, the challenge value, and the secret (the password or the cookie file contents)
  • The server checks that the hash matches the hash it generated from the challenge value and password

For proving knowledge of a key, we might just be able to use a prefixed hash of that key, because the connection is already authenticated and encrypted.

It's also possible to use client and server certificates, if we use TLS (or HTTPS).

Next Steps

  • Finalise the evaluation criteria for the RPC library
  • Make a list of potential RPC libraries
  • Evaluate them against the criteria
  • Choose a library and create a wrapper crate for using it in Zebra
  • Design and implement RPCs

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-blockchain-scannerArea: Blockchain scanner of shielded transactionsA-rpcArea: Remote Procedure Call interfacesC-securityCategory: Security issuesI-heavyProblems with excessive memory, disk, or CPU usageI-privacyZebra discloses private information

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions