Small guide to using your own certificates on Greenbone Community Containers

Starting from the downloaded YAML file:

curl -f -O -L https://greenbone.github.io/docs/latest/_static/compose.yaml --output-dir “$DOWNLOAD_DIR”

  1. Copy your main and intermediate certficates to $DOWNLOAD_DIR
  2. cat main.crt intermediate.crt >> bundled.crt
  3. rm main.crt intermediate.crt
  4. Copy your certificate key (e.g cert.key) to $DOWNLOAD_DIR
  5. Edit compose.yaml (see below)
  6. Restart container
  7. Voila!

Steps to edit compose.yaml

  1. On gvm-config: section, change ENABLE_TLS_GENERATION: false
  2. On gvm-config: section, add your server_name: NGINX_HOST: "hostname.example.com
  3. On gvm-config: section define the port: NGINX_HTTPS_PORT: “9443”
  4. On nginx: section, delete the non safe HTTP port from the port: subsection. Should be something like this: - 127.0.0.1:9392:9392
  5. On nginx: section, port: subsection, bind nginx to your ip: - 0.0.0.0:9443:9443
  6. On nginx: section, volumes: subsection, delete - nginx_certificates_vol:/etc/nginx/certs:ro
  7. On nginx: section, volumes: subsection, add - ./bundled.crt:/etc/nginx/certs/server.cert.pem:ro
  8. On nginx: section, volumes: subsection, add - ./cert.key:/etc/nginx/certs/server.key:ro

With that, you get nginx to listen on 0.0.0.0:9443 with SNI hostname.example.com and using the certificate pointed by bundled.crt and private key server.key

Cheers!