|
Chris PeBenito |
e181fe |
# Copyright (C) 2005 Tresys Technology, LLC
|
|
Chris PeBenito |
48e0db |
## <module name="libraries" layer="system">
|
|
Chris PeBenito |
48e0db |
## <summary>Policy for system libraries.</summary>
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
########################################
|
|
Chris PeBenito |
48e0db |
## <interface name="libraries_ldconfig_transition">
|
|
Chris PeBenito |
48e0db |
## <description>
|
|
Chris PeBenito |
48e0db |
## Execute ldconfig in the ldconfig domain.
|
|
Chris PeBenito |
48e0db |
## </description>
|
|
Chris PeBenito |
48e0db |
## <parameter name="domain">
|
|
Chris PeBenito |
48e0db |
## The type of the process performing this action.
|
|
Chris PeBenito |
48e0db |
## </parameter>
|
|
Chris PeBenito |
48e0db |
## <infoflow type="write" weight="10"/>
|
|
Chris PeBenito |
48e0db |
## </interface>
|
|
Chris PeBenito |
48e0db |
#
|
|
Chris PeBenito |
48e0db |
define(`libraries_ldconfig_transition',`
|
|
Chris PeBenito |
48e0db |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
48e0db |
allow $1 ldconfig_exec_t:file { getattr read execute };
|
|
Chris PeBenito |
48e0db |
allow $1 ldconfig_t:process transition;
|
|
Chris PeBenito |
48e0db |
type_transition $1 ldconfig_exec_t:file ldconfig_t;
|
|
Chris PeBenito |
48e0db |
dontaudit $1 ldconfig_t:process { noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
48e0db |
')
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
define(`libraries_ldconfig_transition_depend',`
|
|
Chris PeBenito |
48e0db |
type ldconfig_t, ldconfig_exec_t;
|
|
Chris PeBenito |
48e0db |
class file { getattr read execute };
|
|
Chris PeBenito |
48e0db |
class process { transition noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
48e0db |
')
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
########################################
|
|
Chris PeBenito |
48e0db |
## <interface name="libraries_ldconfig_transition_add_role_use_terminal">
|
|
Chris PeBenito |
48e0db |
## <description>
|
|
Chris PeBenito |
48e0db |
## Execute ldconfig in the ldconfig domain.
|
|
Chris PeBenito |
48e0db |
## </description>
|
|
Chris PeBenito |
48e0db |
## <parameter name="domain">
|
|
Chris PeBenito |
48e0db |
## The type of the process performing this action.
|
|
Chris PeBenito |
48e0db |
## </parameter>
|
|
Chris PeBenito |
48e0db |
## <parameter name="role">
|
|
Chris PeBenito |
48e0db |
## The role to allow the ldconfig domain.
|
|
Chris PeBenito |
48e0db |
## </parameter>
|
|
Chris PeBenito |
48e0db |
## <parameter name="terminal">
|
|
Chris PeBenito |
48e0db |
## The type of the terminal allow the ldconfig domain to use.
|
|
Chris PeBenito |
48e0db |
## </parameter>
|
|
Chris PeBenito |
48e0db |
## <infoflow type="both" weight="10"/>
|
|
Chris PeBenito |
48e0db |
## </interface>
|
|
Chris PeBenito |
48e0db |
#
|
|
Chris PeBenito |
48e0db |
define(`libraries_ldconfig_transition_add_role_use_terminal',`
|
|
Chris PeBenito |
48e0db |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
48e0db |
libraries_ldconfig_transition($1)
|
|
Chris PeBenito |
48e0db |
role $2 types ldconfig_t;
|
|
Chris PeBenito |
48e0db |
allow ldconfig_t $3:chr_file { getattr read write ioctl };
|
|
Chris PeBenito |
48e0db |
')
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
define(`libraries_ldconfig_transition_add_role_use_terminal_depend',`
|
|
Chris PeBenito |
48e0db |
type ldconfig_t;
|
|
Chris PeBenito |
48e0db |
class chr_file { getattr read write ioctl };
|
|
Chris PeBenito |
48e0db |
')
|
|
Chris PeBenito |
e181fe |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
ebf760 |
# libraries_use_dynamic_loader(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`libraries_use_dynamic_loader',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
48e0db |
allow $1 lib_t:dir { getattr search read };
|
|
Chris PeBenito |
b4cd15 |
allow $1 lib_t:lnk_file { getattr read };
|
|
Chris PeBenito |
219bcf |
allow $1 ld_so_t:lnk_file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
allow $1 ld_so_t:file { getattr read execute };
|
|
Chris PeBenito |
b4cd15 |
allow $1 ld_so_cache_t:file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
define(`libraries_use_dynamic_loader_depend',`
|
|
Chris PeBenito |
b4cd15 |
type lib_t, ld_so_t, ld_so_cache_t;
|
|
Chris PeBenito |
48e0db |
class dir { getattr search read };
|
|
Chris PeBenito |
b4cd15 |
class lnk_file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
class file { getattr read execute };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
ebf760 |
# libraries_legacy_use_dynamic_loader(domain)
|
|
Chris PeBenito |
8beec8 |
#
|
|
Chris PeBenito |
8beec8 |
define(`libraries_legacy_use_dynamic_loader',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
8beec8 |
libraries_use_dynamic_loader($1,optional)
|
|
Chris PeBenito |
8beec8 |
allow $1 ld_so_t:file execmod;
|
|
Chris PeBenito |
8beec8 |
allow $1 ld_so_cache_t:file execute;
|
|
Chris PeBenito |
8beec8 |
')
|
|
Chris PeBenito |
8beec8 |
|
|
Chris PeBenito |
8beec8 |
define(`libraries_legacy_use_dynamic_loader_depend',`
|
|
Chris PeBenito |
8beec8 |
libraries_use_dynamic_loader_depend
|
|
Chris PeBenito |
8beec8 |
type ld_so_t, ld_so_cache_t;
|
|
Chris PeBenito |
8beec8 |
class file { execute execmod };
|
|
Chris PeBenito |
8beec8 |
')
|
|
Chris PeBenito |
8beec8 |
|
|
Chris PeBenito |
8beec8 |
########################################
|
|
Chris PeBenito |
8beec8 |
#
|
|
Chris PeBenito |
075c4f |
# libraries_execute_dynamic_loader(domain)
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
075c4f |
define(`libraries_execute_dynamic_loader',`
|
|
Chris PeBenito |
075c4f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
48e0db |
allow $1 lib_t:dir { getattr search read };
|
|
Chris PeBenito |
075c4f |
allow $1 lib_t:lnk_file { getattr read };
|
|
Chris PeBenito |
075c4f |
allow $1 ld_so_t:lnk_file { getattr read };
|
|
Chris PeBenito |
075c4f |
allow $1 ld_so_t:file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
075c4f |
define(`libraries_execute_dynamic_loader_depend',`
|
|
Chris PeBenito |
075c4f |
type lib_t, ld_so_t;
|
|
Chris PeBenito |
48e0db |
class dir { getattr search read };
|
|
Chris PeBenito |
075c4f |
class lnk_file { getattr read };
|
|
Chris PeBenito |
075c4f |
class file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
075c4f |
########################################
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
ebf760 |
# libraries_modify_dynamic_loader_cache(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`libraries_modify_dynamic_loader_cache',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
b4cd15 |
allow $1 ld_so_cache_t:file { getattr read write };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
define(`libraries_modify_dynamic_loader_cache_depend',`
|
|
Chris PeBenito |
b4cd15 |
type ld_so_cache_t;
|
|
Chris PeBenito |
b4cd15 |
class file { getattr read write };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
dd14d0 |
# libraries_use_shared_libraries(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
dd14d0 |
define(`libraries_use_shared_libraries',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
48e0db |
allow $1 lib_t:dir { getattr search read };
|
|
Chris PeBenito |
b4cd15 |
allow $1 lib_t:lnk_file { getattr read };
|
|
Chris PeBenito |
219bcf |
allow $1 { shlib_t texrel_shlib_t }:lnk_file { getattr read };
|
|
Chris PeBenito |
33bc0d |
allow $1 { shlib_t texrel_shlib_t }:file { getattr read execute };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
dd14d0 |
define(`libraries_use_shared_libraries_depend',`
|
|
Chris PeBenito |
33bc0d |
type lib_t, shlib_t, texrel_shlib_t;
|
|
Chris PeBenito |
48e0db |
class dir { getattr searc read };
|
|
Chris PeBenito |
b4cd15 |
class lnk_file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
class file { getattr read execute };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
8beec8 |
#
|
|
Chris PeBenito |
dd14d0 |
# libraries_legacy_use_shared_libraries(domain)
|
|
Chris PeBenito |
8beec8 |
#
|
|
Chris PeBenito |
dd14d0 |
define(`libraries_legacy_use_shared_libraries',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
dd14d0 |
libraries_use_shared_libraries($1)
|
|
Chris PeBenito |
8beec8 |
allow $1 { shlib_t texrel_shlib_t }:file execmod;
|
|
Chris PeBenito |
8beec8 |
')
|
|
Chris PeBenito |
8beec8 |
|
|
Chris PeBenito |
dd14d0 |
define(`libraries_legacy_use_shared_libraries_depend',`
|
|
Chris PeBenito |
8beec8 |
type shlib_t, texrel_shlib_t;
|
|
Chris PeBenito |
8beec8 |
class file execmod;
|
|
Chris PeBenito |
8beec8 |
')
|
|
Chris PeBenito |
8beec8 |
|
|
Chris PeBenito |
8beec8 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
118186 |
# libraries_read_library_resources(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
118186 |
define(`libraries_read_library_resources',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
b4cd15 |
allow $1 lib_t:dir { getattr read search };
|
|
Chris PeBenito |
b4cd15 |
allow $1 lib_t:{ file lnk_file } { getattr read };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
118186 |
define(`libraries_read_library_resources_depend',`
|
|
Chris PeBenito |
b4cd15 |
type lib_t;
|
|
Chris PeBenito |
b4cd15 |
class dir { getattr read search };
|
|
Chris PeBenito |
b4cd15 |
class lnk_file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
class file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
ebf760 |
# libraries_execute_library_scripts(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`libraries_execute_library_scripts',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
b4cd15 |
allow $1 lib_t:dir { getattr read search };
|
|
Chris PeBenito |
b4cd15 |
allow $1 lib_t:lnk_file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
allow $1 lib_t:file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
define(`libraries_execute_library_scripts_depend',`
|
|
Chris PeBenito |
b4cd15 |
type lib_t;
|
|
Chris PeBenito |
b4cd15 |
class dir { getattr read search };
|
|
Chris PeBenito |
b4cd15 |
class lnk_file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
class file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
## </module>
|