RFC: weaning off cockpit web console from self-signed certificates #21695
Replies: 7 comments 13 replies
Yes, in a home/lab setup (so breaking every and all best-practices there are) without public access.
Currently Cockpit is running on Cockpit Client flatpak: Windows, macOS, iOS, I don't have a homogeneous Linux desktop workstation setup.
I'm using the "Add Hosts"-method of managing like 24 hosts, all registered to one GUI-instance (the others just have cockpit-ws installed), installing cockpit GUI on all of these hosts is cumbersome, and SSHing into these doesn't make sense, when I want to have quick bookmarks into machines. I.e. I have one "admin"-account on the manage-instance, and all other hosts trust the ssh key of that account.
FreeIPA/oVirt had this, if I remember correctly. There is/was a link to the CA certificate, which could be downloaded and installed manually. (see comment, last part) |
|
FreeIPA developer here. In Fedora/RHEL/Debian/etc we have On every system where certmonger is present, you already have a self-signed CA that can issue certificates using the same mechanism you are using for FreeIPA integration. In fact, for the localkdc (Kerberos KDC on each machine for local needs to replace insecure crypto exchanges like NTLM) integration we plan to use it by default as well, so it will be in use already. Here is an example of using it to generate a certificate from the local self-signed CA: On RHEL/Fedora one can copy the certificate ( I think it would be good if Cockpit would use this self-sign CA to request the certificates instead of issuing them as self-signed certs. An alternative to retrieving the CA chain through alternative mechanisms (such as ssh), could be something we do in FreeIPA: we expose HTTP end-point to get access to the CA certificate from the clients that currently don't yet have trust to the CA. |
Yes, this is a setup I have deployed on multiple locations
None of the sites where I have set up Cockpit on a system have a FreeIPA domain (At best, they have an AD domain). The people accessing it tend to be doing so from Windows PCs, and for the reverse proxy the issue stays the same. They also tend to access Cockpit via the IP, not fqdn.
These environments usually only have one or two systems with a cockpit web UI.
I do, and in an ideal environment this would be the way to go, but that isn't most places I have interacted with. |
|
Put a different way: how many people here are currently accessing their Cockpit server by entering a URL like If this applies do you, do you feel guilty/worried about doing this? Would you be willing to consider an alternative? Would you appreciate it if we made efforts to provide an alternative? |
|
On mastodon it was asked for comments: https://mastodon.social/@Cockpit@fosstodon.org/114143725996610452 My opinion is you should always be able to have the simple, self-signed, "i know it's not a public cert" situation. Of course better options are better for when you have fancier infra, but not everyone has cycles to set all that up. Thanks for working on cockpit! |
|
I just recently updated my cockpit instances to use FreeIPA issued certificates as I already had FreeIPA in place for some time. It's a great option only since I already have the infrastructure setup. For the home lab or small business setup with a couple servers, FreeIPA would be overkill just to support cockpit. But a simple web-proxy handling TLS termination and the self-signed certificate might be a lightweight and less complicated. If it's easy enough to create that on install, but "upgrade" to FreeIPA or Let's Encrypt, maybe that's a sensisble solution. |
|
Thanks to all responders! This is still such an intrinsically hard problem that we'll not pursue web service workers for the time being -- the cost to many users would IMHO be too high. 😢 |
Uh oh!
There was an error while loading. Please reload this page.
Hello all,
the Cockpit team is currently investigating a redesign of Cockpit's web server, which becomes slowly but surely more pressing. See details if you are interested. A very interesting possibility is to replace much of it with a web service worker, which would allow us to make the architecture dramatically simpler, more robust, and more secure (see prototype).
The main concern with this approach is that web service workers don't work with unknown TLS certificates ("secure context"), in particular for the self-signed certificates that cockpit creates on startup if you didn't supply your own. I. e. they don't support the usual TOFU model with "click here to accept this unknown certificate anyway" that browsers show for "normal" web pages in this case.
So I would like to do a little survey and request for comments about deprecating or changing the handling of self-signed TLS certs in Cockpit. This is an annoyingly hard problem: On one hand we really want to build a world where TLS works and your services are trustworthy (especially if you are typing in your root password as the next thing!), but for many home or even small business situations even LetsEncrypt etc. is impractical/impossible (no DNS, etc.).
My questions:
Are you currently accessing Cockpit with the builtin fallback self-signed certificate?
If so, would you have a better option like getting a proper cert, or joining the machine to a FreeIPA domain (which requests a valid cert from the IPA server), or running Cockpit behind a reverse proxy which already has a proper certificate? Or using the Cockpit Client flatpak? If any of these don't work for you, can you describe your situation?
If the above isn't possible, could you live with running the cockpit web server on a machine which has proper TLS setup, and connect to your target machines with SSH?
As last resort, Cockpit could show an error page (after accepting the invalid certificate in the browser) which explains the situation and offers you to download the CA certificate for importing into your browser as trusted CA. This includes the case that the default self-signed certificate is not valid for the hostname you are using to connect to cockpit (i.e. not "localhost" or the server's unqualified host name) - then you need to regenerate the certificate with the additional name.
This could then be used to actually establish some trust to the certificate, by something like
ssh remote cockpit-show-certwhich would show you the fingerprint or similar -- then you have something actually meaningful to check in the browser.Would that be acceptable for you?
Are you working on a different web-based project and already have some experience with handling proper certificates?
Notes:
This only affects remote connections -- if you connect to your own machine on http://localhost:9090, you can use unencrypted HTTP and service workers are fine.
We are aware of and use
sscgif it's installed (cockpkit-ws.rpm Recommends: it). We can change the non-sscg fallback to also create a separate CA and cert, instead of the single self-signed cert. So that's not a problem, just a bit of work.Thank you!
All reactions