2010-05-24 19:32:01 +00:00
|
|
|
policy_module(apm, 1.11.0)
|
2005-10-10 18:11:46 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
2010-09-22 09:21:30 +00:00
|
|
|
|
2005-10-10 18:11:46 +00:00
|
|
|
type apmd_t;
|
|
|
|
type apmd_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
init_daemon_domain(apmd_t, apmd_exec_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
|
|
|
|
type apm_t;
|
2007-07-19 18:57:48 +00:00
|
|
|
type apm_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
application_domain(apm_t, apm_exec_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
role system_r types apm_t;
|
|
|
|
|
|
|
|
type apmd_log_t;
|
|
|
|
logging_log_file(apmd_log_t)
|
|
|
|
|
2005-10-13 20:59:36 +00:00
|
|
|
type apmd_tmp_t;
|
|
|
|
files_tmp_file(apmd_tmp_t)
|
|
|
|
|
2005-10-10 18:11:46 +00:00
|
|
|
type apmd_var_run_t;
|
|
|
|
files_pid_file(apmd_var_run_t)
|
|
|
|
|
|
|
|
ifdef(`distro_redhat',`
|
|
|
|
type apmd_lock_t;
|
|
|
|
files_lock_file(apmd_lock_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
ifdef(`distro_suse',`
|
|
|
|
type apmd_var_lib_t;
|
|
|
|
files_type(apmd_var_lib_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# apm client Local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow apm_t self:capability { dac_override sys_admin };
|
|
|
|
|
|
|
|
kernel_read_system_state(apm_t)
|
|
|
|
|
|
|
|
dev_rw_apm_bios(apm_t)
|
|
|
|
|
|
|
|
fs_getattr_xattr_fs(apm_t)
|
|
|
|
|
|
|
|
term_use_all_terms(apm_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(apm_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
|
|
|
|
logging_send_syslog_msg(apm_t)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# apm daemon Local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
# mknod: controlling an orderly resume of PCMCIA requires creating device
|
|
|
|
# nodes 254,{0,1,2} for some reason.
|
|
|
|
allow apmd_t self:capability { sys_admin sys_nice sys_time kill mknod };
|
2009-12-18 15:35:31 +00:00
|
|
|
dontaudit apmd_t self:capability { setuid dac_override dac_read_search sys_ptrace sys_tty_config };
|
2005-10-10 18:11:46 +00:00
|
|
|
allow apmd_t self:process { signal_perms getsession };
|
2006-12-12 20:08:08 +00:00
|
|
|
allow apmd_t self:fifo_file rw_fifo_file_perms;
|
2010-08-26 13:41:21 +00:00
|
|
|
allow apmd_t self:netlink_socket create_socket_perms;
|
2005-10-10 18:11:46 +00:00
|
|
|
allow apmd_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow apmd_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow apmd_t apmd_log_t:file manage_file_perms;
|
2009-06-26 14:40:13 +00:00
|
|
|
logging_log_filetrans(apmd_t, apmd_log_t, file)
|
2005-10-10 18:11:46 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern(apmd_t, apmd_tmp_t, apmd_tmp_t)
|
|
|
|
manage_files_pattern(apmd_t, apmd_tmp_t, apmd_tmp_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(apmd_t, apmd_tmp_t, { file dir })
|
2005-10-13 20:59:36 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(apmd_t, apmd_var_run_t, apmd_var_run_t)
|
|
|
|
manage_sock_files_pattern(apmd_t, apmd_var_run_t, apmd_var_run_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_pid_filetrans(apmd_t, apmd_var_run_t, { file sock_file })
|
2005-10-10 18:11:46 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(apmd_t)
|
|
|
|
kernel_rw_all_sysctls(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
kernel_read_system_state(apmd_t)
|
2006-04-03 19:49:47 +00:00
|
|
|
kernel_write_proc_files(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
dev_read_input(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
dev_read_realtime_clock(apmd_t)
|
|
|
|
dev_read_urand(apmd_t)
|
|
|
|
dev_rw_apm_bios(apmd_t)
|
|
|
|
dev_rw_sysfs(apmd_t)
|
|
|
|
dev_dontaudit_getattr_all_chr_files(apmd_t) # Excessive?
|
|
|
|
dev_dontaudit_getattr_all_blk_files(apmd_t) # Excessive?
|
|
|
|
|
|
|
|
fs_dontaudit_list_tmpfs(apmd_t)
|
|
|
|
fs_getattr_all_fs(apmd_t)
|
|
|
|
fs_search_auto_mountpoints(apmd_t)
|
2009-06-19 13:52:33 +00:00
|
|
|
fs_dontaudit_getattr_all_files(apmd_t) # Excessive?
|
|
|
|
fs_dontaudit_getattr_all_symlinks(apmd_t) # Excessive?
|
|
|
|
fs_dontaudit_getattr_all_pipes(apmd_t) # Excessive?
|
|
|
|
fs_dontaudit_getattr_all_sockets(apmd_t) # Excessive?
|
2005-10-10 18:11:46 +00:00
|
|
|
|
2005-10-13 20:59:36 +00:00
|
|
|
selinux_search_fs(apmd_t)
|
|
|
|
|
2006-04-19 21:43:02 +00:00
|
|
|
corecmd_exec_all_executables(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
|
|
|
|
domain_read_all_domains_state(apmd_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
domain_dontaudit_ptrace_all_domains(apmd_t)
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
domain_dontaudit_getattr_all_sockets(apmd_t)
|
|
|
|
domain_dontaudit_getattr_all_key_sockets(apmd_t) # Excessive?
|
2006-02-02 21:08:12 +00:00
|
|
|
domain_dontaudit_list_all_domains_state(apmd_t) # Excessive?
|
2005-10-10 18:11:46 +00:00
|
|
|
|
|
|
|
files_exec_etc_files(apmd_t)
|
|
|
|
files_read_etc_runtime_files(apmd_t)
|
|
|
|
files_dontaudit_getattr_all_files(apmd_t) # Excessive?
|
|
|
|
files_dontaudit_getattr_all_symlinks(apmd_t) # Excessive?
|
|
|
|
files_dontaudit_getattr_all_pipes(apmd_t) # Excessive?
|
|
|
|
files_dontaudit_getattr_all_sockets(apmd_t) # Excessive?
|
|
|
|
|
|
|
|
init_domtrans_script(apmd_t)
|
2006-01-18 18:08:39 +00:00
|
|
|
init_rw_utmp(apmd_t)
|
2007-02-23 19:41:41 +00:00
|
|
|
init_telinit(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
|
|
|
|
libs_exec_ld_so(apmd_t)
|
|
|
|
libs_exec_lib_files(apmd_t)
|
|
|
|
|
|
|
|
logging_send_syslog_msg(apmd_t)
|
2009-06-26 13:22:39 +00:00
|
|
|
logging_send_audit_msgs(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(apmd_t)
|
2005-11-25 16:43:03 +00:00
|
|
|
miscfiles_read_hwdata(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
|
|
|
|
modutils_domtrans_insmod(apmd_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
modutils_read_module_config(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
|
2005-10-21 19:36:49 +00:00
|
|
|
seutil_dontaudit_read_config(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fds(apmd_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_dontaudit_search_user_home_dirs(apmd_t)
|
|
|
|
userdom_dontaudit_search_user_home_content(apmd_t) # Excessive?
|
2008-04-29 13:58:34 +00:00
|
|
|
|
2005-10-10 18:11:46 +00:00
|
|
|
ifdef(`distro_redhat',`
|
2006-12-12 20:08:08 +00:00
|
|
|
allow apmd_t apmd_lock_t:file manage_file_perms;
|
2009-06-26 14:40:13 +00:00
|
|
|
files_lock_filetrans(apmd_t, apmd_lock_t, file)
|
2005-10-10 18:11:46 +00:00
|
|
|
|
|
|
|
can_exec(apmd_t, apmd_var_run_t)
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
optional_policy(`
|
2010-08-30 15:15:53 +00:00
|
|
|
fstools_domtrans(apmd_t)
|
2010-08-26 13:41:21 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2010-08-30 15:15:53 +00:00
|
|
|
iptables_domtrans(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2010-08-30 15:15:53 +00:00
|
|
|
netutils_domtrans(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
')
|
|
|
|
|
2010-08-30 15:15:53 +00:00
|
|
|
# ifconfig_exec_t needs to be run in its own domain for Red Hat
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2010-08-30 15:15:53 +00:00
|
|
|
sssd_search_lib(apmd_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
sysnet_domtrans_ifconfig(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
')
|
|
|
|
|
2005-10-13 20:59:36 +00:00
|
|
|
',`
|
2005-10-10 18:11:46 +00:00
|
|
|
# for ifconfig which is run all the time
|
2005-10-13 20:59:36 +00:00
|
|
|
kernel_dontaudit_search_sysctl(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
ifdef(`distro_suse',`
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern(apmd_t, apmd_var_lib_t, apmd_var_lib_t)
|
|
|
|
manage_files_pattern(apmd_t, apmd_var_lib_t, apmd_var_lib_t)
|
|
|
|
files_var_lib_filetrans(apmd_t, apmd_var_lib_t, file)
|
2005-10-10 18:11:46 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-12-09 20:08:10 +00:00
|
|
|
automount_domtrans(apmd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-10 18:11:46 +00:00
|
|
|
clock_domtrans(apmd_t)
|
|
|
|
clock_rw_adjtime(apmd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-01-17 17:50:10 +00:00
|
|
|
cron_system_entry(apmd_t, apmd_exec_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
cron_anacron_domtrans_system_job(apmd_t)
|
2005-10-21 19:36:49 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2009-02-11 19:28:30 +00:00
|
|
|
dbus_system_bus_client(apmd_t)
|
2005-11-25 16:43:03 +00:00
|
|
|
|
2008-07-24 23:56:03 +00:00
|
|
|
optional_policy(`
|
|
|
|
consolekit_dbus_chat(apmd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-11-25 16:43:03 +00:00
|
|
|
networkmanager_dbus_chat(apmd_t)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-03-02 23:41:11 +00:00
|
|
|
logrotate_use_fds(apmd_t)
|
2005-10-13 20:59:36 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-10 18:11:46 +00:00
|
|
|
mta_send_mail(apmd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-02 21:08:12 +00:00
|
|
|
nscd_socket_use(apmd_t)
|
2005-10-10 18:11:46 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-10 18:11:46 +00:00
|
|
|
pcmcia_domtrans_cardmgr(apmd_t)
|
|
|
|
pcmcia_domtrans_cardctl(apmd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-10 18:11:46 +00:00
|
|
|
seutil_sigchld_newrole(apmd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-10 18:11:46 +00:00
|
|
|
udev_read_db(apmd_t)
|
|
|
|
udev_read_state(apmd_t) #necessary?
|
|
|
|
')
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
|
|
|
unconfined_domain(apmd_t)
|
|
|
|
')
|
|
|
|
|
2010-03-02 20:35:47 +00:00
|
|
|
optional_policy(`
|
|
|
|
vbetool_domtrans(apmd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-30 15:59:39 +00:00
|
|
|
# cjp: related to sleep/resume (?)
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
xserver_domtrans(apmd_t)
|
2006-03-30 15:59:39 +00:00
|
|
|
')
|