Hello,
The canonical-livepatch snap has added 3 new system-files plugs etc-kernel-postinst-d, etc-apt-conf-d and boot-grub. These plugs are required to enable a new feature for improved reboot recommendations to Livepatch users. Please review and allow the use and auto-connection of this plug.
etc-kernel-postinst-d: The purpose of this plug is to allow write access to the file/etc/kernel/postinst.d/livepatch-kernel-installed. This file will consist of a simple shell script that writes a kernel installed marker to/run/canonical-livepatch-kernel-installed. This marker is then consumed by another process. The purpose of writing this marker is to allow for early exits, when a package other than a kernel package is being installed through apt.etc-apt-conf-d: The purpose of this plug is to allow write access to the file/etc/apt/apt.conf.d/20canonical-livepatch. This file will be inserted by thecanonical-livepatchsnap. The inserted file will register an apt Post-Invoke hook that runs a script after apt’s dpkg call sequence. The script will influence automatic reboots and system restart notifications when Canonical Livepatch provides security coverage for vulnerabilities in the running kernel. The script that runs here will consume the marker created by the/etc/kernel/postinst.d/livepatch-kernel-installedscript mentioned above.boot-grub: The purpose of this plug is to allow read access to the files/boot/grub/grub.cfgand/boot/grub/grubenv. This is required for thecanonical-livepatchsnap to read the GRUB configuration and GRUB environment to determine the kernel that will be booted on the next reboot. Determining this is important for thecanonical-livepatchsnap to provide reboot recommendations. Since the host’s /boot is not bind-mounted into the snap’s mount namespace, we access these files through/var/lib/snapd/hostfs/.
Inserting the above-mentioned scripts from the canonical-livepatch snap would allow the unattended-upgrades and update-notifier scripts in the kernel post-install directory to remove their Livepatch dependent code that violated separation of concerns. This would solve a long-standing bug while not compromising on the intended feature.
Reading the grub config and environment also provides Livepatch with the necessary information to accurately provide reboot recommendations, thereby enhancing the initially intended feature.
name: canonical-livepatch
description: Canonical Livepatch patches high and critical linux kernel vulnerabilities removing the immediate need to reboot to upgrade the kernel, instead allowing the downtime to be scheduled. It is a part of the Ubuntu Pro offering.
The Canonical Livepatch Client is an application that runs on your machine and periodically checks for patches.
See our docs at https://ubuntu.com/security/livepatch/docs/livepatch
snapcraft: PRIVATE
upstream: PRIVATE
upstream-relation: Canonical owned and managed snap. I am an engineer working on this project.
plugs:
etc-kernel-postinst-d:
interface: system-files
attributes:
write:
- /etc/kernel/postinst.d/livepatch-kernel-installed
request-type: installation and auto-connection
reasoning: insert a script that writes a kernel installed marker to /run/canonical-livepatch-kernel-installed. The marker is then consumed by other processes to enable early exits. (See above for more details and context).
etc-apt-conf-d:
interface: system-files
attributes:
write:
- /etc/apt/apt.conf.d/20canonical-livepatch
request-type: installation and auto-connection
reasoning: insert a file that registers an apt Post-Invoke hook that runs a script after apt’s dpkg call sequence. This script is responsible for influencing automatic reboots and system restart notifications based on Livepatch security coverage and vulnerabilities fixed in the next-boot kernel. (See above for more details and context).
boot-grub:
interface: system-files
attributes:
read:
- /var/lib/snapd/hostfs/boot/grub/grub.cfg
- /var/lib/snapd/hostfs/boot/grub/grubenv
request-type: installation and auto-connection
reasoning: read the GRUB configuration and GRUB environment to determine the kernel that will be booted on the next reboot. Determining this is important for the canonical-livepatch snap to provide reboot recommendations. (See above for more details and context).