Outils pour utilisateurs

Outils du site


issue157:tutoriel1

https://ubuntu.com/livepatch Many of us have seen the Ubuntu livepatch option, but not many home users actually use it. Many are unsure of what it is, or just do not want snaps on their systems. First the bad news. You need to sign up for an account, but you can use Donald Trump’s name if you like. You also need snapd… It also works on only LTS releases… that are 64-bit… with a kernel greater than 4.4. Whew!

https://ubuntu.com/livepatch

Nous sommes nombreux à avoir vu l'option Livepatch d'Ubuntu, mais en fait peu d'utilisateurs domestiques l'utilisent. Beaucoup ne sont pas sûrs de ce que c'est, ou, simplement, ne veulent pas de snaps sur leur système.

D'abord, les mauvaises nouvelles. Vous devez vous enregistrer, mais vous pouvez utiliser le nom « Donald Trump » si vous préférez. Vous aurez aussi besoin de snapd… qui ne marche que sur les versions LTS… qui sont en 64-bit… avec un noyau supérieur au 4.4. Ouf !

Now some good news. This enterprise tool is available to users like you and me for three computers absolutely free. It works on bare metal servers, VM’s, and desktops. Live patches avoid configuration mistakes. Why is this good news? Because it is easy to make a simple mistake and kill your working server. Livepatching is a thing. It all starts with kernel probes, or kprobes, basically a debugging tool, that allows you to monitor events within a running system. You can find more info here: https://lwn.net/Articles/132196/ - if I understand it correctly, it is an ftrace-based (function trace) mechanism and kernel interface for doing live patching of a kernel and kernel module functions. Livepatch is available for most x86-based CPUs, so not yet for your Raspberry Pi server. Also, it may not work on some Ubuntu “flavors”. How do you check if livepatch is supported by your kernel, you may ask. Good question! Open a terminal and type: cat /boot/config-$(uname -r) | grep LIVEPATCH

Maintenant, des bonnes nouvelles. Cet outil d'entreprise est disponible pour les utilisateurs comme vous et moi totalement gratuitement pour trois ordinateurs. Il fonctionne sur les serveurs sans accessoires, les VM (machines virtuelles) et les ordinateurs de bureau. Les correctifs à chaud évitent les erreurs de configuration. Pourquoi est-ce une bonne nouvelle ? Parce qu'il est facile de faire une erreur bête et de planter votre serveur en fonctionnement.

Les corrections à chaud (livepatching) sont toute une affaire. Tout commence avec les sondes du noyau, ou kprobes, en gros un outil de débogage, qui vous permettent de superviser les événements sur un système en fonctionnement. Vous pouvez trouver plus d'infos ici : https://lwn.net/Articles/132196/ - si je le comprends correctement, c'est un mécanisme basé sur ftrace (trace d'une fonction) et sur l'interface avec le noyau pour réaliser des corrections à chaud sur des fonctions du noyau et des modules du noyau. Livepatch est disponible pour la plupart des processeurs basés sur x86, donc pas encore pour votre serveur Raspberry Pi. Il peut aussi ne pas fonctionner pour certaines « saveurs » d'Ubuntu. Vous pourriez vous demander comment vérifier si livepatch est supporté par votre noyau. Bonne question ! Ouvrez un terminal et tapez :

cat /boot/config-$(uname -r) | grep LIVEPATCH

Security is always a top priority, you need to keep your kernel up-to-date and you do not need the grey hairs. If you ever had to restart an Ubuntu server after patching, the one running your clients’ websites… you had to cross your fingers and hope it went quick – and most importantly, unnoticed. Enter livepatch. It is simple to set up in your terminal if you have a server, or in a GUI if you have a desktop. Why do you need an account? Well, security. As I understand it, there is a GPG key or private / public key, attached to your Ubuntu One account. This makes sense. However, I hope they have tightened up security, as my Ubuntu One details are in the wild and I can never use that password again. If you do not have one, create it here: https://login.ubuntu.com

La sécurité est toujours la priorité absolue ; vous devez garder votre noyau à jour et vous n'avez pas besoin de vous faire des cheveux gris. Si vous avez déjà dû redémarrer un serveur Ubuntu après corrections, celui qui fait tourner les sites Web de vos clients…, vous deviez croiser les doigts et espérer que ça se passe vite - et, plus important, sans que ça se voie. C'est là où livepatch entre en scène. C'est simple de faire le paramétrage dans votre terminal si vous avez un serveur, ou avec une interface graphique si vous avez une machine de bureau.

Pourquoi avons-nous besoin d'un compte ? Eh bien ! Pour la sécurité. Comme je l'ai compris, il y a une clé GPG, ou clé privée/publique, attachée à votre compte Ubuntu One. C'est logique. Cependant, j'espère qu'ils ont bien verrouillé la sécurité, car les détails de mon Ubuntu One sont dans la nature et je ne peux plus utiliser ce mot de passe. Si vous n'en avez pas un, créez le ici : https://login.ubuntu.com

If you have vanilla Ubuntu 18.04, you should be able to find it (livepatch) in the menu. On your LTS server, you will need to add it via the terminal with: sudo canonical-livepatch enable - if you do not see it, you need: sudo snap install canonical-livepatch first. There is a video on the livepatch website that will run you through this. TL;DR … it’s 2 commands: sudo snap install canonical-livepatch sudo canonical-livepatch enable <received token>

Si vous avez Ubuntu 18.04 normal, vous devriez pouvoir le trouver (livepatch) dans le menu. Sur votre serveur LTS, vous aurez besoin de l'ajouter via le terminal avec : sudo canonical-livepatch enable - si vous ne le voyez pas, vous devez d'abord faire :

sudo snap install canonical-livepatch

Il y a une vidéo sur le site Web de livepatch qui vous guidera pour cela.

Pour faire court…, il y a deux commandes :

sudo snap install canonical-livepatch

sudo canonical-livepatch enable <jeton reçu>

On your desktop, you can go to “software and updates” and click on the very last tab. You should see this: This is a nice overview to see what you may need. Clicking “learn more” will just take you to the livepatch website and not actually help you by telling you what you need to do next. The livepatch button will slide over if you have met all the requirements mentioned above. If you are activating it on a desktop, you will also see an icon in your taskbar. On a server, simply run: ls -ld /sys/kernel/livepatch - at the command prompt.

Sur votre ordinateur de bureau, vous pouvez aller à « Logiciels et mises à jour » et cliquer sur le tout dernier onglet. Vous devriez voir ceci :

C'est un sympathique aperçu de ce dont vous avez besoin. Cliquez sur « En savoir plus » vous transportera sur le site Web de livepatch et ne vous aidera pas vraiment en vous disant ce que vous devez faire ensuite.

Le bouton livepatch changera de place si vous avez répondu à toutes les exigences mentionnées ci-dessus. Si vous l'activez sur un ordinateur de bureau, vous verrez aussi une icône sur votre barre de tâches.

Sur un serveur, lancez simplement :

ls -ld /sys/kernel/livepatch - à l'invite de commande.

NB! Livepatch will not work on security hardened servers or workstations, as it needs to load a kernel module to actually do the patching. Would you like to see more articles on things like these, or would you like to correct us on any incorrect information? (Everyone makes a mistake!). Please let us know on misc@fullcirclemagazine.org P.S. There is a nice tutorial at Linuxbabe: https://www.linuxbabe.com/ubuntu/canonical-livepatch-service-ubuntu-16-04-live-kernel-patching

NB ! Livepatch ne fonctionnera pas sur les serveurs ou stations de travail avec sécurité renforcée, car il a besoin de charger un module du noyau pour réaliser vraiment la correction.

Aimeriez-vous voir d'autres articles sur des sujets comme celui-ci, ou aimeriez-vous nous faire part d'une correction à propos d'une information erronée ? (Tout le monde fait des erreurs !) N'hésitez pas à nous en informer à : misc@fullcirclemagazine.org

P.S. : Il y a un bon tutoriel sur Linuxbabe : https://www.linuxbabe.com/ubuntu/canonical-livepatch-service-ubuntu-16-04-live-kernel-patching

issue157/tutoriel1.txt · Dernière modification : 2020/06/06 14:07 de auntiee