##
## Allow TEMPLATETYPE to manage files in the user home directory
##
##
gen_tunable(TEMPLATETYPE_manage_user_files, false)
########################################
#
# Declarations
#
userdom_base_user_template(TEMPLATETYPE)
"""
te_login_user_rules="""\
"""
te_existing_user_rules="""\
########################################
#
# TEMPLATETYPE customized policy
#
"""
te_x_login_user_rules="""\
"""
te_root_user_rules="""\
"""
te_transition_rules="""
optional_policy(`
APPLICATION_role(TEMPLATETYPE_r, TEMPLATETYPE_t)
')
"""
te_user_trans_rules="""
optional_policy(`
gen_require(`
role USER_r;
')
TEMPLATETYPE_role_change(USER_r)
')
"""
te_admin_rules="""
allow TEMPLATETYPE_t self:capability { dac_override dac_read_search kill sys_ptrace sys_nice };
files_dontaudit_search_all_dirs(TEMPLATETYPE_t)
selinux_get_enforce_mode(TEMPLATETYPE_t)
seutil_domtrans_setfiles(TEMPLATETYPE_t)
seutil_search_default_contexts(TEMPLATETYPE_t)
logging_send_syslog_msg(TEMPLATETYPE_t)
kernel_read_system_state(TEMPLATETYPE_t)
domain_dontaudit_search_all_domains_state(TEMPLATETYPE_t)
domain_dontaudit_ptrace_all_domains(TEMPLATETYPE_t)
userdom_dontaudit_search_admin_dir(TEMPLATETYPE_t)
userdom_dontaudit_search_user_home_dirs(TEMPLATETYPE_t)
tunable_policy(`TEMPLATETYPE_read_user_files',`
userdom_read_user_home_content_files(TEMPLATETYPE_t)
userdom_read_user_tmp_files(TEMPLATETYPE_t)
')
tunable_policy(`TEMPLATETYPE_manage_user_files',`
userdom_manage_user_home_content_dirs(TEMPLATETYPE_t)
userdom_manage_user_home_content_files(TEMPLATETYPE_t)
userdom_manage_user_home_content_symlinks(TEMPLATETYPE_t)
userdom_manage_user_tmp_files(TEMPLATETYPE_t)
')
"""
te_admin_trans_rules="""
gen_require(`
role USER_r;
')
allow USER_r TEMPLATETYPE_r;
"""
te_admin_domain_rules="""
optional_policy(`
APPLICATION_admin(TEMPLATETYPE_t, TEMPLATETYPE_r)
')
"""
te_roles_rules="""
optional_policy(`
gen_require(`
role ROLE_r;
')
allow TEMPLATETYPE_r ROLE_r;
')
"""
te_sudo_rules="""
optional_policy(`
sudo_role_template(TEMPLATETYPE, TEMPLATETYPE_r, TEMPLATETYPE_t)
')
"""
te_newrole_rules="""
seutil_run_newrole(TEMPLATETYPE_t, TEMPLATETYPE_r)
"""