Skip to content

Commit c87abf7

Browse files
Bownairosasa-tomic
authored andcommitted
Upgrade GuestOS to 24.04
1 parent 0441f40 commit c87abf7

File tree

16 files changed

+47
-29
lines changed

16 files changed

+47
-29
lines changed

ic-os/components/early-boot/relabel-machine-id/guestos/relabel-machine-id.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
# machine-id is set up in initramfs and bind-mounted over to the rootfs. Since
44
# policy is not loaded in initramfs yet, it has wrong security context.
5+
systemd-machine-id-setup --commit
56
restorecon -v /etc/machine-id

ic-os/components/early-boot/relabel-machine-id/relabel-machine-id.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
# over to the rootfs. Since policy is not loaded in initramfs yet, it has
55
# wrong security context. Fix this up, but ignore failures (this will not
66
# work on first boot).
7+
systemd-machine-id-setup --commit
78
restorecon -v /etc/machine-id || true

ic-os/components/init/bootstrap-ic-node/guestos/bootstrap-ic-node.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ while [ ! -f /boot/config/CONFIGURED ]; do
175175
fi
176176

177177
# Fix up permissions. This is actually the wrong place.
178-
chown ic-replica.nogroup -R /var/lib/ic/data
178+
chown ic-replica:nogroup -R /var/lib/ic/data
179179

180180
if [ "${DEV}" != "" ]; then
181181
umount /mnt

ic-os/components/init/setup-encryption/guestos/setup-encryption.service

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Description=Set up encrypted storage on first boot
33
DefaultDependencies=no
44
After=boot-config.mount
55
Requires=boot-config.mount
6-
Before=systemd-cryptsetup@vda10\x2dcrypt.service
6+
Before=cryptsetup-pre.target
7+
Wants=cryptsetup-pre.target
78

89
[Install]
910
WantedBy=local-fs.target
10-
RequiredBy=systemd-cryptsetup@vda10\x2dcrypt.service
1111

1212
[Service]
1313
Type=oneshot
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
vda10-crypt /dev/vda10 /boot/config/store.keyfile luks2,discard
1+
vda10-crypt /dev/vda10 /boot/config/store.keyfile luks,discard

ic-os/components/networking/generate-network-config/guestos/generate-network-config.service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[Unit]
22
Description=Generate network config
33
After=bootstrap-ic-node.service
4+
Requires=bootstrap-ic-node.service
45
Before=systemd-networkd.service
56

67
[Install]

ic-os/components/selinux/filebeat/filebeat.te

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ init_daemon_domain(filebeat_t, filebeat_exec_t)
4141
# Allow filebeat to perform its primary function, namely to read
4242
# the journal files.
4343
systemd_read_journal_files(filebeat_t)
44+
systemd_watch_journal_dirs(filebeat_t)
4445

4546
# It wants to send the logs to remote host, allow unrestricted TCP for
4647
# this for now. Maybe this can be reasonably constrained more tightly.
@@ -56,6 +57,7 @@ corenet_all_recvfrom_unlabeled(filebeat_t)
5657

5758
# Read generic etc files (e.g. nsswitch.conf)
5859
files_read_etc_files(filebeat_t)
60+
files_read_etc_runtime_files(filebeat_t)
5961

6062
# Read CA certificate
6163
miscfiles_read_generic_certs(filebeat_t)
@@ -124,6 +126,7 @@ require {
124126
search_dirs_pattern(filebeat_t, bin_t, bin_t)
125127

126128
# Allow to read `/sys/fs/cgroup/unified/system.slice/filebeat.service/cgroup.controllers`
129+
require { type cgroup_t; }
127130
fs_read_cgroup_files(filebeat_t)
128131
allow filebeat_t cgroup_t:dir read;
129132

ic-os/components/selinux/ic-node/ic-node.te

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ allow ic_canister_sandbox_t ic_canister_mem_t : file { map read write getattr };
322322
allow ic_replica_t ic_canister_mem_t : file { map read write getattr };
323323

324324
# Wants to read its own control group. Should deny that.
325+
require { type cgroup_t; }
325326
dontaudit ic_canister_sandbox_t cgroup_t : dir { search };
326327
dontaudit ic_canister_sandbox_t cgroup_t : file { open read getattr };
327328

ic-os/components/selinux/manageboot/manageboot.te

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ application_domain(ic_manageboot_t, ic_manageboot_exec_t)
2222
# write upgrades into partition). Allow entering sudo, and return
2323
# to the original domain when sudo re-executes the script (so
2424
# it is now running same domain, but with root privileges).
25-
sudo_role_template(ic_manageboot, system_r, ic_manageboot_t)
25+
sudo_role_template(ic_manageboot, ic_manageboot_t, ic_manageboot_exec_t, system_r)
2626
domtrans_pattern(ic_manageboot_sudo_t, ic_manageboot_exec_t, ic_manageboot_t)
2727
# Under certain circumstances, sudo signals its children.
2828
allow ic_manageboot_sudo_t ic_manageboot_t : process { signal };
@@ -123,7 +123,7 @@ allow ic_manageboot_t ic_manageboot_t : unix_stream_socket { connect create geta
123123
# Allow searching runtime process directories (/var/run which is symlinked to /run).
124124
# It is not perfectly clear what/why it is doing that, but it is harmless
125125
# enough. May to to forbid it and see if it still works.
126-
files_search_pids(ic_manageboot_t)
126+
files_search_runtime(ic_manageboot_t)
127127

128128
# Allow reading /opt/ic/share/version.txt
129-
read_files_pattern(ic_manageboot_t, usr_t, usr_t)
129+
read_files_pattern(ic_manageboot_t, usr_t, usr_t)

ic-os/components/selinux/misc-fixes/misc-fixes.te

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@ permissive unconfined_t;
1515
require { type lvm_t; }
1616

1717
# Note that "cryptsetup" is also running as lvm_t.
18+
require { type initrc_t, initrc_runtime_t; }
19+
allow lvm_t initrc_t : sem rw_sem_perms;
1820

1921
# cryptsetup needs to create /run/cryptsetup: This is its lockfile directory to
2022
# track which devices, which is the lockfile directory tracking devices on
2123
# which operations are in progress
22-
require { type var_run_t; }
24+
require { type var_run_t, initrc_runtime_t; }
2325
create_dirs_pattern(lvm_t, var_run_t, var_run_t)
26+
manage_dirs_pattern(lvm_t, initrc_runtime_t, initrc_runtime_t)
27+
manage_files_pattern(lvm_t, initrc_runtime_t, initrc_runtime_t)
2428

2529
# lvm cryptsetup needs to manage its own cryptographic keys
2630
allow lvm_t lvm_t : key manage_key_perms;

0 commit comments

Comments
 (0)