Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL everywhere #140

Closed
petersilva opened this issue Mar 10, 2022 · 10 comments
Closed

SSL everywhere #140

petersilva opened this issue Mar 10, 2022 · 10 comments
Assignees
Labels
enhancement New feature or request security Security
Milestone

Comments

@petersilva
Copy link
Contributor

Need to configure every container that runs a service to use the SSL certificate (involves ensuring the certificates are in the right places for each one. Services to configure so far:

  • nginx
  • mosquitto
  • wis2box stack itself? or inherit from nginx?
  • webdav

Since certificates have pretty short lifetimes (max 1 year) these days, need to arrange for auto-renewal, and automated replacement of certs, and restarting of the services using them.

implementing something like Lets Encrypt, with auto updating would be desirable.
Some countries nations may have security standards that conflict with use of external or specific SSL providers. so this part may need to be pluggable.

@tomkralidis tomkralidis added this to the sprint-003 milestone Mar 10, 2022
@tomkralidis tomkralidis added the access control Access control label Mar 10, 2022
@petersilva
Copy link
Contributor Author

@tomkralidis
Copy link
Collaborator

Needs setup/proxy (+X-Forward, etc.) on:

  • nginx

  • mosquitto

  • does does data-consumer need SSL as well?

  • need to verify ingest workflows (SFTP, or other [s3]?)

  • certs can be the same, need to managed across box

@webb-ben
Copy link
Member

I will add that we could use a web server that has built-in TLS/SSL like Caddy. Ideally, we would have SSL from only one container. I believe nginx and caddy can be configured to serve any TCP protocol including MQTT...

@tomkralidis
Copy link
Collaborator

@webb-ben sure. We can also generate the certs and mount them across nginx and mosquitto.

@maaikelimper
Copy link
Collaborator

additional service to use SSL: grafana for the monitoring

@tomkralidis
Copy link
Collaborator

  • nginx as proxy for other services
  • nginx does SSL
  • SSL is installed once on web proxy
  • internal services are raw HTTP
  • cert options
    • self-signed
    • letsencrypt (needs public facing address, hard for development)
    • commercial (i.e. Entrust)
  • nginx configuration: http://nginx.org/en/docs/http/configuring_https_servers.html
  • we would put files where nginx wants them
  • keys needs to be created BEFORE docker-compose orchestration
  • have different nginx configs
  • unsecure (CI, dev.)
    • 80
    • 1883
  • secure (docker/nginx/nginx.ssl.conf)
    • 443
    • 8883
  • change docker/docker-compose.yml to point to nginx.ssl.conf and uncomment/edit volume map to .key and .crt
  • we can have a build step to copy the nginx.dev.conf or nginx.ssl.conf to nginx.conf
  • we need an SSL page/documentation
    • how to enable SSL
    • change env vars
    • startup

@tomkralidis tomkralidis modified the milestones: sprint-003, sprint-004 May 16, 2022
@tomkralidis tomkralidis removed this from the sprint-004 milestone Jul 1, 2022
@tomkralidis tomkralidis added enhancement New feature or request and removed access control Access control labels Jan 20, 2023
@tomkralidis
Copy link
Collaborator

cc @maaikelimper

  • option to enable/disable SSL, when SSL is disabled user should get clear warning on wis2box-ctl.py to indicate that this is for development only and production-environment requires HTTPS/MQTTS to be enabled
  • prepare nginx/mqtt configuration files with/without SSL
  • new environment variables to define WIS2BOX_SSL_ENABLED (true/false) and WIS2BOX_NGINX_CERTS_DIR, WIS2BOX_MQTTS_CERTS_DIR on local host for nginx and mqtt (and optionally sftp)

@tomkralidis tomkralidis added this to the sprint-009 milestone Jan 20, 2023
@maaikelimper maaikelimper added the security Security label Jan 20, 2023
@golfvert
Copy link
Contributor

Have you considered using traefik? As a proxy HTTPS/MQTTS/... it also makes autorenewal with let's encrypt fairly straightforward.
MF Global Broker is using this setup.

@tomkralidis
Copy link
Collaborator

PR in #403; I will review today/tomorrow.

@tomkralidis
Copy link
Collaborator

Implemented in #403.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request security Security
Projects
None yet
Development

No branches or pull requests

5 participants