Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for the 20240507 build #2111

Merged
merged 14 commits into from
May 7, 2024
Merged
7 changes: 7 additions & 0 deletions policy/modules.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3113,3 +3113,10 @@ nvme_stas = module
# coreos_installer
#
coreos_installer = module

# Layer: contrib
# Module: bootupd
#
# bootupd - bootloader update daemon
#
bootupd = module
16 changes: 14 additions & 2 deletions policy/modules/contrib/afterburn.te
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ init_daemon_domain(afterburn_t, afterburn_exec_t)
type afterburn_unit_file_t;
systemd_unit_file(afterburn_unit_file_t)

permissive afterburn_t;

########################################
#
# afterburn local policy
#
allow afterburn_t self:capability { setgid setuid sys_admin };
allow afterburn_t self:process { fork setpgid };
allow afterburn_t self:fifo_file rw_fifo_file_perms;
allow afterburn_t self:unix_dgram_socket create_socket_perms;

kernel_dgram_send(afterburn_t)
kernel_read_all_proc(afterburn_t)

corenet_tcp_connect_http_port(afterburn_t)
Expand All @@ -34,10 +34,22 @@ optional_policy(`
auth_use_nsswitch(afterburn_t)
')

optional_policy(`
logging_write_syslog_pid_socket(afterburn_t)
')

optional_policy(`
miscfiles_read_localization(afterburn_t)
')

optional_policy(`
networkmanager_dbus_chat(afterburn_t)
')

optional_policy(`
ssh_filetrans_home_content(afterburn_t)
')

optional_policy(`
sysnet_dns_name_resolve(afterburn_t)
')
7 changes: 7 additions & 0 deletions policy/modules/contrib/bootupd.fc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/usr/bin/bootupctl -- gen_context(system_u:object_r:bootupd_exec_t,s0)
/usr/libexec/bootupd -- gen_context(system_u:object_r:bootupd_exec_t,s0)

/usr/lib/systemd/system/bootupd\.service -- gen_context(system_u:object_r:bootupd_unit_file_t,s0)
/usr/lib/systemd/system/bootupd\.socket -- gen_context(system_u:object_r:bootupd_unit_file_t,s0)

/var/run/bootupd\.sock -s gen_context(system_u:object_r:bootupd_var_run_t,s0)
39 changes: 39 additions & 0 deletions policy/modules/contrib/bootupd.if
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## <summary>policy for bootupd</summary>

########################################
## <summary>
## Execute bootupd_exec_t in the bootupd domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`bootupd_domtrans',`
gen_require(`
type bootupd_t, bootupd_exec_t;
')

corecmd_search_bin($1)
domtrans_pattern($1, bootupd_exec_t, bootupd_t)
')

######################################
## <summary>
## Execute bootupd in the caller domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`bootupd_exec',`
gen_require(`
type bootupd_exec_t;
')

corecmd_search_bin($1)
can_exec($1, bootupd_exec_t)
')
41 changes: 41 additions & 0 deletions policy/modules/contrib/bootupd.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
policy_module(bootupd, 1.0.0)

########################################
#
# Declarations
#

type bootupd_t;
type bootupd_exec_t;
init_daemon_domain(bootupd_t, bootupd_exec_t)

type bootupd_unit_file_t;
systemd_unit_file(bootupd_unit_file_t)

type bootupd_var_run_t;
files_pid_file(bootupd_var_run_t)

permissive bootupd_t;

########################################
#
# bootupd local policy
#
allow bootupd_t self:capability { setgid setuid };
allow bootupd_t self:process { fork setpgid };
allow bootupd_t self:fifo_file rw_fifo_file_perms;
allow bootupd_t self:unix_dgram_socket create_socket_perms;
allow bootupd_t self:unix_stream_socket create_stream_socket_perms;

kernel_dgram_send(bootupd_t)

domain_use_interactive_fds(bootupd_t)

files_read_etc_files(bootupd_t)

fs_getattr_all_fs(bootupd_t)
fs_search_dos(bootupd_t)

optional_policy(`
miscfiles_read_localization(bootupd_t)
')
2 changes: 0 additions & 2 deletions policy/modules/contrib/coreos_installer.te
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ init_daemon_domain(coreos_installer_t, coreos_installer_exec_t)
type coreos_installer_unit_file_t;
systemd_unit_file(coreos_installer_unit_file_t)

permissive coreos_installer_t;

########################################
#
# coreos_installer local policy
Expand Down
36 changes: 36 additions & 0 deletions policy/modules/contrib/cron.if
Original file line number Diff line number Diff line change
Expand Up @@ -1079,3 +1079,39 @@ interface(`cron_system_spool_entrypoint',`
')
allow $1 system_cron_spool_t:file entrypoint;
')

########################################
## <summary>
## Execute crontab in the crontab domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`crontab_domtrans',`
gen_require(`
type crontab_exec_t, crontab_t;
')

domtrans_pattern($1, crontab_exec_t, crontab_t)
')

########################################
## <summary>
## Execute crontab in the admin crontab domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`crontab_admin_domtrans',`
gen_require(`
type crontab_exec_t, admin_crontab_t;
')

domtrans_pattern($1, crontab_exec_t, admin_crontab_t)
')
2 changes: 0 additions & 2 deletions policy/modules/contrib/mptcpd.te
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ init_nnp_daemon_domain(mptcpd_t)
type mptcpd_etc_t;
files_config_file(mptcpd_etc_t)

permissive mptcpd_t;

########################################
#
# mptcpd local policy
Expand Down
1 change: 1 addition & 0 deletions policy/modules/contrib/numad.te
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ files_pid_file(numad_var_run_t)
#

allow numad_t self:capability { ipc_owner kill sys_nice sys_ptrace } ;
allow numad_t self:cap_userns sys_ptrace;
allow numad_t self:fifo_file rw_fifo_file_perms;
allow numad_t self:msgq create_msgq_perms;
allow numad_t self:msg { send receive };
Expand Down
2 changes: 0 additions & 2 deletions policy/modules/contrib/rshim.te
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ init_daemon_domain(rshim_t, rshim_exec_t)
type rshim_unit_file_t;
systemd_unit_file(rshim_unit_file_t)

permissive rshim_t;

########################################
#
# rshim local policy
Expand Down
1 change: 1 addition & 0 deletions policy/modules/contrib/virt.te
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ allow svirt_t self:netlink_route_socket r_netlink_socket_perms;
allow svirt_t virtlogd_t:unix_stream_socket connectto;

kernel_request_load_module(svirt_t)
kernel_read_vm_sysctls(svirt_t)

corenet_udp_sendrecv_generic_if(svirt_t)
corenet_udp_sendrecv_generic_node(svirt_t)
Expand Down
1 change: 1 addition & 0 deletions policy/modules/kernel/storage.fc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
/dev/megaraid_sas_ioctl_node -c gen_context(system_u:object_r:fixed_disk_device_t,mls_systemhigh)
/dev/megadev.* -c gen_context(system_u:object_r:fixed_disk_device_t,mls_systemhigh)
/dev/mmcblk.* -b gen_context(system_u:object_r:removable_device_t,s0)
/dev/mmcblk[0-9]+rpmb -c gen_context(system_u:object_r:removable_device_t,s0)
/dev/mspblk.* -b gen_context(system_u:object_r:removable_device_t,s0)
/dev/mtd.* -b gen_context(system_u:object_r:fixed_disk_device_t,mls_systemhigh)
/dev/mtd.* -c gen_context(system_u:object_r:fixed_disk_device_t,mls_systemhigh)
Expand Down
3 changes: 3 additions & 0 deletions policy/modules/roles/staff.te
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ optional_policy(`

optional_policy(`
sudo_role_template(staff, staff_r, staff_t)
optional_policy(`
crontab_domtrans(staff_sudo_t)
')
')

optional_policy(`
Expand Down
3 changes: 3 additions & 0 deletions policy/modules/roles/sysadm.te
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,9 @@ optional_policy(`

optional_policy(`
sudo_role_template(sysadm, sysadm_r, sysadm_t)
optional_policy(`
crontab_admin_domtrans(sysadm_sudo_t)
')
')

optional_policy(`
Expand Down
Loading