2010-07-07 13:31:57 +00:00
|
|
|
policy_module(sysadm, 2.1.1)
|
2008-04-29 13:58:34 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Allow sysadm to debug or ptrace all processes.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
2008-07-23 21:38:39 +00:00
|
|
|
gen_tunable(allow_ptrace, false)
|
2008-04-29 13:58:34 +00:00
|
|
|
|
|
|
|
role sysadm_r;
|
|
|
|
|
|
|
|
userdom_admin_user_template(sysadm)
|
|
|
|
|
|
|
|
ifndef(`enable_mls',`
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_security_admin_template(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
corecmd_exec_shell(sysadm_t)
|
|
|
|
|
|
|
|
mls_process_read_up(sysadm_t)
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
ubac_process_exempt(sysadm_t)
|
|
|
|
ubac_file_exempt(sysadm_t)
|
|
|
|
ubac_fd_exempt(sysadm_t)
|
|
|
|
|
2008-04-29 13:58:34 +00:00
|
|
|
init_exec(sysadm_t)
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
# Add/remove user home directories
|
|
|
|
userdom_manage_user_home_dirs(sysadm_t)
|
|
|
|
userdom_home_filetrans_user_home_dir(sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
|
|
|
|
ifdef(`direct_sysadm_daemon',`
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
init_run_daemon(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
',`
|
|
|
|
ifdef(`distro_gentoo',`
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
seutil_init_script_run_runinit(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
|
|
|
ifndef(`enable_mls',`
|
|
|
|
logging_manage_audit_log(sysadm_t)
|
|
|
|
logging_manage_audit_config(sysadm_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
logging_run_auditctl(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
tunable_policy(`allow_ptrace',`
|
|
|
|
domain_ptrace_all_domains(sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
amanda_run_recover(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
apache_run_helper(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
#apache_run_all_scripts(sysadm_t, sysadm_r)
|
|
|
|
#apache_domtrans_sys_script(sysadm_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
apache_role(sysadm_r, sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
# cjp: why is this not apm_run_client
|
|
|
|
apm_domtrans_client(sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
apt_run(sysadm_t, sysadm_r)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
auditadm_role_change(sysadm_r)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
backup_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
bind_run_ndc(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
bootloader_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
certwatch_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
clock_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
clockspeed_run_cli(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
consoletype_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
cvs_exec(sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
dcc_run_cdcc(sysadm_t, sysadm_r)
|
|
|
|
dcc_run_client(sysadm_t, sysadm_r)
|
|
|
|
dcc_run_dbclean(sysadm_t, sysadm_r)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
ddcprobe_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
dmesg_exec(sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
dmidecode_run(sysadm_t, sysadm_r)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
dpkg_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
firstboot_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
fstools_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
optional_policy(`
|
|
|
|
hostname_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
# allow system administrator to use the ipsec script to look
|
|
|
|
# at things (e.g., ipsec auto --status)
|
|
|
|
# probably should create an ipsec_admin role for this kind of thing
|
|
|
|
ipsec_exec_mgmt(sysadm_t)
|
|
|
|
ipsec_stream_connect(sysadm_t)
|
|
|
|
# for lsof
|
|
|
|
ipsec_getattr_key_sockets(sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
iptables_run(sysadm_t, sysadm_r)
|
|
|
|
')
|
|
|
|
|
2008-04-29 13:58:34 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
kudzu_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
libs_run_ldconfig(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
lockdev_role(sysadm_r, sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
logrotate_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
lpd_run_checkpc(sysadm_t, sysadm_r)
|
|
|
|
lpd_role(sysadm_r, sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
lvm_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
modutils_run_depmod(sysadm_t, sysadm_r)
|
|
|
|
modutils_run_insmod(sysadm_t, sysadm_r)
|
|
|
|
modutils_run_update_mods(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
mount_run(sysadm_t, sysadm_r)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
mozilla_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
mplayer_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
mta_role(sysadm_r, sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
munin_stream_connect(sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
mysql_stream_connect(sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
netutils_run(sysadm_t, sysadm_r)
|
|
|
|
netutils_run_ping(sysadm_t, sysadm_r)
|
|
|
|
netutils_run_traceroute(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
ntp_stub()
|
|
|
|
corenet_udp_bind_ntp_port(sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
oav_run_update(sysadm_t, sysadm_r)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
oident_manage_user_content(sysadm_t)
|
|
|
|
oident_relabel_user_content(sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
pcmcia_run_cardctl(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
portage_run(sysadm_t, sysadm_r)
|
|
|
|
portage_run_gcc_config(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
portmap_run_helper(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
pyzor_role(sysadm_r, sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
quota_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
raid_domtrans_mdadm(sysadm_t)
|
|
|
|
')
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
optional_policy(`
|
|
|
|
razor_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
2008-04-29 13:58:34 +00:00
|
|
|
optional_policy(`
|
|
|
|
rpc_domtrans_nfsd(sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
rpm_run(sysadm_t, sysadm_r)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
rssh_role(sysadm_r, sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
rsync_exec(sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
samba_run_net(sysadm_t, sysadm_r)
|
|
|
|
samba_run_winbind_helper(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
screen_role_template(sysadm, sysadm_r, sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
secadm_role_change(sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
seutil_run_setfiles(sysadm_t, sysadm_r)
|
|
|
|
seutil_run_runinit(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
spamassassin_role(sysadm_r, sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
ssh_role_template(sysadm, sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
staff_role_change(sysadm_r)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
su_role_template(sysadm, sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
sudo_role_template(sysadm, sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
sysnet_run_ifconfig(sysadm_t, sysadm_r)
|
|
|
|
sysnet_run_dhcpc(sysadm_t, sysadm_r)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
thunderbird_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
tripwire_run_siggen(sysadm_t, sysadm_r)
|
|
|
|
tripwire_run_tripwire(sysadm_t, sysadm_r)
|
|
|
|
tripwire_run_twadmin(sysadm_t, sysadm_r)
|
|
|
|
tripwire_run_twprint(sysadm_t, sysadm_r)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
tvtime_role(sysadm_r, sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
tzdata_domtrans(sysadm_t)
|
|
|
|
')
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
optional_policy(`
|
|
|
|
uml_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
2008-04-29 13:58:34 +00:00
|
|
|
optional_policy(`
|
2008-05-22 15:24:52 +00:00
|
|
|
unconfined_domtrans(sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
unprivuser_role_change(sysadm_r)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
usbmodules_run(sysadm_t, sysadm_r)
|
|
|
|
')
|
2008-04-29 13:58:34 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
optional_policy(`
|
|
|
|
userhelper_role_template(sysadm, sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
usermanage_run_admin_passwd(sysadm_t, sysadm_r)
|
|
|
|
usermanage_run_groupadd(sysadm_t, sysadm_r)
|
|
|
|
usermanage_run_useradd(sysadm_t, sysadm_r)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
vmware_role(sysadm_r, sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
vpn_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
webalizer_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
wireshark_role(sysadm_r, sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
xserver_role(sysadm_r, sysadm_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
yam_run(sysadm_t, sysadm_r)
|
2008-04-29 13:58:34 +00:00
|
|
|
')
|
2010-07-21 14:39:57 +00:00
|
|
|
|
|
|
|
ifndef(`distro_redhat',`
|
|
|
|
optional_policy(`
|
|
|
|
auth_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
bluetooth_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
cdrecord_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
cron_admin_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
dbus_role_template(sysadm, sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
evolution_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
games_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
gift_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
gnome_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
gpg_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
irc_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
java_role(sysadm_r, sysadm_t)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|