2020-08-18 13:09:10 +00:00
|
|
|
policy_module(slocate, 1.16.0)
|
2018-06-23 13:00:56 +00:00
|
|
|
|
|
|
|
#################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type locate_t;
|
|
|
|
type locate_exec_t;
|
|
|
|
init_system_domain(locate_t, locate_exec_t)
|
|
|
|
|
2019-09-08 20:55:02 +00:00
|
|
|
type locate_runtime_t alias locate_var_run_t;
|
2020-06-27 21:11:48 +00:00
|
|
|
files_runtime_file(locate_runtime_t)
|
2018-06-23 13:00:56 +00:00
|
|
|
|
2019-09-11 00:05:46 +00:00
|
|
|
type locate_var_lib_t;
|
|
|
|
files_type(locate_var_lib_t)
|
|
|
|
|
2018-06-23 13:00:56 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow locate_t self:capability { chown dac_override dac_read_search fowner fsetid };
|
|
|
|
allow locate_t self:process { execmem execheap execstack signal setsched };
|
|
|
|
allow locate_t self:fifo_file rw_fifo_file_perms;
|
|
|
|
allow locate_t self:unix_stream_socket create_socket_perms;
|
|
|
|
|
|
|
|
manage_dirs_pattern(locate_t, locate_var_lib_t, locate_var_lib_t)
|
|
|
|
manage_files_pattern(locate_t, locate_var_lib_t, locate_var_lib_t)
|
|
|
|
|
2019-09-08 20:55:02 +00:00
|
|
|
allow locate_t locate_runtime_t:file manage_file_perms;
|
2020-06-27 21:11:48 +00:00
|
|
|
files_runtime_filetrans(locate_t, locate_runtime_t, file, "mlocate.daily.lock")
|
2018-06-23 13:00:56 +00:00
|
|
|
|
|
|
|
can_exec(locate_t, locate_exec_t)
|
|
|
|
|
|
|
|
kernel_read_system_state(locate_t)
|
|
|
|
kernel_dontaudit_search_network_state(locate_t)
|
|
|
|
kernel_dontaudit_search_sysctl(locate_t)
|
|
|
|
|
|
|
|
corecmd_exec_bin(locate_t)
|
|
|
|
corecmd_exec_shell(locate_t)
|
|
|
|
|
|
|
|
dev_getattr_all_blk_files(locate_t)
|
|
|
|
dev_getattr_all_chr_files(locate_t)
|
|
|
|
|
|
|
|
files_list_all(locate_t)
|
|
|
|
files_dontaudit_read_all_symlinks(locate_t)
|
|
|
|
files_getattr_all_files(locate_t)
|
|
|
|
files_getattr_all_pipes(locate_t)
|
|
|
|
files_getattr_all_sockets(locate_t)
|
|
|
|
files_read_etc_runtime_files(locate_t)
|
|
|
|
|
|
|
|
fs_getattr_all_fs(locate_t)
|
|
|
|
fs_getattr_all_files(locate_t)
|
|
|
|
fs_getattr_all_pipes(locate_t)
|
|
|
|
fs_getattr_all_symlinks(locate_t)
|
|
|
|
fs_getattr_all_blk_files(locate_t)
|
|
|
|
fs_getattr_all_chr_files(locate_t)
|
|
|
|
fs_list_all(locate_t)
|
|
|
|
fs_list_inotifyfs(locate_t)
|
|
|
|
fs_read_noxattr_fs_symlinks(locate_t)
|
|
|
|
|
|
|
|
auth_use_nsswitch(locate_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(locate_t)
|
|
|
|
|
|
|
|
ifdef(`enable_mls',`
|
|
|
|
files_dontaudit_getattr_all_dirs(locate_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
cron_system_entry(locate_t, locate_exec_t)
|
|
|
|
')
|