autopilotpattern / nginx

An Nginx container for container-native deployment and automatic backend discovery
Mozilla Public License 2.0
57 stars 25 forks source link

Patterns for injecting SSL certificate and key #38

Open misterbisson opened 8 years ago

misterbisson commented 8 years ago

https://github.com/autopilotpattern/nginx/pull/30 implemented Let's Encrypt support for east and automatic SSL encryption, but there are times when a traditional SSL cert is more desirable:

  1. When you wish to have a well-recognized cert, but don't wish to publish the resource on the public internet to serve ACME challenges
  2. When you wish to use an extended validation certificate
  3. Because you want to, dangit

In those situations, we need a pattern to inject the certificate and key. This will need two patterns to account for the different contexts in which it might be used. In all cases (because it's how Nginx works, we'll have to trust the security of the Nginx container and filesystem to store the SSL key, however, we may have different levels of trust for the service discovery layer:

  1. The service catalog is being used for application discovery (not infrastructure discovery), and access is limited to trusted application operators, and therefore is a trustworthy store for secrets
  2. The service catalog is, for one reason or another, not trusted (though, remember, that anybody with access to the Nginx instances will have access to the certificate and key), so a different store, perhaps Vault, will be used for the secrets

This ticket will stand for developing the first pattern. A new ticket shall be opened for the eventual development of the second pattern.