shutdown: add tunable to control user exec domain access
Signed-off-by: Kenton Groombridge <me@concord.sh>
This commit is contained in:
parent
580248ee48
commit
d260220709
@ -28,13 +28,23 @@
|
|||||||
#
|
#
|
||||||
template(`shutdown_role',`
|
template(`shutdown_role',`
|
||||||
gen_require(`
|
gen_require(`
|
||||||
|
attribute_role shutdown_roles;
|
||||||
type shutdown_t;
|
type shutdown_t;
|
||||||
')
|
')
|
||||||
|
|
||||||
shutdown_run($3, $4)
|
roleattribute $4 shutdown_roles;
|
||||||
|
|
||||||
allow $3 shutdown_t:process { ptrace signal_perms };
|
tunable_policy(`shutdown_allow_user_exec_domains',`
|
||||||
ps_process_pattern($3, shutdown_t)
|
shutdown_domtrans($3)
|
||||||
|
|
||||||
|
allow $3 shutdown_t:process { ptrace signal_perms };
|
||||||
|
ps_process_pattern($3, shutdown_t)
|
||||||
|
',`
|
||||||
|
shutdown_domtrans($2)
|
||||||
|
|
||||||
|
allow $2 shutdown_t:process { ptrace signal_perms };
|
||||||
|
ps_process_pattern($2, shutdown_t)
|
||||||
|
')
|
||||||
|
|
||||||
optional_policy(`
|
optional_policy(`
|
||||||
systemd_user_app_status($1, shutdown_t)
|
systemd_user_app_status($1, shutdown_t)
|
||||||
|
@ -1,5 +1,15 @@
|
|||||||
policy_module(shutdown, 1.7.0)
|
policy_module(shutdown, 1.7.0)
|
||||||
|
|
||||||
|
## <desc>
|
||||||
|
## <p>
|
||||||
|
## Determine whether the user application exec
|
||||||
|
## domain attribute should be respected for
|
||||||
|
## shutdown access. If not enabled, only user
|
||||||
|
## domains themselves may use shutdown.
|
||||||
|
## </p>
|
||||||
|
## </desc>
|
||||||
|
gen_tunable(shutdown_allow_user_exec_domains, false)
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
#
|
#
|
||||||
# Declarations
|
# Declarations
|
||||||
|
Loading…
Reference in New Issue
Block a user