|
Chris PeBenito |
e181fe |
|
|
Chris PeBenito |
960373 |
policy_module(libraries,1.0)
|
|
Chris PeBenito |
960373 |
|
|
Chris PeBenito |
48e0db |
########################################
|
|
Chris PeBenito |
48e0db |
#
|
|
Chris PeBenito |
48e0db |
# Declarations
|
|
Chris PeBenito |
48e0db |
#
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
# ld_so_cache_t is the type of /etc/ld.so.cache.
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
type ld_so_cache_t;
|
|
Chris PeBenito |
c9428d |
files_file_type(ld_so_cache_t)
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
48e0db |
#
|
|
Chris PeBenito |
b4cd15 |
# ld_so_t is the type of the system dynamic loaders.
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
type ld_so_t;
|
|
Chris PeBenito |
c9428d |
files_file_type(ld_so_t)
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
# lib_t is the type of files in the system lib directories.
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
type lib_t;
|
|
Chris PeBenito |
c9428d |
files_file_type(lib_t)
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
# shlib_t is the type of shared objects in the system lib
|
|
Chris PeBenito |
b4cd15 |
# directories.
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
type shlib_t;
|
|
Chris PeBenito |
c9428d |
files_file_type(shlib_t)
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
33bc0d |
# texrel_shlib_t is the type of shared objects in the system lib
|
|
Chris PeBenito |
b4cd15 |
# directories, which require text relocation.
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
33bc0d |
type texrel_shlib_t;
|
|
Chris PeBenito |
c9428d |
files_file_type(texrel_shlib_t)
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
########################################
|
|
Chris PeBenito |
48e0db |
#
|
|
Chris PeBenito |
48e0db |
# ldconfig local policy
|
|
Chris PeBenito |
48e0db |
#
|
|
Chris PeBenito |
48e0db |
type ldconfig_t;
|
|
Chris PeBenito |
48e0db |
type ldconfig_exec_t;
|
|
Chris PeBenito |
c9428d |
init_system_domain(ldconfig_t,ldconfig_exec_t)
|
|
Chris PeBenito |
48e0db |
role system_r types ldconfig_t;
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
dd8229 |
allow ldconfig_t ld_so_cache_t:file create_file_perms;
|
|
Chris PeBenito |
c9428d |
files_create_etc_config(ldconfig_t,ld_so_cache_t,file)
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
dd8229 |
allow ldconfig_t lib_t:dir rw_dir_perms;
|
|
Chris PeBenito |
48e0db |
allow ldconfig_t lib_t:lnk_file { getattr create read unlink };
|
|
Chris PeBenito |
dd8229 |
allow ldconfig_t ld_so_t:lnk_file r_file_perms;
|
|
Chris PeBenito |
dd8229 |
allow ldconfig_t ld_so_t:file rx_file_perms;
|
|
Chris PeBenito |
dd8229 |
allow ldconfig_t ld_so_cache_t:file r_file_perms;
|
|
Chris PeBenito |
dd8229 |
allow ldconfig_t { shlib_t texrel_shlib_t }:lnk_file r_file_perms;
|
|
Chris PeBenito |
dd8229 |
allow ldconfig_t { shlib_t texrel_shlib_t }:file rx_file_perms;
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
kernel_read_system_state(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
0fd9dc |
fs_getattr_xattr_fs(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
c9428d |
domain_use_wide_inherit_fd(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
c9428d |
files_read_generic_etc_files(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
# for when /etc/ld.so.cache is mislabeled:
|
|
Chris PeBenito |
c9428d |
files_delete_generic_etc_files(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
c9428d |
init_use_script_pty(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
c9428d |
logging_send_syslog_msg(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
c9428d |
userdom_use_all_user_fd(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
ifdef(`TODO',`
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
allow ldconfig_t tmp_t:dir search;
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
ifdef(`apache.te', `
|
|
Chris PeBenito |
0c73cd |
# dontaudit access to /usr/lib/apache, normal programs cannot read these libs anyway
|
|
Chris PeBenito |
0c73cd |
dontaudit ldconfig_t httpd_modules_t:dir search;
|
|
Chris PeBenito |
48e0db |
')
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
allow ldconfig_t { var_t var_lib_t }:dir search;
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
ifdef(`hide_broken_symptoms', `
|
|
Chris PeBenito |
0c73cd |
ifdef(`unconfined.te',`
|
|
Chris PeBenito |
0c73cd |
dontaudit ldconfig_t unconfined_t:tcp_socket { read write };
|
|
Chris PeBenito |
0c73cd |
')
|
|
Chris PeBenito |
48e0db |
')
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
ifdef(`targeted_policy', `
|
|
Chris PeBenito |
0c73cd |
allow ldconfig_t lib_t:file r_file_perms;
|
|
Chris PeBenito |
0c73cd |
unconfined_domain(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
')
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
') dnl end TODO
|