Foreman does a great job of providing SSL support out-of-the-box, it does this by using the SSL certificates generated by your puppet-ca. Unless your users web browsers all trust the puppet CA (unlikely), any human user of Foreman is going to get SSL warnings. Replacing Foremans SSL certificate with one that’s signed by a default trusted CA requires some care for 2 reasons:
- Other components apart from humans using web browsers, need to validate the Foreman server. Therefore we need to make sure these components validate the Forman server against the correct CA.
- Foreman uses SSL client authentication to authenticate various components via their puppet-ca certificates. We need to make sure we do not change the CA that foreman uses to authenticate these components.
The following diagram shows the various components talking to the Forman server and which communications require the SSL keys changing.
For the following examples, the new certificates live in the following locations:
- SSL Certificate:
/etc/pki/tls/certs/puppet.example.com.crt
- SSL Private Key:
/etc/pki/tls/private/puppet.example.com.key
- SSL CA Chain:
/etc/pki/tls/certs/cachain.crt
Foreman
Foreman is presented via mod_passenger on Apache, so the SSL keys need to be changed in your apache VirtualHost. For me this was /etc//httpd/conf.d/05-foreman-ssl.conf
.
The following options need to be changed: SSLCertificateFile
, SSLCertificateKeyFile
and SSLCertificateChainFile
.
It is important that you do not change SSLCACertificateFile
or SSLCARevocationFile
, as these are used for client authentication. Your final config should look like this:
|
|
If you use the Console feasture for foreman, you will also want to change the websockets_ssl_key
and websockets_ssl_cert
keys in /etc/foreman/settings.yaml
. For example:
|
|
Smart Proxy
If you have your smart proxies running on the same box as foreman, make sure
foreman_ssl_ca
is not defined in /etc/foreman-proxy/settings.yaml
and
it will read the CA from the main foreman settings.
Puppet
Change ssl_ca
in /etc/puppet/foreman.yaml
, do not change ssl_cert
or ssl_key
. For example:
|
|
Managing with puppet
If you use manage your foreman and puppet install with the theforeman/puppet
and theforeman/foreman
modules, you can configure all the above with the
following hiera data:
|
|