crossbario / autobahn-python

WebSocket and WAMP in Python for Twisted and asyncio
https://crossbar.io/autobahn
MIT License
2.47k stars 763 forks source link

Support Cryptosign trustroot/certificate #1568

Open oberstet opened 2 years ago

oberstet commented 2 years ago
# forward the client pubkey: this allows us to omit authid as
# the router can identify us with the pubkey already
'pubkey': _public_key,

# for authenticating the router, this challenge will need to be signed
# by the router and send back in AUTHENTICATE for client to verify.
# A string with a hex encoded 32 bytes random value.
'challenge': None,

# https://tools.ietf.org/html/rfc5929
'channel_binding': 'tls-unique'
'channel_id': ...

# a public key the router should provide a trustchain for its public key.
# the trustroot can eg be hard-coded in the client, or come from a command
# line option.
'trustroot': None,
'certificate': ...
oberstet commented 2 years ago

rgd the goal of adding above trustroot feature - in Crossbar.io, there are 3 types of internal connections, that is connections between workers and nodes of Crossbar.io itself:

  1. management links: https://github.com/crossbario/crossbar/blob/09eaf37ce0dfc58e97ed8e0af428bea28dea61cc/crossbar/edge/node/management.py#L68
  2. proxy-router links: https://github.com/crossbario/crossbar/blob/09eaf37ce0dfc58e97ed8e0af428bea28dea61cc/crossbar/worker/proxy.py#L296
  3. router-to-router links: https://github.com/crossbario/crossbar/blob/09eaf37ce0dfc58e97ed8e0af428bea28dea61cc/crossbar/worker/rlink.py#L550

All of these connection types

Thus, all connection types are working single-realm-multiple-session (when MUXed).


Since all connection types work single-realm (either single or multiple sessions), it makes sense to bind the trustroot connections are authenticated against with that realm.

oberstet commented 2 years ago

Case 1:

Case 2:

That is:

oberstet commented 2 years ago

One element to add is auto-generating node certificate files key.sig as part of node auto-discovery:

https://github.com/crossbario/crossbar/blob/09eaf37ce0dfc58e97ed8e0af428bea28dea61cc/crossbar/master/node/controller.py#L426

key.sig should contain the node authid, pubkey and address, and should be signed by the master node eth key.

The master node address should be included in key.pub as trustroot default.