How-to exchange a signature key for the automatic agent updater
Getting Started
Agents download updates via HTTP or HTTPS from the central monitoring server. Since they contain executable code, it's critical to ensure their authenticity. This is achieved using signature keys based on a public and private key pair.
Starting with version 2.2, Werk #15064: Agent updater checks for certificate validity set the lifetime of new signing-keys to 2 years. With Werk #17102: Agent Signature Key Expiry and Notifications, the key mechanism was reworked. The lifetime is extended to 10 years.
Problem
Depending on your patch level and the creation date of the signature key, you will be informed about the expiring signature key (< 90 days) by a WARN state of the service "Check_MK-Agent" :
or all users with the permission “Create Signature Keys” receive a User Message referring them to further steps for exchanging the signature keys:
.
.
Step-by-step guide
Replacing keys before they expire
- Navigate to “Setup → Agents → Windows, Linux, Solaris, AIX → Agents” and choose the option Signature keys
Click Generate key. This option creates a new signature key.
You also have the option to use your own CA by selecting Upload key. For more information, refer to the article Certificate Issuance via Your Own CA.
.Enter a description or comment, along with a passphrase. Choose a very secure passphrase and store it in a secure place!
- Click Create. Do not delete the old key yet.
Select the new Signature key
- Navigate to the Agent updater rule and modify the existing Rule : Setup → Agents → Windows, Linux, Solaris, AIX → Agent rules → Agent updater (Linux, Windows, Solaris)
- Select at least one new Signature key that should be accepted by the Agent updater. You can uncheck the old key.
- Click Save and activate changes
Sign the Agents with old Signature key
Navigate to Setup → Agents → Windows, Linux, Solaris, AIX
Click on Sign agents
Select the old signature key from the list of available keys.
Enter the passphrase associated with the selected key.
The agents will be signed using the selected key. You can verify successful signing in the configuration overview; look for a small key icon in the Signed column for each agent package.
Monitor the agent update status in the appropriate view (Monitor → System → Agent update status). Verify that all agents have been updated.
Once all agents have been updated with the new key, you can delete the old key. No further interactions necessary.
Replacing expired keys
If the signature key has expired, the agent will no longer accept any updates signed with that key. If no other, still valid keys are available, you will need to force the update on each host manually:
- Create a new signature key
- Select that new key under Signature keys the agent will accept in the Agent updater rule (you can uncheck the old key)
- Bake and sign agents with the new key
- Log into the host and force the update without checking signatures using
cmk-update-agent --skip-signatures
- Use
cmk-update-agent show-config
to verify that the update succeeded
Related articles