chromium, roles: use user exec domain attribute

Signed-off-by: Kenton Groombridge <me@concord.sh>
This commit is contained in:
Kenton Groombridge 2021-08-08 11:37:02 -04:00
parent 99c2c94507
commit 4d7eb76fb9
4 changed files with 42 additions and 27 deletions

View File

@ -4,18 +4,29 @@
## <summary>
## Role access for chromium
## </summary>
## <param name="role_prefix">
## <summary>
## The prefix of the user role (e.g., user
## is the prefix for user_r).
## </summary>
## </param>
## <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>
## <param name="domain">
## <summary>
## User domain for the role
## </summary>
## </param>
#
interface(`chromium_role',`
template(`chromium_role',`
gen_require(`
type chromium_t;
type chromium_renderer_t;
@ -24,34 +35,38 @@ interface(`chromium_role',`
class dbus send_msg;
')
role $1 types chromium_t;
role $1 types chromium_renderer_t;
role $1 types chromium_sandbox_t;
role $1 types chromium_naclhelper_t;
role $4 types chromium_t;
role $4 types chromium_renderer_t;
role $4 types chromium_sandbox_t;
role $4 types chromium_naclhelper_t;
# Transition from the user domain to the derived domain
chromium_domtrans($2)
chromium_domtrans($3)
# Allow ps to show chromium processes and allow the user to signal it
ps_process_pattern($2, chromium_t)
ps_process_pattern($2, chromium_renderer_t)
ps_process_pattern($3, chromium_t)
ps_process_pattern($3, chromium_renderer_t)
allow $2 chromium_t:process signal_perms;
allow $2 chromium_renderer_t:process signal_perms;
allow $2 chromium_sandbox_t:process signal_perms;
allow $2 chromium_naclhelper_t:process signal_perms;
allow chromium_t $2:process { signull signal };
allow $3 chromium_t:process signal_perms;
allow $3 chromium_renderer_t:process signal_perms;
allow $3 chromium_sandbox_t:process signal_perms;
allow $3 chromium_naclhelper_t:process signal_perms;
allow chromium_t $3:process { signull signal };
allow $2 chromium_t:unix_stream_socket connectto;
allow $3 chromium_t:unix_stream_socket connectto;
# for /tmp/.ICE-unix/* sockets
allow chromium_t $2:unix_stream_socket connectto;
allow chromium_t $3:unix_stream_socket connectto;
allow chromium_sandbox_t $2:fd use;
allow chromium_naclhelper_t $2:fd use;
allow chromium_sandbox_t $3:fd use;
allow chromium_naclhelper_t $3:fd use;
allow $2 chromium_t:dbus send_msg;
allow chromium_t $2:dbus send_msg;
allow $3 chromium_t:dbus send_msg;
allow chromium_t $3:dbus send_msg;
optional_policy(`
systemd_user_app_status($1, chromium_t)
')
')
#######################################

View File

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

View File

@ -1218,7 +1218,7 @@ ifndef(`distro_redhat',`
')
optional_policy(`
chromium_role(sysadm_r, sysadm_t)
chromium_role(sysadm, sysadm_t, sysadm_application_exec_domain, sysadm_r)
')
optional_policy(`

View File

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