Chris PeBenito 17de1b
Chris PeBenito f79314
policy_module(apm, 1.9.1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
type apmd_t;
Chris PeBenito 17de1b
type apmd_exec_t;
Chris PeBenito 0bfccd
init_daemon_domain(apmd_t, apmd_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type apm_t;
Chris PeBenito d46cfe
type apm_exec_t;
Chris PeBenito 0bfccd
application_domain(apm_t, apm_exec_t)
Chris PeBenito 17de1b
role system_r types apm_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type apmd_log_t;
Chris PeBenito 17de1b
logging_log_file(apmd_log_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type apmd_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(apmd_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type apmd_var_run_t;
Chris PeBenito 17de1b
files_pid_file(apmd_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`distro_redhat',`
Chris PeBenito 17de1b
	type apmd_lock_t;
Chris PeBenito 17de1b
	files_lock_file(apmd_lock_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`distro_suse',`
Chris PeBenito 17de1b
	type apmd_var_lib_t;
Chris PeBenito 17de1b
	files_type(apmd_var_lib_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# apm client Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow apm_t self:capability { dac_override sys_admin };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(apm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_rw_apm_bios(apm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_xattr_fs(apm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_use_all_terms(apm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(apm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(apm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# apm daemon Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# mknod: controlling an orderly resume of PCMCIA requires creating device
Chris PeBenito 17de1b
# nodes 254,{0,1,2} for some reason.
Chris PeBenito 17de1b
allow apmd_t self:capability { sys_admin sys_nice sys_time kill mknod };
Chris PeBenito 17de1b
dontaudit apmd_t self:capability { setuid dac_override dac_read_search sys_tty_config };
Chris PeBenito 17de1b
allow apmd_t self:process { signal_perms getsession };
Chris PeBenito c0868a
allow apmd_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow apmd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow apmd_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow apmd_t apmd_log_t:file manage_file_perms;
Chris PeBenito 17de1b
logging_log_filetrans(apmd_t,apmd_log_t,file)
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_dirs_pattern(apmd_t, apmd_tmp_t, apmd_tmp_t)
Chris PeBenito 0bfccd
manage_files_pattern(apmd_t, apmd_tmp_t, apmd_tmp_t)
Chris PeBenito 17de1b
files_tmp_filetrans(apmd_t, apmd_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_files_pattern(apmd_t, apmd_var_run_t, apmd_var_run_t)
Chris PeBenito 0bfccd
manage_sock_files_pattern(apmd_t, apmd_var_run_t, apmd_var_run_t)
Chris PeBenito 17de1b
files_pid_filetrans(apmd_t, apmd_var_run_t, { file sock_file })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(apmd_t)
Chris PeBenito 17de1b
kernel_rw_all_sysctls(apmd_t)
Chris PeBenito 17de1b
kernel_read_system_state(apmd_t)
Chris PeBenito 17de1b
kernel_write_proc_files(apmd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_realtime_clock(apmd_t)
Chris PeBenito 17de1b
dev_read_urand(apmd_t)
Chris PeBenito 17de1b
dev_rw_apm_bios(apmd_t)
Chris PeBenito 17de1b
dev_rw_sysfs(apmd_t)
Chris PeBenito 17de1b
dev_dontaudit_getattr_all_chr_files(apmd_t) # Excessive?
Chris PeBenito 17de1b
dev_dontaudit_getattr_all_blk_files(apmd_t) # Excessive?
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_dontaudit_list_tmpfs(apmd_t)
Chris PeBenito 17de1b
fs_getattr_all_fs(apmd_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(apmd_t)
Chris PeBenito 26410d
fs_dontaudit_getattr_all_files(apmd_t) # Excessive?
Chris PeBenito 26410d
fs_dontaudit_getattr_all_symlinks(apmd_t) # Excessive?
Chris PeBenito 26410d
fs_dontaudit_getattr_all_pipes(apmd_t) # Excessive?
Chris PeBenito 26410d
fs_dontaudit_getattr_all_sockets(apmd_t) # Excessive?
Chris PeBenito 17de1b
Chris PeBenito 17de1b
selinux_search_fs(apmd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_exec_all_executables(apmd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_read_all_domains_state(apmd_t)
Chris PeBenito 6b19be
domain_dontaudit_ptrace_all_domains(apmd_t)
Chris PeBenito 17de1b
domain_use_interactive_fds(apmd_t)
Chris PeBenito 17de1b
domain_dontaudit_getattr_all_sockets(apmd_t)
Chris PeBenito 17de1b
domain_dontaudit_getattr_all_key_sockets(apmd_t) # Excessive?
Chris PeBenito 17de1b
domain_dontaudit_list_all_domains_state(apmd_t) # Excessive?
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_exec_etc_files(apmd_t)
Chris PeBenito 17de1b
files_read_etc_runtime_files(apmd_t)
Chris PeBenito 17de1b
files_dontaudit_getattr_all_files(apmd_t) # Excessive?
Chris PeBenito 17de1b
files_dontaudit_getattr_all_symlinks(apmd_t) # Excessive?
Chris PeBenito 17de1b
files_dontaudit_getattr_all_pipes(apmd_t) # Excessive?
Chris PeBenito 17de1b
files_dontaudit_getattr_all_sockets(apmd_t) # Excessive?
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_domtrans_script(apmd_t)
Chris PeBenito 17de1b
init_rw_utmp(apmd_t)
Chris PeBenito aeb54c
init_telinit(apmd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_exec_ld_so(apmd_t)
Chris PeBenito 17de1b
libs_exec_lib_files(apmd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(apmd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(apmd_t)
Chris PeBenito 17de1b
miscfiles_read_hwdata(apmd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
modutils_domtrans_insmod(apmd_t)
Chris PeBenito 17de1b
modutils_read_module_config(apmd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
seutil_dontaudit_read_config(apmd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(apmd_t)
Chris PeBenito 296273
userdom_dontaudit_search_user_home_dirs(apmd_t)
Chris PeBenito 296273
userdom_dontaudit_search_user_home_content(apmd_t) # Excessive?
Chris PeBenito e9c6cd
Chris PeBenito 17de1b
ifdef(`distro_redhat',`
Chris PeBenito c0868a
	allow apmd_t apmd_lock_t:file manage_file_perms;
Chris PeBenito 17de1b
	files_lock_filetrans(apmd_t,apmd_lock_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	can_exec(apmd_t, apmd_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# ifconfig_exec_t needs to be run in its own domain for Red Hat
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		sysnet_domtrans_ifconfig(apmd_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		iptables_domtrans(apmd_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		netutils_domtrans(apmd_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
',`
Chris PeBenito 17de1b
	# for ifconfig which is run all the time
Chris PeBenito 17de1b
	kernel_dontaudit_search_sysctl(apmd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`distro_suse',`
Chris PeBenito 0bfccd
	manage_dirs_pattern(apmd_t, apmd_var_lib_t, apmd_var_lib_t)
Chris PeBenito 0bfccd
	manage_files_pattern(apmd_t, apmd_var_lib_t, apmd_var_lib_t)
Chris PeBenito 0bfccd
	files_var_lib_filetrans(apmd_t, apmd_var_lib_t, file)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	automount_domtrans(apmd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	clock_domtrans(apmd_t)
Chris PeBenito 17de1b
	clock_rw_adjtime(apmd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	cron_system_entry(apmd_t, apmd_exec_t)
Chris PeBenito 17de1b
	cron_anacron_domtrans_system_job(apmd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito f79314
	dbus_system_bus_client(apmd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 6224fc
		consolekit_dbus_chat(apmd_t)
Chris PeBenito 6224fc
	')
Chris PeBenito 6224fc
Chris PeBenito 6224fc
	optional_policy(`
Chris PeBenito 17de1b
		networkmanager_dbus_chat(apmd_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	logrotate_use_fds(apmd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	mta_send_mail(apmd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nscd_socket_use(apmd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	pcmcia_domtrans_cardmgr(apmd_t)
Chris PeBenito 17de1b
	pcmcia_domtrans_cardctl(apmd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(apmd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(apmd_t)
Chris PeBenito 17de1b
	udev_read_state(apmd_t) #necessary?
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 350b6a
optional_policy(`
Chris PeBenito 350b6a
	unconfined_domain(apmd_t)
Chris PeBenito 350b6a
')
Chris PeBenito 350b6a
Chris PeBenito 17de1b
# cjp: related to sleep/resume (?)
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 296273
	xserver_domtrans(apmd_t)
Chris PeBenito 17de1b
')