2005-05-16 21:10:33 +00:00
|
|
|
|
|
|
|
policy_module(userdomain,1.0)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
# admin users terminals (tty and pty)
|
|
|
|
attribute admin_terminal;
|
|
|
|
|
|
|
|
# users home directory
|
|
|
|
attribute home_dir_type;
|
|
|
|
|
|
|
|
# users home directory contents
|
|
|
|
attribute home_type;
|
|
|
|
|
2005-05-16 21:10:33 +00:00
|
|
|
# The privhome attribute identifies every domain that can create files under
|
|
|
|
# regular user home directories in the regular context (IE act on behalf of
|
|
|
|
# a user in writing regular files)
|
|
|
|
attribute privhome;
|
|
|
|
|
2005-06-27 16:30:55 +00:00
|
|
|
# all unprivileged users tmp files
|
|
|
|
attribute user_tmpfile;
|
|
|
|
|
2005-05-16 21:10:33 +00:00
|
|
|
# all user domains
|
|
|
|
attribute userdomain;
|
|
|
|
|
|
|
|
# unprivileged user domains
|
|
|
|
attribute unpriv_userdomain;
|
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
admin_user_template(sysadm)
|
|
|
|
unpriv_user_template(staff)
|
|
|
|
unpriv_user_template(user)
|
2005-05-16 21:10:33 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
2005-05-18 13:20:16 +00:00
|
|
|
|
2005-05-27 21:56:01 +00:00
|
|
|
# user role change rules:
|
|
|
|
define(`role_change',`
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1_r $2_r;
|
|
|
|
type_change $2_t $1_devpts_t:chr_file $2_devpts_t;
|
|
|
|
type_change $2_t $1_tty_device_t:chr_file $2_tty_device_t;
|
|
|
|
# avoid annoying messages on terminal hangup
|
|
|
|
dontaudit $1_t { $2_devpts_t $2_tty_device_t }:chr_file ioctl;
|
2005-05-27 21:56:01 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
# sysadm_r can change to user roles
|
|
|
|
role_change(sysadm, user)
|
|
|
|
role_change(sysadm, staff)
|
|
|
|
|
|
|
|
# only staff_r can change to sysadm_r
|
|
|
|
role_change(staff, sysadm)
|
|
|
|
|
2005-06-07 18:45:47 +00:00
|
|
|
# this should be tunable_policy, but
|
|
|
|
# currently type_change and RBAC allow
|
|
|
|
# do not work in conditionals
|
|
|
|
ifdef(`user_canbe_sysadm',`
|
2005-06-03 12:25:14 +00:00
|
|
|
role_change(user,sysadm)
|
2005-05-27 21:56:01 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
ifdef(`TODO',`
|
|
|
|
allow privhome home_root_t:dir { getattr search };
|
2005-05-18 13:20:16 +00:00
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
# Add/remove user home directories
|
2005-05-27 21:56:01 +00:00
|
|
|
file_type_auto_trans(sysadm_t, home_root_t, user_home_dir_t, dir)
|
|
|
|
')
|
2005-05-19 21:06:06 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Sysadm local policy
|
|
|
|
#
|
|
|
|
|
2005-05-18 13:20:16 +00:00
|
|
|
# for su
|
|
|
|
allow sysadm_t userdomain:fd use;
|
|
|
|
|
2005-05-24 15:55:57 +00:00
|
|
|
optional_policy(`bootloader.te',`
|
2005-06-10 01:01:13 +00:00
|
|
|
bootloader_run(sysadm_t,sysadm_r,admin_terminal)
|
2005-05-24 15:55:57 +00:00
|
|
|
')
|
|
|
|
|
2005-05-27 21:56:01 +00:00
|
|
|
optional_policy(`clock.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
clock_run(sysadm_t,sysadm_r,admin_terminal)
|
2005-05-27 21:56:01 +00:00
|
|
|
')
|
|
|
|
|
2005-06-27 20:59:28 +00:00
|
|
|
optional_policy(`fstools.te',`
|
|
|
|
fstools_run(sysadm_t,sysadm_r,admin_terminal)
|
|
|
|
')
|
|
|
|
|
2005-05-27 21:56:01 +00:00
|
|
|
optional_policy(`hostname.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
hostname_run(sysadm_t,sysadm_r,admin_terminal)
|
2005-05-27 21:56:01 +00:00
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
optional_policy(`iptables.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
iptables_run(sysadm_t,sysadm_r,admin_terminal)
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-05-23 15:51:33 +00:00
|
|
|
optional_policy(`libraries.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_run_ldconfig(sysadm_t,sysadm_r,admin_terminal)
|
2005-05-23 15:51:33 +00:00
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
optional_policy(`lvm.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
lvm_run(sysadm_t,sysadm_r,admin_terminal)
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`modutils.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
modutils_run_depmod(sysadm_t,sysadm_r,admin_terminal)
|
|
|
|
modutils_run_insmod(sysadm_t,sysadm_r,admin_terminal)
|
|
|
|
modutils_run_update_mods(sysadm_t,sysadm_r,admin_terminal)
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-06-28 20:54:49 +00:00
|
|
|
optional_policy(`logrotate.te',`
|
|
|
|
logrotate_run(sysadm_t,sysadm_r,admin_terminal)
|
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
optional_policy(`mount.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
mount_run(sysadm_t,sysadm_r,admin_terminal)
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-06-27 16:30:55 +00:00
|
|
|
optional_policy(`netutils.te',`
|
|
|
|
netutils_run(sysadm_t,sysadm_r,admin_terminal)
|
|
|
|
netutils_run_ping(sysadm_t,sysadm_r,admin_terminal)
|
|
|
|
netutils_run_traceroute(sysadm_t,sysadm_r,admin_terminal)
|
|
|
|
')
|
|
|
|
|
2005-05-23 15:51:33 +00:00
|
|
|
optional_policy(`rpm.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
rpm_run(sysadm_t,sysadm_r,admin_terminal)
|
2005-05-23 15:51:33 +00:00
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
optional_policy(`selinux.te',`
|
2005-06-14 20:48:34 +00:00
|
|
|
seutil_run_checkpol(sysadm_t,sysadm_r,admin_terminal)
|
|
|
|
seutil_run_loadpol(sysadm_t,sysadm_r,admin_terminal)
|
|
|
|
seutil_run_restorecon(sysadm_t,sysadm_r,admin_terminal)
|
|
|
|
seutil_run_setfiles(sysadm_t,sysadm_r,admin_terminal)
|
2005-06-03 12:25:14 +00:00
|
|
|
optional_policy(`targeted_policy',`',`
|
2005-06-14 20:48:34 +00:00
|
|
|
seutil_run_runinit(sysadm_t,sysadm_r,admin_terminal)
|
2005-06-03 12:25:14 +00:00
|
|
|
')
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`sysnetwork.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
sysnet_run_ifconfig(sysadm_t,sysadm_r,admin_terminal)
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-05-27 21:56:01 +00:00
|
|
|
optional_policy(`usermanage.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
usermanage_run_groupadd(sysadm_t,sysadm_r,admin_terminal)
|
|
|
|
usermanage_run_useradd(sysadm_t,sysadm_r,admin_terminal)
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|