BlueOS
BlueOS copied to clipboard
Add TLS support
This PR adds support for TLS in nginx using a self-signed certificate that's unique to each robot, along with additional changes needed for other components to work when TLS is enabled.
- Moves the nginx config to
/etc/blueos/nginx/instead of the current tools path in the container so we have persistence. - Updates the bootstrap container's version-chooser reachability check to accept the self-signed cert so it doesn't kill the core container.
- Adds a checkbox to the vehicle configuration wizard to enable the TLS feature.
- Generates a certificate (when needed) that includes the alternate hostname(s) and IPs for the robot. This feature shells out to
opensslto do the crypto operations, but attempts to mitigate any command injection risk by escaping parameters (like hostname) with theshlex.quotefunction. The cert and key files are stored alongside the nginx config. - There are two "template" nginx configs, one with TLS and one without, that are shipped with the
core. The code moves the correct one into place depending on whether or not TLS should be enabled.
How to test this
- Manually choose the TLS-aware bootstrap and core images from CI (or from the correct tag on DockerHub)
- Re-run the vehicle setup wizard
- Check the
Enable TLSbox on theCustomizestep - Complete the wizard
- Navigate to
https://<your robot hostname> - Accept the cert warning
- You should have TLS now
Hi @matt-bathyscope can you sign the CLA ?
Closing this one as there is an updated/rebased PR https://github.com/bluerobotics/BlueOS/pull/3389