Changing a CA SSL certificate for the Agent Bakery
If your Checkmk Server is using HTTPS, and you're using the Agent Bakery, you need to be careful when exchanging the HTTPS certificate of your Checkmk server.
If the root CA for the new certificate stays the same, this should be no problem for the Agent Bakery. However, if the CA changes, or if you change a standalone self-signed certificate, you must follow some extra steps.
If the root CA for the new certificate stays the same, this should be no problem for the Agent Bakery. However, if the CA changes, or if you change a standalone self-signed certificate, you must follow some extra steps.
APPLICABLE TO ALL CHECKMK VERSIONS
Table of Contents
Getting Started
Background information regarding this subject is available on our:
Step-by-step guide
- Get new certificate
- Check if the certificate chain has changed. This means either your root certificate or an intermediate certificate have changed.
- Yes: Jump to step 3
- No: Jump to step 4
- The chain or the standalone self-signed certificate has changed:
- Add the new chain to the Agent Updater (do NOT replace the old chain!).
- Bake and sign agents.
- Wait until all agents have updated. Make sure to verify this!
- Proceed to step 4.
- Add the new chain to the Agent Updater (do NOT replace the old chain!).
- The chain did not change, or step 3 was competed:
- Restrict agent updates to only 2 or 3 hosts, to double-check, if everything works as expected.
Deploy the new certificate to the Apache server.
For Checkmk Appliances: Click on Device Settings → Web Access → Upload CertificateFor more information about Appliances and SSL certificates, please refer to our Official Documentation.
- Check for the correct cert and chain by using a browser.
- Make sure agent update works for the test hosts.
- If the chain changed (see step 3), remove the old chain from the updater rule, bake & sign agents, and see if everything works with the test hosts.
- Remove the restriction to the test hosts and update all agents.
- Restrict agent updates to only 2 or 3 hosts, to double-check, if everything works as expected.
Verification
The following can help determine if the certificates of an agent match the certs of the Checkmk server.
Show the Certificate Authority, Issuers, and Subjects of the certificates that were installed with the agent package.
root@mylinuxhost:~# echo "Agent updater certificate store:" openssl crl2pkcs7 -nocrl -certfile <(cat /etc/check_mk/cmk-update-agent.cfg | egrep "\\n'" | cut -f2 -d":" | cut -f2 -d"'" | sed "s/\\\\n//g") | openssl pkcs7 -print_certs -text -noout | grep -e Subject: -e Issuer -e CA
Show Issuer, Subject and Subject Alternative Names of the certificate of the server where the agent updater is registered to:
root@mylinuxhost:~# s=$(cat /etc/check_mk/cmk-update-agent.cfg | grep "'server'" | cut -f4 -d"'") echo "CMK Server HTTṔS Certificate for $s" openssl s_client -connect $s:443 </dev/null 2>/dev/null | openssl x509 -noout -text | grep -e Issuer: -e Subject: -e DNS:
Related articles