In some cases, you may find that you need to regenerate the certificates and security credentials (private and public keys) generated by PE’s built-in certificate authority (CA). For example, you may have a Puppet master that you need to move to a different network in your infrastructure, or you may find that you need to regenerate all the certificates and security credentials in your infrastructure due to an unforeseen security vulnerability.
You can regenerate all certificates in a monolithic PE deployment, including the certificates and keys for the Puppet master, PuppetDB, PE console, and associated services.
See Regenerating certificates: split installs for instructions on regenerating certificates in a split PE deployment.
Regenerating your certificates involves the following tasks:
Before you begin, review the following information:
You must be logged in as a root to make these changes.
Regenerating your certificates will invalidate all existing authentication tokens. Once the regeneration process is complete, all PE users must generate new authentication tokens.
In the following instructions, when
<CERTNAME> is used, it refers to the Puppet agent’s certname. To find this value, run
puppet config print certname before starting.
If something goes wrong during the regeneration process, you may need to restore these directories so your deployment can stay functional. However, if you needed to regenerate your certs for security reasons and couldn’t, you should contact Puppet support as soon as you restore service so we can help you secure your site.
Back up the following directories:
If needed, you can delete and recreate the Puppet CA before regenerating the rest of your monolithic certificates. This destroys the certificate authority and all other certificates. This is an optional step and is an meant for use in the event of a total compromise of your site, or some other unusual circumstance.
Run the following commands on the Puppet master.
Delete the CA and clear all certs from your master.
rm -rf /etc/puppetlabs/puppet/ssl/*
Regenerate the CA.
puppet cert list -a
You should see this message:
Notice: Signed certificate request for ca
In this step, you’ll create the certificates for the Puppet master and then configure PE so the certificate is available to PE’s components and services.
Remove the Puppet master’s cached catalog.
rm -f /opt/puppetlabs/puppet/cache/client_data/catalog/<CERTNAME>.json
Clear the cert for the Puppet master.
Tip: This step is not necessary if you deleted and recreated the CA cert.
puppet cert clean <CERTNAME>
Generate the certificates for PE services and update the configuration of PE.
Note: Be sure to specify any DNS alt names you have in the
/etc/puppetlabs/enterprise/conf.d/pe.conf. You can find the list of your current DNS alt names with
puppet cert list <CERTNAME>. By default, PE uses
puppet enterprise configure --no-recover
Run Puppet on the Puppet master.
puppet agent -t
A successful Puppet run is necessary to ensure that PE’s services are properly configured.
If you want to regenerate the DH param files, see Configuring the PE console to use a custom Diffie-Hellman file, which contains instructions on regenerating files.