| 1 |
= cockpit-tls(8) |
| 2 |
|
| 3 |
== Name |
| 4 |
|
| 5 |
cockpit-tls - TLS proxy for Cockpit web service |
| 6 |
|
| 7 |
== Synopsis |
| 8 |
|
| 9 |
*cockpit-tls* [*--help*] [*--port* _PORT_] [*--no-tls*] [*--idle-timeout* _SECONDS_] |
| 10 |
|
| 11 |
== Description |
| 12 |
|
| 13 |
The *cockpit-tls* program is a TLS terminating HTTP proxy for |
| 14 |
man:cockpit-ws[8]. It manages a set of isolated cockpit-ws instances, |
| 15 |
one per TLS client certificate, plus one for TLS without a client |
| 16 |
certificate, and one for unencrypted HTTP. With that, one session cannot |
| 17 |
tamper with another one through possible security vulnerability |
| 18 |
exploits. |
| 19 |
|
| 20 |
Users or administrators should never need to start this program as it |
| 21 |
automatically started by man:systemd[1] via socket activation. |
| 22 |
|
| 23 |
== Transport security |
| 24 |
|
| 25 |
To specify the TLS certificate the web service should use, simply drop a |
| 26 |
file with the extension *.cert* in the */etc/cockpit/ws-certs.d* |
| 27 |
directory, or below *$XDG_CONFIG_DIRS* if set (see |
| 28 |
man:cockpit.conf[5]). If there are multiple files |
| 29 |
in this directory, then the highest priority one is chosen after |
| 30 |
sorting. |
| 31 |
|
| 32 |
The *.cert* file should contain at least two OpenSSL style PEM blocks. |
| 33 |
First one or more `+BEGIN CERTIFICATE+` blocks for the server |
| 34 |
certificate and intermediate certificate authorities and a second one |
| 35 |
containing a `+BEGIN PRIVATE KEY+` or similar. The key must not be |
| 36 |
encrypted. |
| 37 |
|
| 38 |
If there is no TLS certificate, a self-signed certificate is |
| 39 |
automatically generated using *sscg* (if available) or *openssl* and |
| 40 |
stored in the *0-self-signed.cert* file. |
| 41 |
|
| 42 |
When enrolling into a FreeIPA domain, an SSL certificate is requested |
| 43 |
from the IPA server and stored in *10-ipa.cert*. |
| 44 |
|
| 45 |
To check which certificate *cockpit-ws* will use, run the following |
| 46 |
command. |
| 47 |
|
| 48 |
.... |
| 49 |
$ sudo /usr/libexec/cockpit-certificate-ensure --check |
| 50 |
.... |
| 51 |
|
| 52 |
Or, on Debian-based systems: |
| 53 |
|
| 54 |
.... |
| 55 |
$ sudo /usr/lib/cockpit/cockpit-certificate-ensure --check |
| 56 |
.... |
| 57 |
|
| 58 |
If using *certmonger* to manage certificates, following command can be |
| 59 |
used to generate a certificate/key pair: |
| 60 |
|
| 61 |
.... |
| 62 |
CERT_FILE=/etc/cockpit/ws-certs.d/50-certmonger.crt |
| 63 |
KEY_FILE=/etc/cockpit/ws-certs.d/50-certmonger.key |
| 64 |
|
| 65 |
getcert request -f ${CERT_FILE} -k ${KEY_FILE} -D $(hostname --fqdn) |
| 66 |
.... |
| 67 |
|
| 68 |
== Options |
| 69 |
|
| 70 |
*--help*:: |
| 71 |
Show help options. |
| 72 |
*--port* _PORT_:: |
| 73 |
Serve HTTP requests on _PORT_ instead of port 9090. Usually Cockpit is |
| 74 |
started on demand by *systemd* socket activation, and this option |
| 75 |
has no effect. Update the *ListenStream* directive |
| 76 |
*cockpit.socket* file in the usual *systemd* manner. |
| 77 |
*--no-tls*:: |
| 78 |
Don't use TLS. Certificates will not be read, and https connections |
| 79 |
denied. Then *cockpit-tls* will only manage a single cockpit-ws |
| 80 |
instance, and thus not do anything different than running |
| 81 |
*cockpit-ws --no-tls* directly. Only use this for debugging or |
| 82 |
testing. |
| 83 |
*--idle-timeout* _SECONDS_:: |
| 84 |
If greater than 0, exit if no connections have happened for the given |
| 85 |
number of seconds, i. e. the server is idle. If not given, the default |
| 86 |
is 90. |
| 87 |
|
| 88 |
== Environment |
| 89 |
|
| 90 |
The *cockpit-tls* program expects the *RUNTIME_DIRECTORY* |
| 91 |
environment variable to be set to an empty directory (preferably in |
| 92 |
*/run/*) that is only accessible by the system user under which it is |
| 93 |
running. This contains the Unix sockets for communicating with the |
| 94 |
*cockpit-ws* instances, and in the future, state information about |
| 95 |
client certificates. This variable is normally set by the |
| 96 |
*cockpit.service* systemd unit. |
| 97 |
|
| 98 |
In addition, *cockpit-tls* will use the *XDG_CONFIG_DIRS* |
| 99 |
environment variable from the |
| 100 |
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html[XDG |
| 101 |
basedir spec] to find its certificates and the man:cockpit.conf[5] |
| 102 |
configuration file. |
| 103 |
|
| 104 |
== Bugs |
| 105 |
|
| 106 |
include::../partials/bugs.adoc[] |
| 107 |
|
| 108 |
== Author |
| 109 |
|
| 110 |
include::../partials/author.adoc[] |
| 111 |
|
| 112 |
== See also |
| 113 |
|
| 114 |
man:cockpit-ws[8] , man:cockpit.conf[5] , man:systemd[1] |