Skip to content

Commit

Permalink
docs on new connection recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
cgevans committed Mar 7, 2024
1 parent 89776e5 commit ff3fcad
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ SPDX-License-Identifier: EUPL-1.2
## Development

- `Machine.block` command to directly control block temperatures.
- Certificate support for SSL, and new connection recommendations.

## Version 0.11.0

Expand Down
58 changes: 58 additions & 0 deletions docs/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,64 @@ The machine has a password authentication mechanism. However, it is extremely i

Guest appears to be intended to provide access only to the help system and authentication, while higher access levels are related to programming the machine.

.. _new_setup_recs:

New recommended configuration (2024)
------------------------------------

In general, QuantStudio machines are not safe to connect to the
internet. Access controls provide no real authentication or security,
and are easily bypassed. SSL on more recent firmware versions is both
not secure (SSLv3, known to be unsafe in 2014), in any case provides no
protection against simple root access methods, and is generally not
supported by many recent builds of OpenSSL and Python.

To allow access on a secure network, where any user on the network is
trusted to have full access to the machine, you can then use socat to
provide a modern SSL connection. After generating a self-signed SSL
certificate, use something like one or more of the following:

.. code:: bash
# For old firmware versions with plain-text network access
socat openssl-listen:7443,reuseaddr,fork,cert=server.pem,verify=0 \
tcp:$MACHINE_IP_ADDRESS:7000
# For newer firmware versions with SSL network access
socat openssl-listen:7443,reuseaddr,fork,cert=server.pem,verify=0 \
openssl:$MACHINE_IP_ADDRESS:7443,openssl-min-proto-version=SSLv3,verify=0
socat openssl-listen:7443,reuseaddr,fork,cert=server.pem,verify=0,bind=$SERVER_NETWORK_IP \
openssl:$MACHINE_IP_ADDRESS:7443,openssl-min-proto-version=SSLv3,verify=0
To allow access on a *public*, or otherwise untrusted network, you can
use client certificates. In that case, you’ll need the root CA for the
client certificates, which we’ll assume is ``ca.pem``. Then use:

.. code:: bash
# For old firmware versions with plain-text network access
socat openssl-listen:7443,reuseaddr,fork,cert=server.pem,cafile=ca.pem \
tcp:$MACHINE_IP_ADDRESS:7000
# For newer firmware versions with SSL network access
socat openssl-listen:7443,reuseaddr,fork,cert=server.pem,cafile=ca.pem \
openssl:$MACHINE_IP_ADDRESS:7443,openssl-min-proto-version=SSLv3,verify=0
socat openssl-listen:7443,reuseaddr,fork,cert=server.pem,cafile=ca.pem,bind=$SERVER_NETWORK_IP \
openssl:$MACHINE_IP_ADDRESS:7443,openssl-min-proto-version=SSLv3,verify=0
Then, you can use the ``client_certificate_path`` option for ``Machine``
to specify a client certificate while connecting. If you’d like to check
the server certificate, you can also specify ``server_ca_file``.

.. code:: python
from qslib import Machine
m = Machine('qpcr1.example.com',
client_certificate_path='client.pem',
server_ca_file='ca.pem')
print(m.machine_status())
Configuration suggestions
-------------------------

Expand Down

0 comments on commit ff3fcad

Please sign in to comment.