selinux-refpolicy/policy/modules/apps/loadkeys.te
Yi Zhao ee3ea8ebca loadkeys: do not audit attempts to get attributes for all directories
Fixes:
avc:  denied  { getattr } for  pid=239 comm="loadkeys" path="/boot"
dev="vda" ino=15 scontext=system_u:system_r:loadkeys_t:s0-s15:c0.c1023
tcontext=system_u:object_r:boot_t:s0 tclass=dir permissive=1

avc:  denied  { getattr } for  pid=239 comm="loadkeys" path="/home"
dev="vda" ino=806 scontext=system_u:system_r:loadkeys_t:s0-s15:c0.c1023
tcontext=system_u:object_r:home_root_t:s0-s15:c0.c1023 tclass=dir permissive=1

avc:  denied  { getattr } for  pid=239 comm="loadkeys" path="/lost+found"
dev="vda" ino=11 scontext=system_u:system_r:loadkeys_t:s0-s15:c0.c1023
tcontext=system_u:object_r:lost_found_t:s15:c0.c1023 tclass=dir permissive=1

avc:  denied  { getattr } for  pid=239 comm="loadkeys" path="/media"
dev="vda" ino=810 scontext=system_u:system_r:loadkeys_t:s0-s15:c0.c1023
tcontext=system_u:object_r:mnt_t:s0 tclass=dir permissive=1

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2023-09-20 14:44:45 +08:00

59 lines
1.3 KiB
Plaintext

policy_module(loadkeys)
########################################
#
# Declarations
#
attribute_role loadkeys_roles;
type loadkeys_t;
type loadkeys_exec_t;
init_system_domain(loadkeys_t, loadkeys_exec_t)
role loadkeys_roles types loadkeys_t;
########################################
#
# Local policy
#
allow loadkeys_t self:capability { dac_override dac_read_search setuid sys_tty_config };
allow loadkeys_t self:fifo_file rw_fifo_file_perms;
allow loadkeys_t self:unix_stream_socket { connect create };
kernel_read_system_state(loadkeys_t)
init_use_fds(loadkeys_t)
corecmd_exec_bin(loadkeys_t)
corecmd_exec_shell(loadkeys_t)
files_read_etc_files(loadkeys_t)
files_read_etc_runtime_files(loadkeys_t)
# keymap files are in /usr/share/keymaps or /usr/share/kbd/keymaps
files_read_usr_files(loadkeys_t)
files_search_runtime(loadkeys_t)
files_search_src(loadkeys_t)
files_search_tmp(loadkeys_t)
files_dontaudit_getattr_all_dirs(loadkeys_t)
term_dontaudit_use_console(loadkeys_t)
term_use_unallocated_ttys(loadkeys_t)
init_read_script_tmp_files(loadkeys_t)
locallogin_use_fds(loadkeys_t)
miscfiles_read_localization(loadkeys_t)
userdom_use_user_terminals(loadkeys_t)
userdom_list_user_home_content(loadkeys_t)
optional_policy(`
consolesetup_read_conf(loadkeys_t)
')
optional_policy(`
nscd_dontaudit_search_runtime(loadkeys_t)
')