docs/orchard/architecture-and-security.md
Orchard cluster consists of three components:
At the moment, only one Controller instance is currently supported, while you can deploy one or more Workers and run any number of Clients.
In terms of networking requirements, only Controller needs to be directly accessible from Workers and Clients, while Workers and Clients can be deployed and run anywhere (e.g. behind a NAT).
When an Orchard Client or a Worker connects to the Controller, they need to establish trust and verify that they're talking to the right Controller, so that no man-in-the-middle attack is possible.
Similarly to web-browsers (that rely on the public key infrastructure) and SSH (which relies on semi-automated fingerprint verification), Orchard combines these two traits in a hybrid approach by defaulting to automatic PKI verification (can be disabled by --no-pki) and falling-back to a manual verification for self-signed certificates.
This hybrid approach is needed because the Controller can be configured in two ways:
--controller-cert and --controller-key command-line arguments to orchard controller run--controller-cert and --controller-key command-line arguments are passedBelow we'll explain how Orchard client and Worker secure the connection when accessing these two Controller types.
Client is associated with the Controller using a orchard context create command, which works as follows:
--no-pki)Afterward, each interaction with the Controller (e.g. orchard create vm command) will stick to the chosen verification method and will re-verify the presented Controller's certificate against:
To make the Worker connect to the Controller, a Bootstrap Token needs to be obtained using the orchard get bootstrap-token command.
While this approach provides a less ad-hoc experience than that you'd have with orchard context create, it allows one to mass-deploy workers non-interactively, using tools such as Ansible.
This resulting Bootstrap Token will either include the Controller's certificate (when the current context is with a Controller with a self-signed certificate) or omit it (when the current context is with a Controller with a publicly valid certificate).
The way Worker connects to the Controller using the orchard worker run command is as follows:
--no-pki to effectively prevent the Worker from connecting) and fail if certificate verification using PKI is not possible--no-pki overrideIf you only intend to access the Controller with a self-signed certificate and want to additionally guard yourself against CA compromises and other PKI-specific attacks, pass a --no-pki command-line argument to the following commands:
orchard context create --no-pki
orchard worker run --no-pki
We've deliberately chosen not to use environment variables (e.g. ORCHARD_NO_PKI) because they fail silently (e.g. due to a typo), compared to command-line arguments, which will result in an error that is much easier to detect.