-
Notifications
You must be signed in to change notification settings - Fork 616
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
Add/remove certificates using API #27
Comments
Managing the certificates via the config file is a stop gap until the entire configuration moves to the backend to have a full cluster configuration. Also, hashicorp has Vault which is built for managing secrets. Both things are on my list of things to work on. |
If I want to use fabio in production now, how can I prevent issues when adding/removing certificates for existing apps? |
Interesting use case. Didn't take that into account. Yes, with the current setup you'd just update the configuration and restart which would interrupt existing connections. How often do the certificates change in your setup? |
No, there is no 'reload' command since by design this shouldn't be necessary... We'll find a solution. |
Thank you for your response. For example: Let's Encrypt (LE) requires certificate renewal in intervals (90 days). The vault PKI Secret Backend could be used to retrieve the PKI files: For fabio authenticating itself against vault, using an Auth Backend, The main concern would be how to offer the configuration As fabio is already opinionated insofar that it uses Consul and its protocol for service discovery, As kind of compromise, one could offer a pure HTTP API, similar to the existing one for adding routes to fabio ("overriding"), to allow assigning certificates to routes on-the-fly. |
Fabio will support different backends soon. The one for Google Compute Platform is in the works so there is definitely a tradeoff in using either Vault or some other configuration mechanism. Storing the certificates in the backend is simple at least for consul. How would you store the certificates in consul? As PEM files without password or as P12 files with password? If you want password protection how does fabio get the password? |
Thank you for your answer. As vault already handles the authentication of apps against itself in order to retrieve secrets, Instad of a cert passphrase, fabio itself would auth against vault with a Auth Backend, |
Yes, that is correct if I use Vault for storing secrets. If you don't want that additional dependency then you get that unlock problem. |
So in nginx configuration for example, there is often an extra *_key file provided For haproxy config, the passphrase is always stripped first, otherwise it will ask for it at each restart. It is often recommended that the passphrase is stripped from the cert when it is used in an automated way (like restarting a web server that uses it). So for the non-vault API, there could be an extra parameter to the passphrase file, if needed, Concerning the Auth Backend for fabio against vault: One way could be offering some kind of pre-auth script |
Storing the passphrase next to the cert isn't any benefit at all. You might as well just use the unlocked files. So the question then becomes how secure is your backend registry or the servers you're deploying to. I'm leaning towards this:
|
I am really excited by this feature, together with HTTP2 support by Go 1.6 seeming soon coming out, There is a similar reverse HTTP proxy, https://github.com/EmileVauge/traefik, |
Further thoughts: route1: domain1.com/whatever -> uses cert for domain1.com Setting a cert that for an existing common name would override it (=reload),
|
OK, so Traefik reads the CN of each passed certificate file Something similar with HTTP API would be great for fabio. |
ok, so I can add multiple certificates to a single listener which are either statically or dynamically configured. This isn't really a code issue but a config issue. I need to think about this a bit more how I express this in the configuration. Once I've figured that out the implementation should be straightforward. |
Addition: It may be a good starting point when for the beginning a folder of directories can be passed |
@strarsis I've started working on this. |
Current plan is to support a configurable certificate store per listener. A certificate store is either a fixed set of certificates, a directory with a list of certificates which is reloaded whenever something changes, consul which is again updated when something changes and vault. Since consul already offers a secured HTTP API lets first get this working and then see whether another API is necessary. |
@strarsis fabio will support multiple different certificate sources like file, path, http, consul and vault. You can test this in the Since they all have different provisioning mechanisms I find it difficult to come up with an API that will work in all cases. Also, some of the tools already provide HTTP APIs which can be used for provisioning. So I chose not to provide an API in fabio but to make the integration with different types of certificate sources easy.
|
@magiconair Are you considering letsencrypt integration? |
Yes
Frank Schröder
… On 2. Apr 2017, at 01:39, Roman Naumenko ***@***.***> wrote:
@magiconair Are you considering letsencrypt integration?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Is there any work being done on letsencrypt integration? I've started it as my first Go project this weekend, in the form of a separate binary that Once I get it roughly working I'll push it to a repo. Still got to think about reusing the |
@tino Nobody has been picking this up yet and if you are working on a PR then this would be very welcome. You can integrate that directly with fabio. @pschultz has done preliminary work for these types of cert stores in #135/#315. He has provided a proof-of-concept implementation for ACME which you can see here: https://gist.github.com/pschultz/80a13aa3488f4e9afa1e440bea3c3d6e This still needs config, wiring and testing but it is a start. I suggest you open an issue for that and submit a PR. This would also prevent morphing this ticket into something else. |
@tino There should be no need to add a separate tag name for that. The only thing that is required is to fetch or generate a certificate on the fly. Keep in mind that fabio can be run in clusters so you need a place to store the certs, e.g. consul. |
@magiconair what is current state of fabio and letsencrypt integration? mholt/caddy has letsencrypt integration but miss consul auto configuration. Fabio has autoconfiguration but miss letsencrypt auto-certificates. And traefik has very strange configs and bugs... |
@ont it's not currently supported IN fabio but there are ways of getting it done. Vault is supported as a certificate store for fabio and there are third party projects that will handle renew of lets encrypt and push to vault (https://github.com/ketchoop/letsencrypt-to-vault). There is also support for reading/refreshing certificates directly from the filesystem builtin to fabio so any system that writes letsencrypt certs to disk should work as well. |
@leprechau yes, I understand it. But main benefit from integrating letsencrypt into fabio is to avoid management hell with |
@ont Understood. I was just trying to offer options until someone has time to work on full integration of letsencrypt with fabio. |
From what I understand, new certificates can be only set up using the fabio properties file.
When adding/removing apps or updating the PEM files, I would find it very helpful when fabio supports management of certificates using its API or even consul tags.
The text was updated successfully, but these errors were encountered: