|
Chris PeBenito |
17de1b |
## <summary>Periodic execution of scheduled commands.</summary>
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
#######################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
bbcd3c |
## The per role template for the cron module.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <desc>
|
|
Chris PeBenito |
17de1b |
##
|
|
Chris PeBenito |
17de1b |
## This template creates a derived domains which are used
|
|
Chris PeBenito |
17de1b |
## for running programs on behalf of the user, from cron.
|
|
Chris PeBenito |
17de1b |
## A type for the user crontab is also created.
|
|
Chris PeBenito |
17de1b |
##
|
|
Chris PeBenito |
17de1b |
##
|
|
Chris PeBenito |
17de1b |
## This template is invoked automatically for each user, and
|
|
Chris PeBenito |
17de1b |
## generally does not need to be invoked directly
|
|
Chris PeBenito |
17de1b |
## by policy writers.
|
|
Chris PeBenito |
17de1b |
##
|
|
Chris PeBenito |
17de1b |
## </desc>
|
|
Chris PeBenito |
17de1b |
## <param name="userdomain_prefix">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## The prefix of the user domain (e.g., user
|
|
Chris PeBenito |
17de1b |
## is the prefix for user_t).
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
## <param name="user_domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## The type of the user domain.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
## <param name="user_role">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## The role associated with the user domain.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
bbcd3c |
template(`cron_per_role_template',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
attribute cron_spool_type;
|
|
Chris PeBenito |
17de1b |
type crond_t, cron_spool_t, crontab_exec_t;
|
|
Chris PeBenito |
b1a903 |
class dbus send_msg;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Type of user crontabs once moved to cron spool.
|
|
Chris PeBenito |
17de1b |
type $1_cron_spool_t, cron_spool_type;
|
|
Chris PeBenito |
17de1b |
files_type($1_cron_spool_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type $1_crond_t;
|
|
Chris PeBenito |
17de1b |
domain_type($1_crond_t)
|
|
Chris PeBenito |
17de1b |
domain_cron_exemption_target($1_crond_t)
|
|
Chris PeBenito |
17de1b |
corecmd_shell_entry_type($1_crond_t)
|
|
Chris PeBenito |
17de1b |
role $3 types $1_crond_t;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type $1_crontab_t;
|
|
Chris PeBenito |
0bfccd |
application_domain($1_crontab_t, crontab_exec_t)
|
|
Chris PeBenito |
17de1b |
role $3 types $1_crontab_t;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
5dbda5 |
type $1_crontab_tmp_t;
|
|
Chris PeBenito |
5dbda5 |
files_tmp_file($1_crontab_tmp_t)
|
|
Chris PeBenito |
5dbda5 |
|
|
Chris PeBenito |
17de1b |
##############################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# $1_crond_t local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow $1_crond_t self:capability dac_override;
|
|
Chris PeBenito |
17de1b |
allow $1_crond_t self:process { signal_perms setsched };
|
|
Chris PeBenito |
c0868a |
allow $1_crond_t self:fifo_file rw_fifo_file_perms;
|
|
Chris PeBenito |
17de1b |
allow $1_crond_t self:unix_stream_socket create_stream_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow $1_crond_t self:unix_dgram_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# The entrypoint interface is not used as this is not
|
|
Chris PeBenito |
17de1b |
# a regular entrypoint. Since crontab files are
|
|
Chris PeBenito |
17de1b |
# not directly executed, crond must ensure that
|
|
Chris PeBenito |
17de1b |
# the crontab file has a type that is appropriate
|
|
Chris PeBenito |
17de1b |
# for the domain of the user cron job. It
|
|
Chris PeBenito |
17de1b |
# performs an entrypoint permission check
|
|
Chris PeBenito |
17de1b |
# for this purpose.
|
|
Chris PeBenito |
17de1b |
allow $1_crond_t $1_cron_spool_t:file entrypoint;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Permit a transition from the crond_t domain to this domain.
|
|
Chris PeBenito |
17de1b |
# The transition is requested explicitly by the modified crond
|
|
Chris PeBenito |
17de1b |
# via setexeccon. There is no way to set up an automatic
|
|
Chris PeBenito |
17de1b |
# transition, since crontabs are configuration files, not executables.
|
|
Chris PeBenito |
17de1b |
allow crond_t $1_crond_t:process transition;
|
|
Chris PeBenito |
17de1b |
dontaudit crond_t $1_crond_t:process { noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
17de1b |
allow crond_t $1_crond_t:fd use;
|
|
Chris PeBenito |
17de1b |
allow $1_crond_t crond_t:fd use;
|
|
Chris PeBenito |
17de1b |
allow $1_crond_t crond_t:fifo_file rw_file_perms;
|
|
Chris PeBenito |
17de1b |
allow $1_crond_t crond_t:process sigchld;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state($1_crond_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_kernel_sysctls($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# ps does not need to access /boot when run from cron
|
|
Chris PeBenito |
17de1b |
files_dontaudit_search_boot($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
190066 |
corenet_all_recvfrom_unlabeled($1_crond_t)
|
|
Chris PeBenito |
190066 |
corenet_all_recvfrom_netlabel($1_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_if($1_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_if($1_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_nodes($1_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_nodes($1_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_ports($1_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_ports($1_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_connect_all_ports($1_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_sendrecv_all_client_packets($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dev_read_urand($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
fs_getattr_all_fs($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corecmd_exec_all_executables($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# quiet other ps operations
|
|
Chris PeBenito |
17de1b |
domain_dontaudit_read_all_domains_state($1_crond_t)
|
|
Chris PeBenito |
17de1b |
domain_dontaudit_getattr_all_domains($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_usr_files($1_crond_t)
|
|
Chris PeBenito |
17de1b |
files_exec_etc_files($1_crond_t)
|
|
Chris PeBenito |
17de1b |
# for nscd:
|
|
Chris PeBenito |
17de1b |
files_dontaudit_search_pids($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so($1_crond_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs($1_crond_t)
|
|
Chris PeBenito |
17de1b |
libs_exec_lib_files($1_crond_t)
|
|
Chris PeBenito |
17de1b |
libs_exec_ld_so($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files($1_crond_t)
|
|
Chris PeBenito |
17de1b |
files_read_var_files($1_crond_t)
|
|
Chris PeBenito |
17de1b |
files_search_spool($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_search_logs($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
seutil_read_config($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
0bfccd |
userdom_manage_user_tmp_files($1, $1_crond_t)
|
|
Chris PeBenito |
0bfccd |
userdom_manage_user_tmp_symlinks($1, $1_crond_t)
|
|
Chris PeBenito |
0bfccd |
userdom_manage_user_tmp_pipes($1, $1_crond_t)
|
|
Chris PeBenito |
0bfccd |
userdom_manage_user_tmp_sockets($1, $1_crond_t)
|
|
Chris PeBenito |
17de1b |
# Run scripts in user home directory and access shared libs.
|
|
Chris PeBenito |
0bfccd |
userdom_exec_user_home_content_files($1, $1_crond_t)
|
|
Chris PeBenito |
17de1b |
# Access user files and dirs.
|
|
Chris PeBenito |
17de1b |
# userdom_manage_user_home_subdir_dirs($1,$1_crond_t)
|
|
Chris PeBenito |
0bfccd |
userdom_manage_user_home_content_files($1, $1_crond_t)
|
|
Chris PeBenito |
0bfccd |
userdom_manage_user_home_content_symlinks($1, $1_crond_t)
|
|
Chris PeBenito |
0bfccd |
userdom_manage_user_home_content_pipes($1, $1_crond_t)
|
|
Chris PeBenito |
0bfccd |
userdom_manage_user_home_content_sockets($1, $1_crond_t)
|
|
Chris PeBenito |
17de1b |
# userdom_user_home_dir_filetrans_user_home_content($1,$1_crond_t,notdevfile_class_set)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
tunable_policy(`fcron_crond', `
|
|
Chris PeBenito |
c0868a |
allow crond_t $1_cron_spool_t:file manage_file_perms;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
350b6a |
# need a per-role version of this:
|
|
Chris PeBenito |
350b6a |
#optional_policy(`
|
|
Chris PeBenito |
350b6a |
# mono_domtrans($1_crond_t)
|
|
Chris PeBenito |
350b6a |
#')
|
|
Chris PeBenito |
350b6a |
|
|
Chris PeBenito |
350b6a |
optional_policy(`
|
|
Chris PeBenito |
350b6a |
dbus_stub($1_crond_t)
|
|
Chris PeBenito |
350b6a |
|
|
Chris PeBenito |
350b6a |
allow $1_crond_t $2:dbus send_msg;
|
|
Chris PeBenito |
350b6a |
')
|
|
Chris PeBenito |
350b6a |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
nis_use_ypbind($1_crond_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
ifdef(`TODO',`
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
create_dir_file($1_crond_t, httpd_$1_content_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
allow $1_crond_t tmp_t:dir rw_dir_perms;
|
|
Chris PeBenito |
17de1b |
type_transition $1_crond_t $1_tmp_t:{ file lnk_file sock_file fifo_file } $1_tmp_t;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
ifdef(`mta.te', `
|
|
Chris PeBenito |
17de1b |
domain_auto_trans($1_crond_t, sendmail_exec_t, $1_mail_t)
|
|
Chris PeBenito |
ef659a |
allow $1_crond_t sendmail_exec_t:lnk_file read_lnk_file_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# $1_mail_t should only be reading from the cron fifo not needing to write
|
|
Chris PeBenito |
17de1b |
dontaudit $1_mail_t crond_t:fifo_file write;
|
|
Chris PeBenito |
17de1b |
allow mta_user_agent $1_crond_t:fd use;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
') dnl endif TODO
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
##############################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# $1_crontab_t local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
5dbda5 |
# dac_override is to create the file in the directory under /tmp
|
|
Chris PeBenito |
5dbda5 |
allow $1_crontab_t self:capability { fowner setuid setgid chown dac_override };
|
|
Chris PeBenito |
5dbda5 |
allow $1_crontab_t self:process signal_perms;
|
|
Chris PeBenito |
5dbda5 |
|
|
Chris PeBenito |
17de1b |
# Transition from the user domain to the derived domain.
|
|
Chris PeBenito |
c0868a |
domtrans_pattern($2, crontab_exec_t, $1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# crontab shows up in user ps
|
|
Chris PeBenito |
0bfccd |
ps_process_pattern($2, $1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# for ^Z
|
|
Chris PeBenito |
17de1b |
allow $2 $1_crontab_t:process signal;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Allow crond to read those crontabs in cron spool.
|
|
Chris PeBenito |
c0868a |
allow crond_t $1_cron_spool_t:file manage_file_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
5dbda5 |
allow $1_crontab_t $1_crontab_tmp_t:file manage_file_perms;
|
|
Chris PeBenito |
0bfccd |
files_tmp_filetrans($1_crontab_t, $1_crontab_tmp_t, file)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# create files in /var/spool/cron
|
|
Chris PeBenito |
0bfccd |
manage_files_pattern($1_crontab_t, cron_spool_t, $1_cron_spool_t)
|
|
Chris PeBenito |
0bfccd |
filetrans_pattern($1_crontab_t, cron_spool_t, $1_cron_spool_t,file)
|
|
Chris PeBenito |
a5e213 |
files_search_spool($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# crontab signals crond by updating the mtime on the spooldir
|
|
Chris PeBenito |
17de1b |
allow $1_crontab_t cron_spool_t:dir setattr;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# for the checks used by crontab -u
|
|
Chris PeBenito |
17de1b |
selinux_dontaudit_search_fs($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
fs_getattr_xattr_fs($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Run helper programs as the user domain
|
|
Chris PeBenito |
0bfccd |
corecmd_bin_domtrans($1_crontab_t, $2)
|
|
Chris PeBenito |
0bfccd |
corecmd_shell_domtrans($1_crontab_t, $2)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_use_interactive_fds($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_files($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
files_dontaudit_search_pids($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
seutil_read_config($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
0bfccd |
userdom_manage_user_tmp_dirs($1, $1_crontab_t)
|
|
Chris PeBenito |
0bfccd |
userdom_manage_user_tmp_files($1, $1_crontab_t)
|
|
Chris PeBenito |
17de1b |
# Access terminals.
|
|
Chris PeBenito |
0bfccd |
userdom_use_user_terminals($1, $1_crontab_t)
|
|
Chris PeBenito |
17de1b |
# Read user crontabs
|
|
Chris PeBenito |
0bfccd |
userdom_read_user_home_content_files($1, $1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
a5e213 |
tunable_policy(`fcron_crond',`
|
|
Chris PeBenito |
17de1b |
# fcron wants an instant update of a crontab change for the administrator
|
|
Chris PeBenito |
17de1b |
# also crontab does a security check for crontab -u
|
|
Chris PeBenito |
17de1b |
dontaudit $1_crontab_t crond_t:process signal;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
a5e213 |
optional_policy(`
|
|
Chris PeBenito |
a5e213 |
nscd_socket_use($1_crontab_t)
|
|
Chris PeBenito |
a5e213 |
')
|
|
Chris PeBenito |
a5e213 |
|
|
Chris PeBenito |
17de1b |
ifdef(`TODO',`
|
|
Chris PeBenito |
17de1b |
# Read user crontabs
|
|
Chris PeBenito |
17de1b |
dontaudit $1_crontab_t $1_home_dir_t:dir write;
|
|
Chris PeBenito |
17de1b |
') dnl endif TODO
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
#######################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## The administrative functions template for the cron module.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <desc>
|
|
Chris PeBenito |
17de1b |
##
|
|
Chris PeBenito |
17de1b |
## This template creates rules for administrating the cron service,
|
|
Chris PeBenito |
17de1b |
## allowing the specified user to manage other user crontabs.
|
|
Chris PeBenito |
17de1b |
##
|
|
Chris PeBenito |
17de1b |
## </desc>
|
|
Chris PeBenito |
17de1b |
## <param name="userdomain_prefix">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## The prefix of the user domain (e.g., user
|
|
Chris PeBenito |
17de1b |
## is the prefix for user_t).
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
bbcd3c |
## <rolecap/>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
template(`cron_admin_template',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
attribute cron_spool_type;
|
|
Chris PeBenito |
17de1b |
type $1_crontab_t, $1_crond_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Allow our crontab domain to unlink a user cron spool file.
|
|
Chris PeBenito |
17de1b |
allow $1_crontab_t cron_spool_type:file { getattr read unlink };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_read_generic_logs($1_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Manipulate other users crontab.
|
|
Chris PeBenito |
17de1b |
selinux_get_fs_mount($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
selinux_validate_context($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_access_vector($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_create_context($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_relabel_context($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_user_contexts($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
tunable_policy(`fcron_crond', `
|
|
Chris PeBenito |
17de1b |
# fcron wants an instant update of a crontab change for the administrator
|
|
Chris PeBenito |
17de1b |
# also crontab does a security check for crontab -u
|
|
Chris PeBenito |
17de1b |
allow $1_crontab_t self:process setfscreate;
|
|
Chris PeBenito |
17de1b |
selinux_get_fs_mount($1_crontab_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Make the specified program domain accessable
|
|
Chris PeBenito |
17de1b |
## from the system cron jobs.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## The type of the process to transition to.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
## <param name="entrypoint">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## The type of the file used as an entrypoint to this domain.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_system_entry',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type crond_t, system_crond_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_auto_trans(system_crond_t, $2, $1)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# cjp: perhaps these four rules from the old
|
|
Chris PeBenito |
17de1b |
# domain_auto_trans are not needed?
|
|
Chris PeBenito |
17de1b |
allow $1 system_crond_t:fd use;
|
|
Chris PeBenito |
17de1b |
allow $1 system_crond_t:fifo_file rw_file_perms;
|
|
Chris PeBenito |
17de1b |
allow $1 system_crond_t:process sigchld;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow $1 crond_t:fifo_file rw_file_perms;
|
|
Chris PeBenito |
17de1b |
allow $1 crond_t:fd use;
|
|
Chris PeBenito |
17de1b |
allow $1 crond_t:process sigchld;
|
|
Chris PeBenito |
357390 |
|
|
Chris PeBenito |
357390 |
role system_r types $1;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Inherit and use a file descriptor
|
|
Chris PeBenito |
17de1b |
## from the cron daemon.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_use_fds',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type crond_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow $1 crond_t:fd use;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Send a SIGCHLD signal to the cron daemon.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_sigchld',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type crond_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow $1 crond_t:process sigchld;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Read a cron daemon unnamed pipe.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_read_pipes',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type crond_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow $1 crond_t:fifo_file read_fifo_file_perms;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Do not audit attempts to write cron daemon unnamed pipes.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_dontaudit_write_pipes',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type crond_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dontaudit $1 crond_t:fifo_file write;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Read and write a cron daemon unnamed pipe.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_rw_pipes',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type crond_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow $1 crond_t:fifo_file { getattr read write };
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Read, and write cron daemon TCP sockets.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_rw_tcp_sockets',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type crond_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow $1 crond_t:tcp_socket { read write };
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Search the directory containing user cron tables.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## The type of the process to performing this action.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_search_spool',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type cron_spool_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_search_spool($1)
|
|
Chris PeBenito |
c0868a |
allow $1 cron_spool_t:dir search_dir_perms;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
4ddc7b |
## Execute anacron in the cron system domain.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_anacron_domtrans_system_job',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type system_crond_t, anacron_exec_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
0bfccd |
domtrans_pattern($1, anacron_exec_t, system_crond_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Inherit and use a file descriptor
|
|
Chris PeBenito |
17de1b |
## from system cron jobs.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_use_system_job_fds',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type system_crond_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow $1 system_crond_t:fd use;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Write a system cron job unnamed pipe.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_write_system_job_pipes',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type system_crond_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow $1 system_crond_t:file write;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Read and write a system cron job unnamed pipe.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_rw_system_job_pipes',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type system_crond_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow $1 system_crond_t:fifo_file rw_fifo_file_perms;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Read temporary files from the system cron jobs.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_read_system_job_tmp_files',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type system_crond_tmp_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_search_tmp($1)
|
|
Chris PeBenito |
c0868a |
allow $1 system_crond_tmp_t:file read_file_perms;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Do not audit attempts to append temporary
|
|
Chris PeBenito |
17de1b |
## files from the system cron jobs.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain to not audit.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`cron_dontaudit_append_system_job_tmp_files',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type system_crond_tmp_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dontaudit $1 system_crond_tmp_t:file append;
|
|
Chris PeBenito |
17de1b |
')
|