Chris PeBenito f30e6e
Chris PeBenito f30e6e
policy_module(yam,1.0.0)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
########################################
Chris PeBenito f30e6e
#
Chris PeBenito f30e6e
# Declarations
Chris PeBenito f30e6e
#
Chris PeBenito f30e6e
Chris PeBenito f30e6e
type yam_t alias yam_crond_t;
Chris PeBenito f30e6e
type yam_exec_t;
Chris PeBenito f30e6e
domain_type(yam_t)
Chris PeBenito f30e6e
domain_entry_file(yam_t,yam_exec_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
type yam_content_t;
Chris PeBenito f30e6e
files_mountpoint(yam_content_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
type yam_etc_t;
Chris PeBenito f30e6e
files_config_file(yam_etc_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
type yam_tmp_t;
Chris PeBenito f30e6e
files_tmp_file(yam_tmp_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
########################################
Chris PeBenito f30e6e
#
Chris PeBenito f30e6e
# Local policy
Chris PeBenito f30e6e
#
Chris PeBenito f30e6e
Chris PeBenito f30e6e
allow yam_t self:capability { chown fowner fsetid dac_override };
Chris PeBenito f30e6e
allow yam_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito f30e6e
allow yam_t self:process execmem;
Chris PeBenito f30e6e
allow yam_t self:fd use;
Chris PeBenito f30e6e
allow yam_t self:fifo_file rw_file_perms;
Chris PeBenito f30e6e
allow yam_t self:unix_stream_socket { create_stream_socket_perms connectto };
Chris PeBenito f30e6e
allow yam_t self:unix_dgram_socket { create_socket_perms sendto };
Chris PeBenito f30e6e
allow yam_t self:shm create_shm_perms;
Chris PeBenito f30e6e
allow yam_t self:sem create_sem_perms;
Chris PeBenito f30e6e
allow yam_t self:msgq create_msgq_perms;
Chris PeBenito f30e6e
allow yam_t self:msg { send receive };
Chris PeBenito f30e6e
allow yam_t self:tcp_socket create_socket_perms;
Chris PeBenito f30e6e
allow yam_t self:udp_socket create_socket_perms;
Chris PeBenito f30e6e
Chris PeBenito f30e6e
# Update the content being managed by yam.
Chris PeBenito f30e6e
allow yam_t yam_content_t:dir create_dir_perms;
Chris PeBenito f30e6e
allow yam_t yam_content_t:file create_file_perms;
Chris PeBenito f30e6e
allow yam_t yam_content_t:lnk_file create_lnk_perms;
Chris PeBenito f30e6e
Chris PeBenito f30e6e
allow yam_t yam_etc_t:file { getattr read };
Chris PeBenito f30e6e
files_search_etc(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
allow yam_t yam_tmp_t:dir create_dir_perms;
Chris PeBenito f30e6e
allow yam_t yam_tmp_t:file create_file_perms;
Chris PeBenito f30e6e
files_tmp_filetrans(yam_t, yam_tmp_t, { file dir })
Chris PeBenito f30e6e
Chris PeBenito f30e6e
kernel_read_kernel_sysctls(yam_t)
Chris PeBenito f30e6e
kernel_read_proc_symlinks(yam_t)
Chris PeBenito f30e6e
# Python works fine without reading /proc/meminfo
Chris PeBenito f30e6e
kernel_dontaudit_read_system_state(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
corecmd_exec_shell(yam_t)
Chris PeBenito f30e6e
corecmd_exec_bin(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
# Rsync and lftp need to network.  They also set files attributes to
Chris PeBenito f30e6e
# match whats on the remote server.
Chris PeBenito f30e6e
corenet_tcp_sendrecv_generic_if(yam_t)
Chris PeBenito f30e6e
corenet_udp_sendrecv_generic_if(yam_t)
Chris PeBenito f30e6e
corenet_raw_sendrecv_generic_if(yam_t)
Chris PeBenito f30e6e
corenet_tcp_sendrecv_all_nodes(yam_t)
Chris PeBenito f30e6e
corenet_udp_sendrecv_all_nodes(yam_t)
Chris PeBenito f30e6e
corenet_raw_sendrecv_all_nodes(yam_t)
Chris PeBenito f30e6e
corenet_tcp_sendrecv_all_ports(yam_t)
Chris PeBenito f30e6e
corenet_udp_sendrecv_all_ports(yam_t)
Chris PeBenito f30e6e
corenet_non_ipsec_sendrecv(yam_t)
Chris PeBenito f30e6e
corenet_tcp_bind_all_nodes(yam_t)
Chris PeBenito f30e6e
corenet_udp_bind_all_nodes(yam_t)
Chris PeBenito f30e6e
corenet_tcp_connect_http_port(yam_t)
Chris PeBenito f30e6e
corenet_tcp_connect_rsync_port(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
# mktemp
Chris PeBenito f30e6e
dev_read_urand(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
files_read_etc_files(yam_t)
Chris PeBenito f30e6e
files_read_etc_runtime_files(yam_t)
Chris PeBenito f30e6e
# /usr/share/createrepo/genpkgmetadata.py:
Chris PeBenito f30e6e
files_exec_usr_files(yam_t)
Chris PeBenito f30e6e
# Programs invoked to build package lists need various permissions.
Chris PeBenito f30e6e
# genpkglist creates tmp files in /var/cache/apt/genpkglist
Chris PeBenito f30e6e
files_rw_var_files(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
fs_search_auto_mountpoints(yam_t)
Chris PeBenito f30e6e
# Content can also be on ISO image files.
Chris PeBenito f30e6e
fs_read_iso9660_files(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
term_search_ptys(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
libs_use_ld_so(yam_t)
Chris PeBenito f30e6e
libs_use_shared_libs(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
logging_send_syslog_msg(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
miscfiles_read_localization(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
seutil_read_config(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
sysnet_read_config(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
userdom_use_unpriv_users_fds(yam_t)
Chris PeBenito f30e6e
# Reading dotfiles...
Chris PeBenito f30e6e
# cjp: ?
Chris PeBenito f30e6e
userdom_search_all_users_home_dirs(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
# The whole point of this program is to make updates available on a
Chris PeBenito f30e6e
# local web server.  Need to go through /var to get to /var/yam
Chris PeBenito f30e6e
# Go through /var/www to get to /var/www/yam
Chris PeBenito f30e6e
apache_search_sys_content(yam_t)
Chris PeBenito f30e6e
Chris PeBenito f30e6e
optional_policy(`
Chris PeBenito f30e6e
	cron_system_entry(yam_t,yam_exec_t)
Chris PeBenito f30e6e
')
Chris PeBenito f30e6e
Chris PeBenito f30e6e
optional_policy(`
Chris PeBenito f30e6e
	mount_domtrans(yam_t)
Chris PeBenito f30e6e
')
Chris PeBenito f30e6e
Chris PeBenito f30e6e
optional_policy(`
Chris PeBenito f30e6e
	nis_use_ypbind(yam_t)
Chris PeBenito f30e6e
')
Chris PeBenito f30e6e
Chris PeBenito f30e6e
optional_policy(`
Chris PeBenito f30e6e
	nscd_socket_use(yam_t)
Chris PeBenito f30e6e
')
Chris PeBenito f30e6e
Chris PeBenito f30e6e
optional_policy(`
Chris PeBenito f30e6e
	rsync_exec(yam_t)
Chris PeBenito f30e6e
')