|
Dan Walsh |
3eaa99 |
policy_module(sosreport,1.0.0)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
########################################
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
# Declarations
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
type sosreport_t;
|
|
Dan Walsh |
3eaa99 |
type sosreport_exec_t;
|
|
Dan Walsh |
3eaa99 |
application_domain(sosreport_t, sosreport_exec_t)
|
|
Dan Walsh |
3eaa99 |
role system_r types sosreport_t;
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
type sosreport_tmp_t;
|
|
Dan Walsh |
3eaa99 |
files_tmp_file(sosreport_tmp_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
type sosreport_tmpfs_t;
|
|
Dan Walsh |
3eaa99 |
files_tmpfs_file(sosreport_tmpfs_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
########################################
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
# sosreport local policy
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
allow sosreport_t self:capability { kill net_admin net_raw setuid sys_admin sys_nice sys_ptrace dac_override };
|
|
Dan Walsh |
3eaa99 |
allow sosreport_t self:process { setsched signull };
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
allow sosreport_t self:fifo_file rw_fifo_file_perms;
|
|
Dan Walsh |
3eaa99 |
allow sosreport_t self:tcp_socket create_stream_socket_perms;
|
|
Dan Walsh |
3eaa99 |
allow sosreport_t self:udp_socket create_socket_perms;
|
|
Dan Walsh |
3eaa99 |
allow sosreport_t self:unix_dgram_socket create_socket_perms;
|
|
Dan Walsh |
3eaa99 |
allow sosreport_t self:netlink_route_socket r_netlink_socket_perms;
|
|
Dan Walsh |
3eaa99 |
allow sosreport_t self:unix_stream_socket create_stream_socket_perms;
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
# sosreport tmp files
|
|
Dan Walsh |
3eaa99 |
manage_dirs_pattern(sosreport_t, sosreport_tmp_t, sosreport_tmp_t)
|
|
Dan Walsh |
3eaa99 |
manage_files_pattern(sosreport_t, sosreport_tmp_t, sosreport_tmp_t)
|
|
Dan Walsh |
3eaa99 |
manage_lnk_files_pattern(sosreport_t, sosreport_tmp_t, sosreport_tmp_t)
|
|
Dan Walsh |
3eaa99 |
files_tmp_filetrans(sosreport_t, sosreport_tmp_t, { file dir })
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
manage_files_pattern(sosreport_t, sosreport_tmpfs_t, sosreport_tmpfs_t)
|
|
Dan Walsh |
3eaa99 |
fs_tmpfs_filetrans(sosreport_t, sosreport_tmpfs_t,file)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
kernel_read_network_state(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
kernel_read_all_sysctls(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
kernel_read_software_raid_state(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
kernel_search_debugfs(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
kernel_read_messages(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
corecmd_exec_all_executables(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
dev_getattr_all_chr_files(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
dev_getattr_all_blk_files(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
dev_getattr_generic_chr_files(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
dev_getattr_generic_blk_files(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
dev_getattr_mtrr_dev(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
dev_read_rand(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
dev_read_urand(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
dev_read_raw_memory(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
dev_read_sysfs(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
domain_getattr_all_domains(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
domain_read_all_domains_state(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
domain_getattr_all_sockets(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
domain_getattr_all_pipes(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
domain_signull_all_domains(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
# for blkid.tab
|
|
Dan Walsh |
3eaa99 |
files_manage_etc_runtime_files(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
files_etc_filetrans_etc_runtime(sosreport_t, file)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
files_getattr_all_sockets(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
files_exec_etc_files(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
files_list_all(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
files_read_config_files(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
files_read_etc_files(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
files_read_generic_tmp_files(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
files_read_usr_files(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
files_read_var_lib_files(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
files_read_var_symlinks(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
files_read_kernel_modules(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
files_read_all_symlinks(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
fs_getattr_all_fs(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
fs_list_inotifyfs(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
# cjp: some config files do not have configfile attribute
|
|
Dan Walsh |
3eaa99 |
# sosreport needs to read various files on system
|
|
Dan Walsh |
3eaa99 |
auth_read_all_files_except_shadow(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
auth_use_nsswitch(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
init_domtrans_script(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
libs_domtrans_ldconfig(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
logging_read_all_logs(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
logging_send_syslog_msg(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
miscfiles_read_localization(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
# needed by modinfo
|
|
Dan Walsh |
3eaa99 |
modutils_read_module_deps(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
sysnet_read_config(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
abrt_manage_pid_files(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
cups_stream_connect(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
dmesg_domtrans(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
fstools_domtrans(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
dbus_system_bus_client(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
hal_dbus_chat(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
lvm_domtrans(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
mount_domtrans(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
pulseaudio_stream_connect(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
rpm_exec(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
rpm_dontaudit_manage_db(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
rpm_read_db(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
xserver_stream_connect(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
ifdef(`enforcing',`
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
unconfined_domain(sosreport_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
', `
|
|
Dan Walsh |
3eaa99 |
permissive sosreport_t;
|
|
Dan Walsh |
3eaa99 |
')
|