Chris PeBenito 6cd6d7
Chris PeBenito c12621
policy_module(gift, 2.0.1)
Chris PeBenito 6cd6d7
Chris PeBenito 6cd6d7
########################################
Chris PeBenito 6cd6d7
#
Chris PeBenito 6cd6d7
# Declarations
Chris PeBenito 6cd6d7
#
Chris PeBenito 6cd6d7
Chris PeBenito 296273
type gift_t;
Chris PeBenito 6cd6d7
type gift_exec_t;
Chris PeBenito 296273
typealias gift_t alias { user_gift_t staff_gift_t sysadm_gift_t };
Chris PeBenito 296273
typealias gift_t alias { auditadm_gift_t secadm_gift_t };
Chris PeBenito 296273
application_domain(gift_t, gift_exec_t)
Chris PeBenito 296273
ubac_constrained(gift_t)
Chris PeBenito 6cd6d7
Chris PeBenito 296273
type gift_home_t;
Chris PeBenito 296273
typealias gift_home_t alias { user_gift_home_t staff_gift_home_t sysadm_gift_home_t };
Chris PeBenito 296273
typealias gift_home_t alias { auditadm_gift_home_t secadm_gift_home_t };
Chris PeBenito 296273
files_poly_member(gift_home_t)
Chris PeBenito 296273
userdom_user_home_content(gift_home_t)
Chris PeBenito 296273
Chris PeBenito 296273
type gift_tmpfs_t;
Chris PeBenito 296273
typealias gift_tmpfs_t alias { user_gift_tmpfs_t staff_gift_tmpfs_t sysadm_gift_tmpfs_t };
Chris PeBenito 296273
typealias gift_tmpfs_t alias { auditadm_gift_tmpfs_t secadm_gift_tmpfs_t };
Chris PeBenito 296273
files_tmpfs_file(gift_tmpfs_t)
Chris PeBenito 296273
ubac_constrained(gift_tmpfs_t)
Chris PeBenito 296273
Chris PeBenito 296273
type giftd_t;
Chris PeBenito 6cd6d7
type giftd_exec_t;
Chris PeBenito 296273
typealias giftd_t alias { user_giftd_t staff_giftd_t sysadm_giftd_t };
Chris PeBenito 296273
typealias giftd_t alias { auditadm_giftd_t secadm_giftd_t };
Chris PeBenito 296273
application_domain(giftd_t, giftd_exec_t)
Chris PeBenito 296273
ubac_constrained(giftd_t)
Chris PeBenito 296273
Chris PeBenito 296273
##############################
Chris PeBenito 296273
#
Chris PeBenito 296273
# giFT user interface local policy
Chris PeBenito 296273
#
Chris PeBenito 296273
Chris PeBenito 296273
allow gift_t self:tcp_socket create_socket_perms;
Chris PeBenito 296273
Chris PeBenito 296273
manage_files_pattern(gift_t, gift_tmpfs_t, gift_tmpfs_t)
Chris PeBenito 296273
manage_lnk_files_pattern(gift_t, gift_tmpfs_t, gift_tmpfs_t)
Chris PeBenito 296273
manage_fifo_files_pattern(gift_t, gift_tmpfs_t, gift_tmpfs_t)
Chris PeBenito 296273
manage_sock_files_pattern(gift_t, gift_tmpfs_t, gift_tmpfs_t)
Chris PeBenito 296273
fs_tmpfs_filetrans(gift_t, gift_tmpfs_t, { dir file lnk_file sock_file fifo_file })
Chris PeBenito 296273
Chris PeBenito 296273
manage_dirs_pattern(gift_t, gift_home_t, gift_home_t)
Chris PeBenito 296273
manage_files_pattern(gift_t, gift_home_t, gift_home_t)
Chris PeBenito 296273
manage_lnk_files_pattern(gift_t, gift_home_t, gift_home_t)
Chris PeBenito 296273
userdom_user_home_dir_filetrans(gift_t, gift_home_t, dir)
Chris PeBenito 296273
Chris PeBenito 296273
# Launch gift daemon
Chris PeBenito 296273
domtrans_pattern(gift_t, giftd_exec_t, giftd_t)
Chris PeBenito 296273
Chris PeBenito 296273
# Read /proc/meminfo
Chris PeBenito 296273
kernel_read_system_state(giftd_t)
Chris PeBenito 296273
Chris PeBenito 296273
# Connect to gift daemon
Chris PeBenito 296273
corenet_all_recvfrom_unlabeled(gift_t)
Chris PeBenito 296273
corenet_all_recvfrom_netlabel(gift_t)
Chris PeBenito 296273
corenet_tcp_sendrecv_generic_if(gift_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(gift_t)
Chris PeBenito 296273
corenet_tcp_sendrecv_giftd_port(gift_t)
Chris PeBenito 296273
corenet_tcp_connect_giftd_port(gift_t)
Chris PeBenito 296273
corenet_sendrecv_giftd_client_packets(gift_t)
Chris PeBenito 296273
Chris PeBenito 296273
fs_search_auto_mountpoints(gift_t)
Chris PeBenito 296273
Chris PeBenito 296273
sysnet_read_config(gift_t)
Chris PeBenito 296273
Chris PeBenito 296273
# giftui looks in .icons, .themes.
Chris PeBenito 296273
userdom_dontaudit_read_user_home_content_files(gift_t)
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 296273
	fs_manage_nfs_dirs(gift_t)
Chris PeBenito 296273
	fs_manage_nfs_files(gift_t)
Chris PeBenito 296273
	fs_manage_nfs_symlinks(gift_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 296273
	fs_manage_cifs_dirs(gift_t)
Chris PeBenito 296273
	fs_manage_cifs_files(gift_t)
Chris PeBenito 296273
	fs_manage_cifs_symlinks(gift_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	nscd_socket_use(gift_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	xserver_user_x_domain_template(gift, gift_t, gift_tmpfs_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
##############################
Chris PeBenito 296273
#
Chris PeBenito 296273
# giFT server local policy
Chris PeBenito 296273
#
Chris PeBenito 296273
Chris PeBenito 296273
allow giftd_t self:process { signal setsched };
Chris PeBenito 296273
allow giftd_t self:unix_stream_socket create_socket_perms;
Chris PeBenito 296273
allow giftd_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 296273
allow giftd_t self:udp_socket create_socket_perms;
Chris PeBenito 296273
Chris PeBenito 296273
manage_dirs_pattern(giftd_t, gift_home_t, gift_home_t)
Chris PeBenito 296273
manage_files_pattern(giftd_t, gift_home_t, gift_home_t)
Chris PeBenito 296273
manage_lnk_files_pattern(giftd_t, gift_home_t, gift_home_t)
Chris PeBenito 296273
userdom_user_home_dir_filetrans(giftd_t, gift_home_t, dir)
Chris PeBenito 296273
Chris PeBenito 296273
kernel_read_system_state(giftd_t)
Chris PeBenito 296273
kernel_read_kernel_sysctls(giftd_t)
Chris PeBenito 296273
Chris PeBenito 296273
# Serve content on various p2p networks. Ports can be random.
Chris PeBenito 296273
corenet_all_recvfrom_unlabeled(giftd_t)
Chris PeBenito 296273
corenet_all_recvfrom_netlabel(giftd_t)
Chris PeBenito 296273
corenet_tcp_sendrecv_generic_if(giftd_t)
Chris PeBenito 296273
corenet_udp_sendrecv_generic_if(giftd_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(giftd_t)
Chris PeBenito c12621
corenet_udp_sendrecv_generic_node(giftd_t)
Chris PeBenito 296273
corenet_tcp_sendrecv_all_ports(giftd_t)
Chris PeBenito 296273
corenet_udp_sendrecv_all_ports(giftd_t)
Chris PeBenito c12621
corenet_tcp_bind_generic_node(giftd_t)
Chris PeBenito c12621
corenet_udp_bind_generic_node(giftd_t)
Chris PeBenito 296273
corenet_tcp_bind_all_ports(giftd_t)
Chris PeBenito 296273
corenet_udp_bind_all_ports(giftd_t)
Chris PeBenito 296273
corenet_tcp_connect_all_ports(giftd_t)
Chris PeBenito 296273
corenet_sendrecv_all_client_packets(giftd_t)
Chris PeBenito 296273
Chris PeBenito 296273
files_read_usr_files(giftd_t)
Chris PeBenito 296273
# Read /etc/mtab
Chris PeBenito 296273
files_read_etc_runtime_files(giftd_t)
Chris PeBenito 296273
Chris PeBenito 296273
miscfiles_read_localization(giftd_t)
Chris PeBenito 296273
Chris PeBenito 296273
sysnet_read_config(giftd_t)
Chris PeBenito 296273
Chris PeBenito 296273
userdom_use_user_terminals(giftd_t)
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 296273
	fs_manage_nfs_dirs(giftd_t)
Chris PeBenito 296273
	fs_manage_nfs_files(giftd_t)
Chris PeBenito 296273
	fs_manage_nfs_symlinks(giftd_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 296273
	fs_manage_cifs_dirs(giftd_t)
Chris PeBenito 296273
	fs_manage_cifs_files(giftd_t)
Chris PeBenito 296273
	fs_manage_cifs_symlinks(giftd_t)
Chris PeBenito 296273
')