## Policy for managing user accounts.
########################################
##
## Execute chfn in the chfn domain.
##
##
##
## Domain allowed access.
##
##
#
interface(`usermanage_domtrans_chfn',`
gen_require(`
type chfn_t, chfn_exec_t;
')
files_search_usr($1)
corecmd_search_bin($1)
domtrans_pattern($1, chfn_exec_t, chfn_t)
ifdef(`hide_broken_symptoms',`
dontaudit chfn_t $1:socket_class_set { read write };
')
')
########################################
##
## Execute chfn in the chfn domain, and
## allow the specified role the chfn domain.
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
#
interface(`usermanage_run_chfn',`
gen_require(`
type chfn_t;
')
usermanage_domtrans_chfn($1)
role $2 types chfn_t;
')
########################################
##
## Execute groupadd in the groupadd domain.
##
##
##
## Domain allowed access.
##
##
#
interface(`usermanage_domtrans_groupadd',`
gen_require(`
type groupadd_t, groupadd_exec_t;
')
files_search_usr($1)
corecmd_search_bin($1)
domtrans_pattern($1, groupadd_exec_t, groupadd_t)
ifdef(`hide_broken_symptoms',`
dontaudit groupadd_t $1:socket_class_set { read write };
')
')
########################################
##
## Execute groupadd in the groupadd domain, and
## allow the specified role the groupadd domain.
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`usermanage_run_groupadd',`
gen_require(`
type groupadd_t;
')
usermanage_domtrans_groupadd($1)
role $2 types groupadd_t;
optional_policy(`
nscd_run(groupadd_t, $2)
')
')
########################################
##
## Execute passwd in the passwd domain.
##
##
##
## Domain allowed access.
##
##
#
interface(`usermanage_domtrans_passwd',`
gen_require(`
type passwd_t, passwd_exec_t;
')
files_search_usr($1)
corecmd_search_bin($1)
domtrans_pattern($1, passwd_exec_t, passwd_t)
ifdef(`hide_broken_symptoms',`
dontaudit passwd_t $1:socket_class_set { read write };
')
')
########################################
##
## Send sigkills to passwd.
##
##
##
## Domain allowed access.
##
##
#
interface(`usermanage_kill_passwd',`
gen_require(`
type passwd_t;
')
allow $1 passwd_t:process sigkill;
')
########################################
##
## Execute passwd in the passwd domain, and
## allow the specified role the passwd domain.
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
#
interface(`usermanage_run_passwd',`
gen_require(`
type passwd_t;
')
usermanage_domtrans_passwd($1)
role $2 types passwd_t;
auth_run_chk_passwd(passwd_t, $2)
')
########################################
##
## Execute password admin functions in
## the admin passwd domain.
##
##
##
## Domain allowed access.
##
##
#
interface(`usermanage_domtrans_admin_passwd',`
gen_require(`
type sysadm_passwd_t, admin_passwd_exec_t;
')
files_search_usr($1)
corecmd_search_bin($1)
domtrans_pattern($1, admin_passwd_exec_t, sysadm_passwd_t)
')
########################################
##
## Execute passwd admin functions in the admin
## passwd domain, and allow the specified role
## the admin passwd domain.
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`usermanage_run_admin_passwd',`
gen_require(`
type sysadm_passwd_t;
')
usermanage_domtrans_admin_passwd($1)
role $2 types sysadm_passwd_t;
optional_policy(`
nscd_run(sysadm_passwd_t, $2)
')
')
########################################
##
## Do not audit attempts to use useradd fds.
##
##
##
## Domain to not audit.
##
##
#
interface(`usermanage_dontaudit_use_useradd_fds',`
gen_require(`
type useradd_t;
')
dontaudit $1 useradd_t:fd use;
')
########################################
##
## Execute useradd in the useradd domain.
##
##
##
## Domain allowed access.
##
##
#
interface(`usermanage_domtrans_useradd',`
gen_require(`
type useradd_t, useradd_exec_t;
')
files_search_usr($1)
corecmd_search_bin($1)
domtrans_pattern($1, useradd_exec_t, useradd_t)
ifdef(`hide_broken_symptoms',`
dontaudit useradd_t $1:socket_class_set { read write };
')
')
########################################
##
## Execute useradd in the useradd domain, and
## allow the specified role the useradd domain.
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`usermanage_run_useradd',`
gen_require(`
type useradd_t;
')
usermanage_domtrans_useradd($1)
role $2 types useradd_t;
seutil_run_semanage(useradd_t, $2)
optional_policy(`
nscd_run(useradd_t, $2)
')
')
########################################
##
## Read the crack database.
##
##
##
## Domain allowed access.
##
##
#
interface(`usermanage_read_crack_db',`
gen_require(`
type crack_db_t;
')
read_files_pattern($1, crack_db_t, crack_db_t)
')