Chris PeBenito 17de1b
Chris PeBenito 693d4a
policy_module(userdomain,1.3.35)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
gen_require(`
Chris PeBenito 17de1b
	role sysadm_r, staff_r, user_r;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	ifdef(`enable_mls',`
Chris PeBenito 17de1b
		role secadm_r;
Chris PeBenito 17de1b
		role auditadm_r;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# admin users terminals (tty and pty)
Chris PeBenito 17de1b
attribute admin_terminal;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# users home directory
Chris PeBenito 17de1b
attribute home_dir_type;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# users home directory contents
Chris PeBenito 17de1b
attribute home_type;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# The privhome attribute identifies every domain that can create files under
Chris PeBenito 17de1b
# regular user home directories in the regular context (IE act on behalf of
Chris PeBenito 17de1b
# a user in writing regular files)
Chris PeBenito 17de1b
attribute privhome;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# all unprivileged users home directories
Chris PeBenito 17de1b
attribute user_home_dir_type;
Chris PeBenito 17de1b
attribute user_home_type;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# all unprivileged users ptys
Chris PeBenito 17de1b
attribute user_ptynode;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# all unprivileged users tmp files
Chris PeBenito 17de1b
attribute user_tmpfile;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# all unprivileged users ttys
Chris PeBenito 17de1b
attribute user_ttynode;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# all user domains
Chris PeBenito 17de1b
attribute userdomain;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# unprivileged user domains
Chris PeBenito 17de1b
attribute unpriv_userdomain;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
attribute untrusted_content_type;
Chris PeBenito 17de1b
attribute untrusted_content_tmp_type;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito bbcd3c
ifdef(`strict_policy',`
Chris PeBenito bbcd3c
	userdom_admin_user_template(sysadm)
Chris PeBenito bbcd3c
	userdom_unpriv_user_template(staff)
Chris PeBenito bbcd3c
	userdom_unpriv_user_template(user)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# user role change rules:
Chris PeBenito 17de1b
	# sysadm_r can change to user roles
Chris PeBenito bbcd3c
	userdom_role_change_template(sysadm, user)
Chris PeBenito bbcd3c
	userdom_role_change_template(sysadm, staff)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# only staff_r can change to sysadm_r
Chris PeBenito bbcd3c
	userdom_role_change_template(staff, sysadm)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	ifdef(`enable_mls',`
Chris PeBenito bbcd3c
		userdom_unpriv_user_template(secadm)
Chris PeBenito bbcd3c
		userdom_unpriv_user_template(auditadm)
Chris PeBenito 17de1b
Chris PeBenito bbcd3c
		userdom_role_change_template(staff,auditadm)
Chris PeBenito bbcd3c
		userdom_role_change_template(staff,secadm)
Chris PeBenito 17de1b
Chris PeBenito bbcd3c
		userdom_role_change_template(sysadm,secadm)
Chris PeBenito bbcd3c
		userdom_role_change_template(sysadm,auditadm)
Chris PeBenito 17de1b
Chris PeBenito bbcd3c
		userdom_role_change_template(auditadm,secadm)
Chris PeBenito bbcd3c
		userdom_role_change_template(auditadm,sysadm)
Chris PeBenito 17de1b
Chris PeBenito bbcd3c
		userdom_role_change_template(secadm,auditadm)
Chris PeBenito bbcd3c
		userdom_role_change_template(secadm,sysadm)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# this should be tunable_policy, but
Chris PeBenito 17de1b
	# currently type_change and RBAC allow
Chris PeBenito 17de1b
	# do not work in conditionals
Chris PeBenito 17de1b
	ifdef(`user_canbe_sysadm',`
Chris PeBenito bbcd3c
		userdom_role_change_template(user,sysadm)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	########################################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# Sysadm local policy
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# for su
Chris PeBenito 17de1b
	allow sysadm_t userdomain:fd use;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Add/remove user home directories
Chris PeBenito 17de1b
	allow sysadm_t user_home_dir_t:dir create_dir_perms;
Chris PeBenito 17de1b
	files_home_filetrans(sysadm_t,user_home_dir_t,dir)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	corecmd_exec_shell(sysadm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	mls_process_read_up(sysadm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	init_exec(sysadm_t)
Chris PeBenito 17de1b
Chris PeBenito 693d4a
	# Following for sending reboot and wall messages
Chris PeBenito 693d4a
	userdom_use_unpriv_users_ptys(sysadm_t)
Chris PeBenito 693d4a
	userdom_use_unpriv_users_ttys(sysadm_t)
Chris PeBenito 693d4a
Chris PeBenito 17de1b
	ifdef(`direct_sysadm_daemon',`
Chris PeBenito 17de1b
		optional_policy(`
Chris PeBenito 17de1b
			init_run_daemon(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		')
Chris PeBenito 17de1b
	',`
Chris PeBenito 17de1b
		ifdef(`distro_gentoo',`
Chris PeBenito 17de1b
			optional_policy(`
Chris PeBenito 17de1b
				seutil_init_script_run_runinit(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
			')
Chris PeBenito 17de1b
		')
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	ifdef(`enable_mls',`
Chris PeBenito 17de1b
		seutil_run_runinit(auditadm_t, auditadm_r, { auditadm_tty_device_t auditadm_devpts_t })
Chris PeBenito 17de1b
		domain_kill_all_domains(auditadm_t)
Chris PeBenito 17de1b
	        seutil_read_bin_policy(auditadm_t)
Chris PeBenito 17de1b
		corecmd_exec_shell(auditadm_t)
Chris PeBenito 693d4a
		logging_send_syslog_msg(auditadm_t)
Chris PeBenito 17de1b
	        logging_read_generic_logs(auditadm_t)
Chris PeBenito 17de1b
		logging_manage_audit_log(auditadm_t)
Chris PeBenito 17de1b
		logging_manage_audit_config(auditadm_t)
Chris PeBenito 17de1b
		logging_run_auditctl(auditadm_t,auditadm_r,{ auditadm_tty_device_t auditadm_devpts_t })
Chris PeBenito 17de1b
		logging_run_auditd(auditadm_t, auditadm_r, { auditadm_tty_device_t auditadm_devpts_t })
Chris PeBenito 693d4a
		userdom_dontaudit_read_sysadm_home_content_files(auditadm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
		allow secadm_t self:capability dac_override;
Chris PeBenito 17de1b
		corecmd_exec_shell(secadm_t)
Chris PeBenito 17de1b
		domain_obj_id_change_exemption(secadm_t)
Chris PeBenito 17de1b
		mls_process_read_up(secadm_t)
Chris PeBenito 17de1b
		mls_file_read_up(secadm_t)
Chris PeBenito 17de1b
		mls_file_write_down(secadm_t)
Chris PeBenito 17de1b
		mls_file_upgrade(secadm_t)
Chris PeBenito 17de1b
		mls_file_downgrade(secadm_t)
Chris PeBenito 17de1b
	        auth_relabel_all_files_except_shadow(secadm_t)
Chris PeBenito 17de1b
		auth_relabel_shadow(secadm_t)
Chris PeBenito 17de1b
		init_exec(secadm_t)
Chris PeBenito 17de1b
		logging_read_audit_log(secadm_t)
Chris PeBenito 17de1b
	        logging_read_generic_logs(secadm_t)
Chris PeBenito 17de1b
		userdom_dontaudit_append_staff_home_content_files(secadm_t)
Chris PeBenito 693d4a
		userdom_dontaudit_read_sysadm_home_content_files(secadm_t)
Chris PeBenito bbcd3c
	',`
Chris PeBenito 17de1b
		logging_manage_audit_log(sysadm_t)
Chris PeBenito 17de1b
		logging_manage_audit_config(sysadm_t)
Chris PeBenito 17de1b
		logging_run_auditctl(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	tunable_policy(`allow_ptrace',`
Chris PeBenito 17de1b
		domain_ptrace_all_domains(sysadm_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		amanda_run_recover(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		apache_run_helper(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		#apache_run_all_scripts(sysadm_t,sysadm_r)
Chris PeBenito 17de1b
		#apache_domtrans_sys_script(sysadm_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		# cjp: why is this not apm_run_client
Chris PeBenito 17de1b
		apm_domtrans_client(sysadm_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		apt_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		backup_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		bootloader_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		bind_run_ndc(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		bluetooth_run_helper(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		consoletype_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		clock_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		clockspeed_run_cli(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		certwatach_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		cvs_exec(sysadm_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		consoletype_exec(sysadm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
		ifdef(`enable_mls',`
Chris PeBenito 17de1b
			consoletype_exec(secadm_t)
Chris PeBenito 17de1b
			consoletype_exec(auditadm_t)
Chris PeBenito 17de1b
		')
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		dcc_run_cdcc(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		dcc_run_client(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		dcc_run_dbclean(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		ddcprobe_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		dmesg_exec(sysadm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
		ifdef(`enable_mls',`
Chris PeBenito 17de1b
			dmesg_exec(secadm_t)
Chris PeBenito 17de1b
			dmesg_exec(auditadm_t)
Chris PeBenito 17de1b
		')
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		dmidecode_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		dpkg_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		ethereal_run_tethereal(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		firstboot_run(sysadm_t,sysadm_r,sysadm_tty_device_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		fstools_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		hostname_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		# allow system administrator to use the ipsec script to look
Chris PeBenito 17de1b
		# at things (e.g., ipsec auto --status)
Chris PeBenito 17de1b
		# probably should create an ipsec_admin role for this kind of thing
Chris PeBenito 17de1b
		ipsec_exec_mgmt(sysadm_t)
Chris PeBenito 17de1b
		ipsec_stream_connect(sysadm_t)
Chris PeBenito 17de1b
		# for lsof
Chris PeBenito 17de1b
		ipsec_getattr_key_sockets(sysadm_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		iptables_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		libs_run_ldconfig(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		lvm_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		logrotate_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		lpd_run_checkpc(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		kudzu_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		modutils_run_depmod(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		modutils_run_insmod(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		modutils_run_update_mods(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		mount_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		mysql_stream_connect(sysadm_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		netutils_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		netutils_run_ping(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		netutils_run_traceroute(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		rpc_domtrans_nfsd(sysadm_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		munin_stream_connect(sysadm_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		ntp_stub()
Chris PeBenito 17de1b
		corenet_udp_bind_ntp_port(sysadm_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		oav_run_update(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		pcmcia_run_cardctl(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		portage_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		portage_run_gcc_config(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		portmap_run_helper(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		quota_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		rpm_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		rsync_exec(sysadm_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		samba_run_net(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		samba_run_winbind_helper(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		seutil_run_restorecon(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		seutil_run_runinit(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
		ifdef(`enable_mls',`
Chris PeBenito 17de1b
			selinux_set_enforce_mode(secadm_t)
Chris PeBenito 17de1b
			selinux_set_boolean(secadm_t)
Chris PeBenito 17de1b
			selinux_set_parameters(secadm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
			seutil_manage_bin_policy(secadm_t)
Chris PeBenito 693d4a
			seutil_run_checkpolicy(secadm_t,secadm_r,{ secadm_tty_device_t sysadm_devpts_t })
Chris PeBenito 693d4a
			seutil_run_loadpolicy(secadm_t,secadm_r,{ secadm_tty_device_t sysadm_devpts_t })
Chris PeBenito 693d4a
			seutil_run_semanage(secadm_t,secadm_r,{ secadm_tty_device_t sysadm_devpts_t })
Chris PeBenito 693d4a
			seutil_run_setfiles(secadm_t,secadm_r,{ secadm_tty_device_t sysadm_devpts_t })
Chris PeBenito 693d4a
			seutil_run_restorecon(secadm_t,secadm_r,{ secadm_tty_device_t sysadm_devpts_t })
Chris PeBenito 693d4a
			logging_send_syslog_msg(secadm_t)
Chris PeBenito 17de1b
		', `
Chris PeBenito 17de1b
			selinux_set_enforce_mode(sysadm_t)
Chris PeBenito 17de1b
			selinux_set_boolean(sysadm_t)
Chris PeBenito 17de1b
			selinux_set_parameters(sysadm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
			seutil_manage_bin_policy(sysadm_t)
Chris PeBenito 17de1b
			seutil_run_checkpolicy(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
			seutil_run_loadpolicy(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
			seutil_run_semanage(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
			seutil_run_setfiles(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		')
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		sysnet_run_ifconfig(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		sysnet_run_dhcpc(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		tripwire_run_siggen(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		tripwire_run_tripwire(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		tripwire_run_twadmin(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		tripwire_run_twprint(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		unconfined_domtrans(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		usbmodules_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		usermanage_run_admin_passwd(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		usermanage_run_groupadd(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
		usermanage_run_useradd(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		vpn_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		webalizer_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		yam_run(sysadm_t,sysadm_r,admin_terminal)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito bbcd3c
Chris PeBenito bbcd3c
ifdef(`targeted_policy',`
Chris PeBenito bbcd3c
	# Define some type aliases to help with compatibility with
Chris PeBenito bbcd3c
	# strict policy.
Chris PeBenito bbcd3c
	unconfined_alias_domain(secadm_t)
Chris PeBenito bbcd3c
	unconfined_alias_domain(auditadm_t)
Chris PeBenito bbcd3c
	unconfined_alias_domain(sysadm_t)
Chris PeBenito bbcd3c
Chris PeBenito bbcd3c
	# User home directory type.
Chris PeBenito bbcd3c
	type user_home_t alias { staff_home_t sysadm_home_t }, home_type, user_home_type;
Chris PeBenito bbcd3c
	files_type(user_home_t)
Chris PeBenito bbcd3c
	files_associate_tmp(user_home_t)
Chris PeBenito bbcd3c
	fs_associate_tmpfs(user_home_t)
Chris PeBenito bbcd3c
Chris PeBenito bbcd3c
	type user_home_dir_t alias { staff_home_dir_t sysadm_home_dir_t }, home_dir_type, home_type, user_home_dir_type;
Chris PeBenito bbcd3c
	files_type(user_home_dir_t)
Chris PeBenito bbcd3c
	files_associate_tmp(user_home_dir_t)
Chris PeBenito bbcd3c
	fs_associate_tmpfs(user_home_dir_t)
Chris PeBenito bbcd3c
Chris PeBenito bbcd3c
	# compatibility for switching from strict
Chris PeBenito bbcd3c
#	dominance { role secadm_r { role system_r; }}
Chris PeBenito bbcd3c
#	dominance { role auditadm_r { role system_r; }}
Chris PeBenito bbcd3c
#	dominance { role sysadm_r { role system_r; }}
Chris PeBenito bbcd3c
#	dominance { role user_r { role system_r; }}
Chris PeBenito bbcd3c
#	dominance { role staff_r { role system_r; }}
Chris PeBenito bbcd3c
Chris PeBenito bbcd3c
	# dont need to use the full role_change()
Chris PeBenito bbcd3c
	allow sysadm_r system_r;
Chris PeBenito bbcd3c
	allow sysadm_r user_r;
Chris PeBenito bbcd3c
	allow user_r system_r;
Chris PeBenito bbcd3c
	allow user_r sysadm_r;
Chris PeBenito bbcd3c
	allow system_r sysadm_r;
Chris PeBenito bbcd3c
	allow system_r sysadm_r;
Chris PeBenito bbcd3c
Chris PeBenito bbcd3c
	allow privhome user_home_t:dir manage_dir_perms;
Chris PeBenito bbcd3c
	allow privhome user_home_t:file create_file_perms;
Chris PeBenito bbcd3c
	allow privhome user_home_t:lnk_file create_lnk_perms;
Chris PeBenito bbcd3c
	allow privhome user_home_t:fifo_file create_file_perms;
Chris PeBenito bbcd3c
	allow privhome user_home_t:sock_file create_file_perms;
Chris PeBenito bbcd3c
	allow privhome user_home_dir_t:dir rw_dir_perms;
Chris PeBenito bbcd3c
	type_transition privhome user_home_dir_t:{ dir file lnk_file fifo_file sock_file } user_home_t;
Chris PeBenito bbcd3c
	files_search_home(privhome)
Chris PeBenito bbcd3c
Chris PeBenito bbcd3c
	ifdef(`enable_mls',`
Chris PeBenito bbcd3c
		allow secadm_r system_r;
Chris PeBenito bbcd3c
		allow auditadm_r system_r;
Chris PeBenito bbcd3c
		allow secadm_r user_r;
Chris PeBenito bbcd3c
		allow staff_r secadm_r;
Chris PeBenito bbcd3c
		allow staff_r auditadm_r;
Chris PeBenito bbcd3c
	')
Chris PeBenito bbcd3c
Chris PeBenito bbcd3c
	optional_policy(`
Chris PeBenito bbcd3c
		samba_per_role_template(user)
Chris PeBenito bbcd3c
	')
Chris PeBenito bbcd3c
')