Ubuntu introduced a new service which enables live kernel patching on any Ubuntu 16.04 LTS system. This service allows system administrators to address critical security issues and vulnerabilities without rebooting the server.
Kernel live patching enables runtime correction of critical security issues in your kernel without rebooting. It’s the best way to ensure that machines are safe at the kernel level, while guaranteeing uptime, especially for container hosts where a single machine may be running thousands of different workloads
Procedures:
- Create an Ubuntu One account
- Generate your Livepatch Token
- Install and Enable Canonical Livepatch Service
Step 1 – Create an Ubuntu One account
To take advantage of this new service, you need to create a free Ubuntu One account in https://login.ubuntu.com/. Upon signing up, verify your account by clicking the link that would be sent in your email.
Step 2 – Generate your Livepatch Token
After verifying your Ubuntu One account, generate your livepatch token here:
https://auth.livepatch.canonical.com/
A single token can be used to enable the Canonical Livepatch Service in up to 3 servers. Once your token has been generated, you would see something like this:
Once the token is generated, you can now install and enable the live kernel patch service in your Ubuntu box.
Step 3 – Install and Enable Canonical Livepatch Service
Login to your Ubuntu server and follow these commands:
1 2 |
sudo snap install canonical-livepatch sudo canonical-livepatch enable <TOKEN> |
Replace <TOKEN>
with the one you generated from Step 2.
Verify your kernel’s status using the command below:
1 |
sudo canonical-livepatch status --verbose |
Output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
client-version: "5" machine-id: 5230acdc7206812a85b2c741573f3d72 machine-token: 3cbafb46246d47ec94e6d3126171d498 architecture: x86_64 cpu-model: Intel(R) Xeon(R) CPU E5-2630L v2 @ 2.40GHz last-check: 2016-10-23T17:13:08.1182341Z boot-time: 2016-07-18T23:40:30Z uptime: 2321h33m57s status: - kernel: 4.4.0-31.50-generic running: true livepatch: state: applied version: "13.3" fixes: "" |
Voila! Your server is now gonna patch itself once it learns that it has a hole which someone might use to make it bleed trillion bits of 1’s and 0’s.