In lieu of its built-in certificate authority (CA) and public key infrastructure (PKI) tools, Puppet can use an existing external CA for all of its secure socket layer (SSL) communications.
This page describes the supported and tested configurations for external CAs in this version of Puppet. If you have an external CA use case that isn’t covered here, please contact Puppet so we can learn more about it.
This version of Puppet supports some external CA configurations, but not every possible arrangement. We fully support the following setups:
These are fully supported by Puppet, which means:
Puppet always expects its SSL credentials to be in
Any Puppet Server certificate must contain the DNS name at which agent nodes will attempt to contact that server, either as the subject common name (CN) or as a Subject Alternative Name (DNS).
When Puppet uses its internal CA, it defaults to a single CA configuration. A single externally issued CA can also be used in a similar manner.
+------------------------+ | | | Root self-signed CA | | | +------+----------+------+ | | +----------+ +------------+ | | v v +-----------------+ +----------------+ | | | | | Server SSL Cert | | Agent SSL Cert | | | | | +-----------------+ +----------------+
This configuration is all-or-nothing rather than mix-and-match. When using an external CA, the built-in Puppet CA service must be disabled and cannot be used to issue SSL certificates.
Additionally, Puppet cannot automatically distribute certificates in this configurations — you must have your own complete system for issuing and distributing certificates.
Configure Puppet Server in three steps:
Edit Puppet Server’s
/etc/puppetlabs/puppetserver/services.d/ca.cfg file to disable the internal CA. Comment out the line following “To enable the CA service…” and uncomment the line following “To disable the CA service…”, as follows:
# To enable the CA service, leave the following line uncommented # puppetlabs.services.ca.certificate-authority-service/certificate-authority-service # To disable the CA service, comment out the above line and uncomment the line below puppetlabs.services.ca.certificate-authority-disabled-service/certificate-authority-disabled-service
Set a static value for the
certname setting in
[master] certname = puppetserver.example.com
Setting a static value keeps Puppet from getting confused if the machine’s hostname ever changes. The value must be whatever certname you’ll use to issue the server’s certificate. It must not be blank.
Put the credentials from your external CA on disk in the correct locations. These locations must match what’s configured in your webserver.conf file. If you haven’t changed those settings, you can run the following commands to find the default locations:
|Server SSL certificate||
|Server SSL certificate private key||
|Root CA certificate||
|Root certificate revocation list||
If you’ve put the credentials in the correct locations, you shouldn’t need to change any additional settings.
You don’t need to change any settings.
Put the external credentials into the correct filesystem locations. You can run the following commands to find the appropriate locations:
|Agent SSL certificate||
|Agent SSL certificate private key||
|Root CA certificate||
|Root certificate revocation list||
Puppet Server can operate as an intermediate CA to an external root CA. (The server cannot be an intermediate to an intermediate.) In this mode, the Puppet CA is left enabled; it can automatically accept CSRs and distribute certificates to agents, and can use the standard
puppet cert command to sign certificates. However, there are some limitations:
Before configuring Puppet Server, you must obtain the intermediate CA certificate from your external root CA. Generating the intermediate CA cert is outside the scope of this guide, since it depends on your external certificate authority solution. This guide assumes you are either starting with a fresh installation or have removed all SSL files from your existing server and are starting over. Also, you should stop all Puppet related services on the server before this process.
To configure Puppet Server:
Put the following files in place:
|Intermediate CA Certificate||
|Intermediate CA Key||
|Root CA Certificate||
All of these files should be owned by
puppet:puppet and have permissions of
Note: Although root_crt.pem can be named anything (since Puppet Server doesn’t use it directly), the file needs to be stored in the location shown.
Note: ca_key.pem must not have a passphrase, since the Puppet CA cannot provide one when using the key.
Generate the CA bundle, which you’ll place on the server and on every agent node. Combine the root CA and intermediate CA certificates into one PEM file:
cd /etc/puppetlabs/puppet/ssl/ca cat ca_crt.pem root_crt.pem > ../certs/ca.pem
Note: You also need to install a CRL file. If you don’t have one pre-generated from the root CA, you can easily create one by first running
puppet cert generate fakehostand then revoking this certificate with
puppet cert clean fakehost. If you do have a pre-generated CRL, install it into `/etc/puppetlabs/puppet/ssl/ca/ca_crl.pem.
Generate a new certificate for Puppet Server to use. Remember to include the
dns_alt_names that this server will need to service.
puppet cert generate puppetserver.my.domain.net --dns_alt_names=puppetserver,puppet
You can now restart the puppetserver process and confirm that it successfully starts.
If your deployment includes other non-agent Puppet services that need new certificates (for example, PuppetDB), please see Regenerating all Certificates for a Puppet deployment for specific instructions.
You need to do two things to prepare Puppet agent for this CA configuration:
Copy the CA bundle you created to
/etc/puppetlabs/puppet/ssl/certs/ca.pem on every agent node.
If you copy this file into place before the first Puppet run, you will not recieve any errors. If you attempt a Puppet run prior to this file being present you will receive errors since the auto-distributed ca.pem file doesn’t include the root CA..
Error: Could not request certificate: SSL_connect returned=1 errno=0 state=error: certificate verify failed: [unable to get local issuer certificate for /CN=<server>]
certificate_revocation = false in the
[main] section of puppet.conf on every agent node:
[main] certificate_revocation = false
Once you’ve completed both of these steps, the agent can run successfully.