|
Chris PeBenito |
9570b2 |
policy_module(yam, 1.4.0)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Declarations
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type yam_t alias yam_crond_t;
|
|
Chris PeBenito |
17de1b |
type yam_exec_t;
|
|
Chris PeBenito |
0bfccd |
application_domain(yam_t, yam_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type yam_content_t;
|
|
Chris PeBenito |
17de1b |
files_mountpoint(yam_content_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type yam_etc_t;
|
|
Chris PeBenito |
17de1b |
files_config_file(yam_etc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type yam_tmp_t;
|
|
Chris PeBenito |
17de1b |
files_tmp_file(yam_tmp_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow yam_t self:capability { chown fowner fsetid dac_override };
|
|
Chris PeBenito |
17de1b |
allow yam_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
|
|
Chris PeBenito |
17de1b |
allow yam_t self:process execmem;
|
|
Chris PeBenito |
17de1b |
allow yam_t self:fd use;
|
|
Chris PeBenito |
c0868a |
allow yam_t self:fifo_file rw_fifo_file_perms;
|
|
Chris PeBenito |
17de1b |
allow yam_t self:unix_stream_socket { create_stream_socket_perms connectto };
|
|
Chris PeBenito |
17de1b |
allow yam_t self:unix_dgram_socket { create_socket_perms sendto };
|
|
Chris PeBenito |
17de1b |
allow yam_t self:shm create_shm_perms;
|
|
Chris PeBenito |
17de1b |
allow yam_t self:sem create_sem_perms;
|
|
Chris PeBenito |
17de1b |
allow yam_t self:msgq create_msgq_perms;
|
|
Chris PeBenito |
17de1b |
allow yam_t self:msg { send receive };
|
|
Chris PeBenito |
17de1b |
allow yam_t self:tcp_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Update the content being managed by yam.
|
|
Chris PeBenito |
0bfccd |
manage_dirs_pattern(yam_t, yam_content_t, yam_content_t)
|
|
Chris PeBenito |
0bfccd |
manage_files_pattern(yam_t, yam_content_t, yam_content_t)
|
|
Chris PeBenito |
0bfccd |
manage_lnk_files_pattern(yam_t, yam_content_t, yam_content_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
0b36a2 |
allow yam_t yam_etc_t:file read_file_perms;
|
|
Chris PeBenito |
17de1b |
files_search_etc(yam_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
0bfccd |
manage_files_pattern(yam_t, yam_tmp_t, yam_tmp_t)
|
|
Chris PeBenito |
0bfccd |
manage_dirs_pattern(yam_t, yam_tmp_t, yam_tmp_t)
|
|
Chris PeBenito |
17de1b |
files_tmp_filetrans(yam_t, yam_tmp_t, { file dir })
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_kernel_sysctls(yam_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_proc_symlinks(yam_t)
|
|
Chris PeBenito |
17de1b |
# Python works fine without reading /proc/meminfo
|
|
Chris PeBenito |
17de1b |
kernel_dontaudit_read_system_state(yam_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corecmd_exec_shell(yam_t)
|
|
Chris PeBenito |
17de1b |
corecmd_exec_bin(yam_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Rsync and lftp need to network. They also set files attributes to
|
|
Chris PeBenito |
17de1b |
# match whats on the remote server.
|
|
Chris PeBenito |
190066 |
corenet_all_recvfrom_unlabeled(yam_t)
|
|
Chris PeBenito |
190066 |
corenet_all_recvfrom_netlabel(yam_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_generic_if(yam_t)
|
|
Chris PeBenito |
c12621 |
corenet_tcp_sendrecv_generic_node(yam_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_ports(yam_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_connect_http_port(yam_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_connect_rsync_port(yam_t)
|
|
Chris PeBenito |
17de1b |
corenet_sendrecv_http_client_packets(yam_t)
|
|
Chris PeBenito |
17de1b |
corenet_sendrecv_rsync_client_packets(yam_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# mktemp
|
|
Chris PeBenito |
17de1b |
dev_read_urand(yam_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(yam_t)
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files(yam_t)
|
|
Chris PeBenito |
17de1b |
# /usr/share/createrepo/genpkgmetadata.py:
|
|
Chris PeBenito |
17de1b |
files_exec_usr_files(yam_t)
|
|
Chris PeBenito |
17de1b |
# Programs invoked to build package lists need various permissions.
|
|
Chris PeBenito |
17de1b |
# genpkglist creates tmp files in /var/cache/apt/genpkglist
|
|
Chris PeBenito |
17de1b |
files_rw_var_files(yam_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
fs_search_auto_mountpoints(yam_t)
|
|
Chris PeBenito |
17de1b |
# Content can also be on ISO image files.
|
|
Chris PeBenito |
17de1b |
fs_read_iso9660_files(yam_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(yam_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(yam_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
seutil_read_config(yam_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
sysnet_dns_name_resolve(yam_t)
|
|
Chris PeBenito |
17de1b |
sysnet_read_config(yam_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
296273 |
userdom_use_user_terminals(yam_t)
|
|
Chris PeBenito |
17de1b |
userdom_use_unpriv_users_fds(yam_t)
|
|
Chris PeBenito |
17de1b |
# Reading dotfiles...
|
|
Chris PeBenito |
17de1b |
# cjp: ?
|
|
Chris PeBenito |
296273 |
userdom_search_user_home_dirs(yam_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# The whole point of this program is to make updates available on a
|
|
Chris PeBenito |
17de1b |
# local web server. Need to go through /var to get to /var/yam
|
|
Chris PeBenito |
17de1b |
# Go through /var/www to get to /var/www/yam
|
|
Chris PeBenito |
17de1b |
apache_search_sys_content(yam_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
0bfccd |
cron_system_entry(yam_t, yam_exec_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
mount_domtrans(yam_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
nis_use_ypbind(yam_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
nscd_socket_use(yam_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
rsync_exec(yam_t)
|
|
Chris PeBenito |
17de1b |
')
|