selinux-refpolicy/policy/modules/system/libraries.te

147 lines
3.2 KiB
Plaintext
Raw Normal View History

policy_module(libraries, 2.12.1)
2005-05-23 15:45:53 +00:00
########################################
#
# Declarations
#
2005-04-14 20:18:17 +00:00
#
# ld_so_cache_t is the type of /etc/ld.so.cache.
#
type ld_so_cache_t;
files_type(ld_so_cache_t)
2005-04-14 20:18:17 +00:00
2005-05-23 15:45:53 +00:00
#
2005-04-14 20:18:17 +00:00
# ld_so_t is the type of the system dynamic loaders.
#
type ld_so_t;
files_type(ld_so_t)
2005-04-14 20:18:17 +00:00
2007-04-10 19:39:22 +00:00
type ldconfig_t;
type ldconfig_exec_t;
2009-06-26 14:40:13 +00:00
init_system_domain(ldconfig_t, ldconfig_exec_t)
2007-04-10 19:39:22 +00:00
role system_r types ldconfig_t;
type ldconfig_cache_t;
files_type(ldconfig_cache_t)
2007-04-10 19:39:22 +00:00
type ldconfig_tmp_t;
files_tmp_file(ldconfig_tmp_t)
2005-04-14 20:18:17 +00:00
#
# lib_t is the type of files in the system lib directories.
#
type lib_t alias shlib_t;
files_type(lib_t)
2005-04-14 20:18:17 +00:00
#
2005-12-12 16:56:36 +00:00
# textrel_shlib_t is the type of shared objects in the system lib
2005-04-14 20:18:17 +00:00
# directories, which require text relocation.
#
type textrel_shlib_t alias texrel_shlib_t;
files_type(textrel_shlib_t)
2005-05-23 15:45:53 +00:00
ifdef(`distro_gentoo',`
# openrc unfortunately mounts a tmpfs
# at /lib/rc/
files_mountpoint(lib_t)
')
optional_policy(`
postgresql_loadable_module(lib_t)
postgresql_loadable_module(textrel_shlib_t)
')
2005-05-23 15:45:53 +00:00
########################################
#
# ldconfig local policy
#
2007-04-10 19:39:22 +00:00
2010-03-19 18:21:23 +00:00
allow ldconfig_t self:capability { dac_override sys_chroot };
2005-05-23 15:45:53 +00:00
manage_files_pattern(ldconfig_t, ldconfig_cache_t, ldconfig_cache_t)
2006-12-12 20:08:08 +00:00
allow ldconfig_t ld_so_cache_t:file manage_file_perms;
2009-06-26 14:40:13 +00:00
files_etc_filetrans(ldconfig_t, ld_so_cache_t, file)
2005-05-23 15:45:53 +00:00
2009-06-26 14:40:13 +00:00
manage_dirs_pattern(ldconfig_t, ldconfig_tmp_t, ldconfig_tmp_t)
manage_files_pattern(ldconfig_t, ldconfig_tmp_t, ldconfig_tmp_t)
manage_lnk_files_pattern(ldconfig_t, ldconfig_tmp_t, ldconfig_tmp_t)
2007-06-11 15:01:10 +00:00
files_tmp_filetrans(ldconfig_t, ldconfig_tmp_t, { file dir lnk_file })
2007-04-10 19:39:22 +00:00
2009-06-26 14:40:13 +00:00
manage_lnk_files_pattern(ldconfig_t, lib_t, lib_t)
2005-05-23 15:45:53 +00:00
kernel_read_system_state(ldconfig_t)
2005-06-10 01:01:13 +00:00
fs_getattr_xattr_fs(ldconfig_t)
2005-05-23 15:45:53 +00:00
2010-03-19 18:21:23 +00:00
corecmd_search_bin(ldconfig_t)
2006-02-20 21:33:25 +00:00
domain_use_interactive_fds(ldconfig_t)
2005-05-23 15:45:53 +00:00
files_search_var_lib(ldconfig_t)
files_read_etc_files(ldconfig_t)
2010-03-19 18:21:23 +00:00
files_read_usr_files(ldconfig_t)
2005-06-29 20:53:53 +00:00
files_search_tmp(ldconfig_t)
files_search_usr(ldconfig_t)
2005-05-23 15:45:53 +00:00
# for when /etc/ld.so.cache is mislabeled:
files_delete_etc_files(ldconfig_t)
2005-05-23 15:45:53 +00:00
2006-02-02 21:08:12 +00:00
init_use_script_ptys(ldconfig_t)
2010-03-19 18:21:23 +00:00
init_read_script_tmp_files(ldconfig_t)
2005-05-23 15:45:53 +00:00
2007-04-10 19:39:22 +00:00
miscfiles_read_localization(ldconfig_t)
2005-06-13 17:35:46 +00:00
logging_send_syslog_msg(ldconfig_t)
2005-05-23 15:45:53 +00:00
2008-11-05 16:10:46 +00:00
userdom_use_user_terminals(ldconfig_t)
2006-02-20 21:33:25 +00:00
userdom_use_all_users_fds(ldconfig_t)
2005-05-23 15:45:53 +00:00
2008-02-05 18:24:43 +00:00
ifdef(`distro_ubuntu',`
optional_policy(`
unconfined_domain(ldconfig_t)
')
')
2005-07-08 20:44:57 +00:00
ifdef(`hide_broken_symptoms',`
ifdef(`distro_gentoo',`
# leaked fds from portage
files_dontaudit_rw_var_files(ldconfig_t)
optional_policy(`
portage_dontaudit_search_tmp(ldconfig_t)
portage_dontaudit_rw_tmp_files(ldconfig_t)
')
')
optional_policy(`
2006-02-02 21:08:12 +00:00
unconfined_dontaudit_rw_tcp_sockets(ldconfig_t)
')
2005-05-23 15:45:53 +00:00
')
optional_policy(`
2005-07-08 20:44:57 +00:00
# dontaudit access to /usr/lib/apache, normal programs cannot read these libs anyway
2005-11-15 18:47:20 +00:00
apache_dontaudit_search_modules(ldconfig_t)
2005-07-08 20:44:57 +00:00
')
2007-04-11 13:31:10 +00:00
optional_policy(`
apt_rw_pipes(ldconfig_t)
apt_use_fds(ldconfig_t)
apt_use_ptys(ldconfig_t)
')
2009-11-11 16:28:50 +00:00
optional_policy(`
puppet_rw_tmp(ldconfig_t)
')
2007-04-11 13:31:10 +00:00
optional_policy(`
# When you install a kernel the postinstall builds a initrd image in tmp
2008-12-03 19:16:20 +00:00
# and executes ldconfig on it. If you dont allow this kernel installs
2007-04-11 13:31:10 +00:00
# blow up.
rpm_manage_script_tmp_files(ldconfig_t)
')
2010-03-19 18:21:23 +00:00
optional_policy(`
unconfined_domain(ldconfig_t)
')