uml, roles: use user exec domain attribute

Signed-off-by: Kenton Groombridge <me@concord.sh>
This commit is contained in:
Kenton Groombridge 2021-08-08 12:39:42 -04:00
parent 787cb62e75
commit 32acf9ccac
4 changed files with 28 additions and 13 deletions

View File

@ -4,18 +4,29 @@
## <summary>
## Role access for uml.
## </summary>
## <param name="role">
## <param name="role_prefix">
## <summary>
## Role allowed access.
## The prefix of the user role (e.g., user
## is the prefix for user_r).
## </summary>
## </param>
## <param name="domain">
## <param name="user_domain">
## <summary>
## User domain for the role.
## </summary>
## </param>
## <param name="user_exec_domain">
## <summary>
## User exec domain for execute and transition access.
## </summary>
## </param>
## <param name="role">
## <summary>
## Role allowed access
## </summary>
## </param>
#
interface(`uml_role',`
template(`uml_role',`
gen_require(`
attribute_role uml_roles;
type uml_t, uml_exec_t;
@ -23,16 +34,16 @@ interface(`uml_role',`
type uml_tmpfs_t;
')
roleattribute $1 uml_roles;
roleattribute $4 uml_roles;
domtrans_pattern($2, uml_exec_t, uml_t)
domtrans_pattern($3, uml_exec_t, uml_t)
dgram_send_pattern($2, uml_tmpfs_t, uml_tmpfs_t, uml_t)
dgram_send_pattern($3, uml_tmpfs_t, uml_tmpfs_t, uml_t)
allow uml_t $2:unix_dgram_socket sendto;
allow uml_t $3:unix_dgram_socket sendto;
ps_process_pattern($2, uml_t)
allow $2 uml_t:process { ptrace signal_perms };
ps_process_pattern($3, uml_t)
allow $3 uml_t:process { ptrace signal_perms };
allow $2 { uml_ro_t uml_rw_t uml_tmp_t uml_exec_t }:dir { manage_dir_perms relabel_dir_perms };
allow $2 { uml_ro_t uml_rw_t uml_tmp_t uml_tmpfs_t uml_exec_t }:file { manage_file_perms relabel_file_perms };
@ -40,6 +51,10 @@ interface(`uml_role',`
allow $2 { uml_ro_t uml_rw_t uml_tmpfs_t }:fifo_file { manage_fifo_file_perms relabel_fifo_file_perms };
allow $2 { uml_ro_t uml_rw_t uml_tmpfs_t }:sock_file { manage_sock_file_perms relabel_sock_file_perms };
userdom_user_home_dir_filetrans($2, uml_rw_t, dir, ".uml")
optional_policy(`
systemd_user_app_status($1, uml_t)
')
')
########################################

View File

@ -191,7 +191,7 @@ ifndef(`distro_redhat',`
')
optional_policy(`
uml_role(staff_r, staff_t)
uml_role(staff, staff_t, staff_application_exec_domain, staff_r)
')
optional_policy(`

View File

@ -1084,7 +1084,7 @@ optional_policy(`
')
optional_policy(`
uml_role(sysadm_r, sysadm_t)
uml_role(sysadm, sysadm_t, sysadm_application_exec_domain, sysadm_r)
')
optional_policy(`

View File

@ -175,7 +175,7 @@ ifndef(`distro_redhat',`
')
optional_policy(`
uml_role(user_r, user_t)
uml_role(user, user_t, user_application_exec_domain, user_r)
')
optional_policy(`