selinux-refpolicy/policy/modules/apps/wireshark.te
Stephen Smalley 161bda392e access_vectors: Remove unused permissions
Remove unused permission definitions from SELinux.
Many of these were only ever used in pre-mainline
versions of SELinux, prior to Linux 2.6.0.  Some of them
were used in the legacy network or compat_net=1 checks
that were disabled by default in Linux 2.6.18 and
fully removed in Linux 2.6.30.

The corresponding classmap declarations were removed from the
mainline kernel in:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=42a9699a9fa179c0054ea3cf5ad3cc67104a6162

Permissions never used in mainline Linux:
file swapon
filesystem transition
tcp_socket { connectto newconn acceptfrom }
node enforce_dest
unix_stream_socket { newconn acceptfrom }

Legacy network checks, removed in 2.6.30:
socket { recv_msg send_msg }
node { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send }
netif { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send }

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2020-01-14 13:41:50 -05:00

124 lines
3.5 KiB
Plaintext

policy_module(wireshark, 2.7.1)
########################################
#
# Declarations
#
attribute_role wireshark_roles;
type wireshark_t;
type wireshark_exec_t;
userdom_user_application_domain(wireshark_t, wireshark_exec_t)
role wireshark_roles types wireshark_t;
type wireshark_home_t;
userdom_user_home_content(wireshark_home_t)
type wireshark_tmp_t;
userdom_user_tmp_file(wireshark_tmp_t)
type wireshark_tmpfs_t;
userdom_user_tmpfs_file(wireshark_tmpfs_t)
optional_policy(`
wm_application_domain(wireshark_t, wireshark_exec_t)
')
##############################
#
# Local Policy
#
allow wireshark_t self:capability { net_admin net_raw setgid };
allow wireshark_t self:process { signal getsched };
allow wireshark_t self:fifo_file rw_fifo_file_perms;
allow wireshark_t self:shm create_shm_perms;
allow wireshark_t self:packet_socket create_socket_perms;
manage_dirs_pattern(wireshark_t, wireshark_home_t, wireshark_home_t)
manage_files_pattern(wireshark_t, wireshark_home_t, wireshark_home_t)
manage_lnk_files_pattern(wireshark_t, wireshark_home_t, wireshark_home_t)
userdom_user_home_dir_filetrans(wireshark_t, wireshark_home_t, dir, ".wireshark")
manage_dirs_pattern(wireshark_t, wireshark_tmp_t, wireshark_tmp_t)
manage_files_pattern(wireshark_t, wireshark_tmp_t, wireshark_tmp_t)
files_tmp_filetrans(wireshark_t, wireshark_tmp_t, { dir file })
manage_dirs_pattern(wireshark_t, wireshark_tmpfs_t, wireshark_tmpfs_t)
manage_files_pattern(wireshark_t, wireshark_tmpfs_t, wireshark_tmpfs_t)
manage_lnk_files_pattern(wireshark_t, wireshark_tmpfs_t, wireshark_tmpfs_t)
manage_sock_files_pattern(wireshark_t, wireshark_tmpfs_t, wireshark_tmpfs_t)
manage_fifo_files_pattern(wireshark_t, wireshark_tmpfs_t, wireshark_tmpfs_t)
fs_tmpfs_filetrans(wireshark_t, wireshark_tmpfs_t, { dir file lnk_file sock_file fifo_file })
can_exec(wireshark_t, wireshark_exec_t)
kernel_read_kernel_sysctls(wireshark_t)
kernel_read_system_state(wireshark_t)
kernel_read_sysctl(wireshark_t)
corecmd_exec_bin(wireshark_t)
corenet_all_recvfrom_unlabeled(wireshark_t)
corenet_all_recvfrom_netlabel(wireshark_t)
corenet_tcp_sendrecv_generic_if(wireshark_t)
corenet_udp_sendrecv_generic_if(wireshark_t)
corenet_raw_sendrecv_generic_if(wireshark_t)
corenet_tcp_sendrecv_generic_node(wireshark_t)
corenet_udp_sendrecv_generic_node(wireshark_t)
corenet_raw_sendrecv_generic_node(wireshark_t)
corenet_sendrecv_generic_client_packets(wireshark_t)
corenet_tcp_connect_generic_port(wireshark_t)
dev_read_rand(wireshark_t)
dev_read_sysfs(wireshark_t)
dev_read_urand(wireshark_t)
files_map_usr_files(wireshark_t)
files_read_usr_files(wireshark_t)
fs_getattr_all_fs(wireshark_t)
fs_list_inotifyfs(wireshark_t)
fs_search_auto_mountpoints(wireshark_t)
auth_use_nsswitch(wireshark_t)
libs_read_lib_files(wireshark_t)
miscfiles_read_fonts(wireshark_t)
miscfiles_read_localization(wireshark_t)
userdom_use_user_terminals(wireshark_t)
userdom_user_content_access_template(wireshark, wireshark_t)
xdg_read_downloads(wireshark_t)
tunable_policy(`use_nfs_home_dirs',`
fs_manage_nfs_dirs(wireshark_t)
fs_manage_nfs_files(wireshark_t)
fs_manage_nfs_symlinks(wireshark_t)
')
tunable_policy(`use_samba_home_dirs',`
fs_manage_cifs_dirs(wireshark_t)
fs_manage_cifs_files(wireshark_t)
fs_manage_cifs_symlinks(wireshark_t)
')
optional_policy(`
seutil_use_newrole_fds(wireshark_t)
')
optional_policy(`
userhelper_use_fd(wireshark_t)
userhelper_sigchld(wireshark_t)
')
optional_policy(`
xserver_user_x_domain_template(wireshark, wireshark_t, wireshark_tmpfs_t)
xserver_create_xdm_tmp_sockets(wireshark_t)
')