mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-22 19:01:30 +00:00
Merge bugfix/add_apparmor515_focal into ubuntu/focal [a=philroche] [r=ankushpathak,jessica-youjeong,vorlon]
feat(apparmor): Add kernel apparmor check to snap validation (LP: #2052789) For jammy and later, snap validation verifies that the kernel version matches the livecd-rootfs version, if available. This change bring focal in line with that paradigm. This is necessary due to the linux-$CLOUD-5.15 kernels requiring a different apparmor feature set that generic. feat: add 5.15 apparmor directory (LP: #2052789) After the kernel roll to linux-gcp-5.15-5.15.0-1051.59_20.04.1, basic_ubuntu::test_snap_preseed_optimized began failuring due to a preseed mismatch. This change adds a 5.15 apparmor configuration to the focal branch. MP: https://code.launchpad.net/~philroche/livecd-rootfs/+git/livecd-rootfs/+merge/460323
This commit is contained in:
commit
081a251efd
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,3 +1,10 @@
|
||||
livecd-rootfs (2.664.53) UNRELEASED; urgency=medium
|
||||
|
||||
[Catherine Redfield]
|
||||
* add 5.15 apparmor directory for snap preseeding with 5.15 kernel (LP: #2052789)
|
||||
|
||||
-- Phil Roche <phil.roche@canonical.com> Fri, 09 Feb 2024 09:41:18 +0000
|
||||
|
||||
livecd-rootfs (2.664.52) focal; urgency=medium
|
||||
|
||||
* fix: use correct sshd_config.d/ ordering. (LP: #2049860)
|
||||
|
1
live-build/apparmor/5.15/capability
Normal file
1
live-build/apparmor/5.15/capability
Normal file
@ -0,0 +1 @@
|
||||
0xffffff
|
1
live-build/apparmor/5.15/caps/mask
Normal file
1
live-build/apparmor/5.15/caps/mask
Normal file
@ -0,0 +1 @@
|
||||
chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap mac_override mac_admin syslog wake_alarm block_suspend audit_read
|
1
live-build/apparmor/5.15/dbus/mask
Normal file
1
live-build/apparmor/5.15/dbus/mask
Normal file
@ -0,0 +1 @@
|
||||
acquire send receive
|
1
live-build/apparmor/5.15/domain/attach_conditions/xattr
Normal file
1
live-build/apparmor/5.15/domain/attach_conditions/xattr
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/domain/change_hat
Normal file
1
live-build/apparmor/5.15/domain/change_hat
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/domain/change_hatv
Normal file
1
live-build/apparmor/5.15/domain/change_hatv
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/domain/change_onexec
Normal file
1
live-build/apparmor/5.15/domain/change_onexec
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/domain/change_profile
Normal file
1
live-build/apparmor/5.15/domain/change_profile
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/domain/computed_longest_left
Normal file
1
live-build/apparmor/5.15/domain/computed_longest_left
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/domain/fix_binfmt_elf_mmap
Normal file
1
live-build/apparmor/5.15/domain/fix_binfmt_elf_mmap
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/domain/post_nnp_subset
Normal file
1
live-build/apparmor/5.15/domain/post_nnp_subset
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/domain/stack
Normal file
1
live-build/apparmor/5.15/domain/stack
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/domain/version
Normal file
1
live-build/apparmor/5.15/domain/version
Normal file
@ -0,0 +1 @@
|
||||
1.2
|
1
live-build/apparmor/5.15/file/mask
Normal file
1
live-build/apparmor/5.15/file/mask
Normal file
@ -0,0 +1 @@
|
||||
create read write exec append mmap_exec link lock
|
1
live-build/apparmor/5.15/ipc/posix_mqueue
Normal file
1
live-build/apparmor/5.15/ipc/posix_mqueue
Normal file
@ -0,0 +1 @@
|
||||
create read write open delete setattr getattr
|
1
live-build/apparmor/5.15/mount/mask
Normal file
1
live-build/apparmor/5.15/mount/mask
Normal file
@ -0,0 +1 @@
|
||||
mount umount pivot_root
|
1
live-build/apparmor/5.15/namespaces/pivot_root
Normal file
1
live-build/apparmor/5.15/namespaces/pivot_root
Normal file
@ -0,0 +1 @@
|
||||
no
|
1
live-build/apparmor/5.15/namespaces/profile
Normal file
1
live-build/apparmor/5.15/namespaces/profile
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/network/af_mask
Normal file
1
live-build/apparmor/5.15/network/af_mask
Normal file
@ -0,0 +1 @@
|
||||
unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp
|
1
live-build/apparmor/5.15/network/af_unix
Normal file
1
live-build/apparmor/5.15/network/af_unix
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/network_v8/af_mask
Normal file
1
live-build/apparmor/5.15/network_v8/af_mask
Normal file
@ -0,0 +1 @@
|
||||
unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp
|
1
live-build/apparmor/5.15/policy/set_load
Normal file
1
live-build/apparmor/5.15/policy/set_load
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/policy/versions/v5
Normal file
1
live-build/apparmor/5.15/policy/versions/v5
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/policy/versions/v6
Normal file
1
live-build/apparmor/5.15/policy/versions/v6
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/policy/versions/v7
Normal file
1
live-build/apparmor/5.15/policy/versions/v7
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/policy/versions/v8
Normal file
1
live-build/apparmor/5.15/policy/versions/v8
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/ptrace/mask
Normal file
1
live-build/apparmor/5.15/ptrace/mask
Normal file
@ -0,0 +1 @@
|
||||
read trace
|
1
live-build/apparmor/5.15/query/label/data
Normal file
1
live-build/apparmor/5.15/query/label/data
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/query/label/multi_transaction
Normal file
1
live-build/apparmor/5.15/query/label/multi_transaction
Normal file
@ -0,0 +1 @@
|
||||
yes
|
1
live-build/apparmor/5.15/query/label/perms
Normal file
1
live-build/apparmor/5.15/query/label/perms
Normal file
@ -0,0 +1 @@
|
||||
allow deny audit quiet
|
1
live-build/apparmor/5.15/rlimit/mask
Normal file
1
live-build/apparmor/5.15/rlimit/mask
Normal file
@ -0,0 +1 @@
|
||||
cpu fsize data stack core rss nproc nofile memlock as locks sigpending msgqueue nice rtprio rttime
|
1
live-build/apparmor/5.15/signal/mask
Normal file
1
live-build/apparmor/5.15/signal/mask
Normal file
@ -0,0 +1 @@
|
||||
hup int quit ill trap abrt bus fpe kill usr1 segv usr2 pipe alrm term stkflt chld cont stop stp ttin ttou urg xcpu xfsz vtalrm prof winch io pwr sys emt lost
|
@ -726,13 +726,44 @@ snap_preseed() {
|
||||
|
||||
snap_validate_seed() {
|
||||
local CHROOT_ROOT=$1
|
||||
local kern_major_min=undefined
|
||||
local boot_filename=undefined
|
||||
|
||||
# ppc64el still uses /boot/vmlinux so we need to determine the boot file name as non ppc64el use /boot/vmlinuz
|
||||
# We don't need to query the arch as we can use existence of the file to determine the boot file name. Both
|
||||
# will never be present at the same time.
|
||||
if [ -e ${CHROOT_ROOT}/boot/vmlinuz ]; then
|
||||
boot_filename=vmlinuz
|
||||
elif [ -e ${CHROOT_ROOT}/boot/vmlinux ]; then
|
||||
boot_filename=vmlinux
|
||||
fi
|
||||
if [ ${boot_filename} != undefined ]; then # we have a known boot file so we can proceed with checking for features to mount
|
||||
kern_major_min=$(readlink --canonicalize --no-newline ${CHROOT_ROOT}/boot/${boot_filename} | grep --extended-regexp --only-matching --max-count 1 '[0-9]+\.[0-9]+')
|
||||
if [ -d /usr/share/livecd-rootfs/live-build/apparmor/${kern_major_min} ]; then
|
||||
# if an Ubuntu version has different kernel apparmor features between LTS and HWE kernels
|
||||
# a snap pre-seeding issue can occur, where the incorrect apparmor features are reported
|
||||
# basic copy of a directory structure overriding the "generic" feature set
|
||||
# which is tied to the LTS kernel
|
||||
|
||||
# Bind kernel apparmor directory to feature directory for snap preseeding
|
||||
umount "${CHROOT_ROOT}/sys/kernel/security/apparmor/features/"
|
||||
mount --bind /usr/share/livecd-rootfs/live-build/apparmor/${kern_major_min} "${CHROOT_ROOT}/sys/kernel/security/apparmor/features/"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -e "${CHROOT_ROOT}/var/lib/snapd/seed/seed.yaml" ]; then
|
||||
snap debug validate-seed "${CHROOT_ROOT}/var/lib/snapd/seed/seed.yaml"
|
||||
/usr/lib/snapd/snap-preseed --reset $(realpath "${CHROOT_ROOT}")
|
||||
/usr/lib/snapd/snap-preseed $(realpath "${CHROOT_ROOT}")
|
||||
chroot "${CHROOT_ROOT}" apparmor_parser --skip-read-cache --write-cache --skip-kernel-load --verbose -j `nproc` /etc/apparmor.d
|
||||
fi
|
||||
|
||||
# Unmount kernel specific apparmor feature
|
||||
# mount generic apparmor feature again (cleanup)
|
||||
if [ -d /build/config/hooks.d/extra/apparmor/${kern_major_min} ]; then
|
||||
umount "${CHROOT_ROOT}/sys/kernel/security/apparmor/features/"
|
||||
mount -o bind /usr/share/livecd-rootfs/live-build/apparmor/generic "${CHROOT_ROOT}/sys/kernel/security/apparmor/features/"
|
||||
fi
|
||||
}
|
||||
|
||||
snap_from_seed() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user