2005-10-22 22:51:01 +00:00
|
|
|
|
2008-10-14 15:46:36 +00:00
|
|
|
policy_module(amanda, 1.10.0)
|
2005-10-22 22:51:01 +00:00
|
|
|
|
|
|
|
#######################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type amanda_t;
|
|
|
|
type amanda_inetd_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
inetd_service_domain(amanda_t, amanda_inetd_exec_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
role system_r types amanda_t;
|
|
|
|
|
|
|
|
type amanda_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
domain_entry_file(amanda_t, amanda_exec_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
|
|
|
|
type amanda_log_t;
|
|
|
|
logging_log_file(amanda_log_t)
|
|
|
|
|
|
|
|
# type for amanda configurations files
|
|
|
|
type amanda_config_t;
|
|
|
|
files_type(amanda_config_t)
|
|
|
|
|
|
|
|
# type for files in /usr/lib/amanda
|
|
|
|
type amanda_usr_lib_t;
|
|
|
|
files_type(amanda_usr_lib_t)
|
|
|
|
|
|
|
|
# type for all files in /var/lib/amanda
|
|
|
|
type amanda_var_lib_t;
|
|
|
|
files_type(amanda_var_lib_t)
|
|
|
|
|
|
|
|
# type for all files in /var/lib/amanda/gnutar-lists/
|
|
|
|
type amanda_gnutarlists_t;
|
|
|
|
files_type(amanda_gnutarlists_t)
|
|
|
|
|
|
|
|
type amanda_tmp_t;
|
|
|
|
files_tmp_file(amanda_tmp_t)
|
|
|
|
|
|
|
|
# type for /etc/amandates
|
|
|
|
type amanda_amandates_t;
|
|
|
|
files_type(amanda_amandates_t)
|
|
|
|
|
|
|
|
# type for /etc/dumpdates
|
|
|
|
type amanda_dumpdates_t;
|
|
|
|
files_type(amanda_dumpdates_t)
|
|
|
|
|
|
|
|
# type for amanda data
|
|
|
|
type amanda_data_t;
|
|
|
|
files_type(amanda_data_t)
|
|
|
|
|
|
|
|
# type for amrecover
|
|
|
|
type amanda_recover_t;
|
|
|
|
type amanda_recover_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
application_domain(amanda_recover_t, amanda_recover_exec_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
role system_r types amanda_recover_t;
|
|
|
|
|
|
|
|
# type for recover files ( restored data )
|
|
|
|
type amanda_recover_dir_t;
|
|
|
|
files_type(amanda_recover_dir_t)
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-01-11 23:20:28 +00:00
|
|
|
prelink_object_file(amanda_usr_lib_t)
|
|
|
|
')
|
|
|
|
|
2005-10-22 22:51:01 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Amanda local policy
|
|
|
|
#
|
|
|
|
|
2006-02-20 16:31:54 +00:00
|
|
|
allow amanda_t self:capability { chown dac_override setuid kill };
|
2005-10-22 22:51:01 +00:00
|
|
|
allow amanda_t self:process { setpgid signal };
|
2007-06-27 19:19:20 +00:00
|
|
|
allow amanda_t self:fifo_file rw_fifo_file_perms;
|
2005-10-22 22:51:01 +00:00
|
|
|
allow amanda_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow amanda_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow amanda_t self:tcp_socket create_stream_socket_perms;
|
|
|
|
allow amanda_t self:udp_socket create_socket_perms;
|
|
|
|
|
|
|
|
# access to amanda_amandates_t
|
2008-10-16 16:09:20 +00:00
|
|
|
allow amanda_t amanda_amandates_t:file rw_file_perms;
|
2005-10-22 22:51:01 +00:00
|
|
|
|
|
|
|
# configuration files -> read only
|
2008-10-16 16:09:20 +00:00
|
|
|
allow amanda_t amanda_config_t:file read_file_perms;
|
2005-10-22 22:51:01 +00:00
|
|
|
|
|
|
|
# access to amandas data structure
|
2008-08-07 14:17:50 +00:00
|
|
|
manage_dirs_pattern(amanda_t, amanda_data_t, amanda_data_t)
|
|
|
|
manage_files_pattern(amanda_t, amanda_data_t, amanda_data_t)
|
|
|
|
filetrans_pattern(amanda_t, amanda_config_t, amanda_data_t, { file dir })
|
2005-10-22 22:51:01 +00:00
|
|
|
|
|
|
|
# access to amanda_dumpdates_t
|
2008-10-16 16:09:20 +00:00
|
|
|
allow amanda_t amanda_dumpdates_t:file rw_file_perms;
|
2005-10-22 22:51:01 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
can_exec(amanda_t, amanda_exec_t)
|
|
|
|
can_exec(amanda_t, amanda_inetd_exec_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
|
|
|
|
# access to amanda_gnutarlists_t (/var/lib/amanda/gnutar-lists)
|
|
|
|
allow amanda_t amanda_gnutarlists_t:dir rw_dir_perms;
|
|
|
|
allow amanda_t amanda_gnutarlists_t:file manage_file_perms;
|
2008-05-23 18:22:57 +00:00
|
|
|
allow amanda_t amanda_gnutarlists_t:lnk_file manage_lnk_file_perms;
|
2005-10-22 22:51:01 +00:00
|
|
|
|
2007-06-27 19:19:20 +00:00
|
|
|
manage_dirs_pattern(amanda_t,amanda_var_lib_t,amanda_var_lib_t)
|
|
|
|
manage_files_pattern(amanda_t,amanda_var_lib_t,amanda_var_lib_t)
|
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(amanda_t, amanda_log_t, amanda_log_t)
|
|
|
|
manage_dirs_pattern(amanda_t, amanda_log_t, amanda_log_t)
|
|
|
|
logging_log_filetrans(amanda_t, amanda_log_t, { file dir })
|
2005-10-22 22:51:01 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(amanda_t, amanda_tmp_t, amanda_tmp_t)
|
|
|
|
manage_dirs_pattern(amanda_t, amanda_tmp_t, amanda_tmp_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(amanda_t, amanda_tmp_t, { file dir })
|
2005-10-22 22:51:01 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(amanda_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(amanda_t)
|
|
|
|
kernel_dontaudit_getattr_unlabeled_files(amanda_t)
|
|
|
|
kernel_dontaudit_read_proc_symlinks(amanda_t)
|
2005-10-24 21:35:50 +00:00
|
|
|
|
2007-10-12 17:50:11 +00:00
|
|
|
corecmd_exec_shell(amanda_t)
|
|
|
|
corecmd_exec_bin(amanda_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled(amanda_t)
|
|
|
|
corenet_all_recvfrom_netlabel(amanda_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
corenet_tcp_sendrecv_all_if(amanda_t)
|
|
|
|
corenet_udp_sendrecv_all_if(amanda_t)
|
|
|
|
corenet_raw_sendrecv_all_if(amanda_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes(amanda_t)
|
|
|
|
corenet_udp_sendrecv_all_nodes(amanda_t)
|
|
|
|
corenet_raw_sendrecv_all_nodes(amanda_t)
|
|
|
|
corenet_tcp_sendrecv_all_ports(amanda_t)
|
|
|
|
corenet_udp_sendrecv_all_ports(amanda_t)
|
2005-12-06 19:59:50 +00:00
|
|
|
corenet_tcp_bind_all_nodes(amanda_t)
|
|
|
|
corenet_udp_bind_all_nodes(amanda_t)
|
2006-10-31 21:01:48 +00:00
|
|
|
corenet_tcp_bind_all_rpc_ports(amanda_t)
|
2008-10-13 15:06:23 +00:00
|
|
|
corenet_tcp_bind_generic_port(amanda_t)
|
|
|
|
corenet_dontaudit_tcp_bind_all_ports(amanda_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
|
|
|
|
dev_getattr_all_blk_files(amanda_t)
|
2005-10-24 00:54:39 +00:00
|
|
|
dev_getattr_all_chr_files(amanda_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
|
|
|
|
files_read_etc_files(amanda_t)
|
|
|
|
files_read_etc_runtime_files(amanda_t)
|
2006-01-31 19:21:01 +00:00
|
|
|
files_list_all(amanda_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
files_read_all_files(amanda_t)
|
|
|
|
files_read_all_symlinks(amanda_t)
|
2006-01-31 19:21:01 +00:00
|
|
|
files_read_all_blk_files(amanda_t)
|
|
|
|
files_read_all_chr_files(amanda_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
files_getattr_all_pipes(amanda_t)
|
|
|
|
files_getattr_all_sockets(amanda_t)
|
|
|
|
|
2007-10-12 17:50:11 +00:00
|
|
|
fs_getattr_xattr_fs(amanda_t)
|
|
|
|
fs_list_all(amanda_t)
|
|
|
|
|
|
|
|
storage_raw_read_fixed_disk(amanda_t)
|
2008-08-07 14:17:50 +00:00
|
|
|
storage_read_tape(amanda_t)
|
|
|
|
storage_write_tape(amanda_t)
|
2007-10-12 17:50:11 +00:00
|
|
|
|
|
|
|
# Added for targeted policy
|
|
|
|
term_use_unallocated_ttys(amanda_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
|
2007-10-12 17:35:56 +00:00
|
|
|
auth_use_nsswitch(amanda_t)
|
|
|
|
auth_read_shadow(amanda_t)
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-22 22:51:01 +00:00
|
|
|
logging_send_syslog_msg(amanda_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Amanda recover local policy
|
|
|
|
|
2006-04-17 17:32:54 +00:00
|
|
|
allow amanda_recover_t self:capability { fowner fsetid kill setgid setuid chown dac_override };
|
2005-10-22 22:51:01 +00:00
|
|
|
allow amanda_recover_t self:process { sigkill sigstop signal };
|
2008-10-16 16:09:20 +00:00
|
|
|
allow amanda_recover_t self:fifo_file rw_fifo_file_perms;
|
2005-10-22 22:51:01 +00:00
|
|
|
allow amanda_recover_t self:unix_stream_socket { connect create read write };
|
|
|
|
allow amanda_recover_t self:tcp_socket create_stream_socket_perms;
|
|
|
|
allow amanda_recover_t self:udp_socket create_socket_perms;
|
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(amanda_recover_t, amanda_log_t, amanda_log_t)
|
|
|
|
manage_lnk_files_pattern(amanda_recover_t, amanda_log_t, amanda_log_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
|
|
|
|
# access to amanda_recover_dir_t
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern(amanda_recover_t, amanda_recover_dir_t, amanda_recover_dir_t)
|
|
|
|
manage_files_pattern(amanda_recover_t, amanda_recover_dir_t, amanda_recover_dir_t)
|
|
|
|
manage_lnk_files_pattern(amanda_recover_t, amanda_recover_dir_t, amanda_recover_dir_t)
|
|
|
|
manage_fifo_files_pattern(amanda_recover_t, amanda_recover_dir_t, amanda_recover_dir_t)
|
|
|
|
manage_sock_files_pattern(amanda_recover_t, amanda_recover_dir_t, amanda_recover_dir_t)
|
|
|
|
sysadm_home_dir_filetrans(amanda_recover_t, amanda_recover_dir_t, { dir file lnk_file sock_file fifo_file })
|
|
|
|
|
|
|
|
manage_dirs_pattern(amanda_recover_t, amanda_tmp_t, amanda_tmp_t)
|
|
|
|
manage_files_pattern(amanda_recover_t, amanda_tmp_t, amanda_tmp_t)
|
|
|
|
manage_lnk_files_pattern(amanda_recover_t, amanda_tmp_t, amanda_tmp_t)
|
|
|
|
manage_fifo_files_pattern(amanda_recover_t, amanda_tmp_t, amanda_tmp_t)
|
|
|
|
manage_sock_files_pattern(amanda_recover_t, amanda_tmp_t, amanda_tmp_t)
|
|
|
|
files_tmp_filetrans(amanda_recover_t, amanda_tmp_t, { dir file lnk_file sock_file fifo_file })
|
2005-10-22 22:51:01 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(amanda_recover_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(amanda_recover_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
|
2007-10-12 17:50:11 +00:00
|
|
|
corecmd_exec_shell(amanda_recover_t)
|
|
|
|
corecmd_exec_bin(amanda_recover_t)
|
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled(amanda_recover_t)
|
|
|
|
corenet_all_recvfrom_netlabel(amanda_recover_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
corenet_tcp_sendrecv_all_if(amanda_recover_t)
|
|
|
|
corenet_udp_sendrecv_all_if(amanda_recover_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes(amanda_recover_t)
|
|
|
|
corenet_udp_sendrecv_all_nodes(amanda_recover_t)
|
|
|
|
corenet_tcp_sendrecv_all_ports(amanda_recover_t)
|
|
|
|
corenet_udp_sendrecv_all_ports(amanda_recover_t)
|
|
|
|
corenet_tcp_bind_all_nodes(amanda_recover_t)
|
|
|
|
corenet_udp_bind_all_nodes(amanda_recover_t)
|
2006-04-17 17:32:54 +00:00
|
|
|
corenet_tcp_bind_reserved_port(amanda_recover_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
corenet_tcp_connect_amanda_port(amanda_recover_t)
|
2006-05-29 19:53:43 +00:00
|
|
|
corenet_sendrecv_amanda_client_packets(amanda_recover_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(amanda_recover_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
|
|
|
|
files_read_etc_files(amanda_recover_t)
|
|
|
|
files_read_etc_runtime_files(amanda_recover_t)
|
|
|
|
files_search_tmp(amanda_recover_t)
|
|
|
|
files_search_pids(amanda_recover_t)
|
|
|
|
|
2007-10-12 17:35:56 +00:00
|
|
|
auth_use_nsswitch(amanda_recover_t)
|
|
|
|
|
2005-10-22 22:51:01 +00:00
|
|
|
fstools_domtrans(amanda_t)
|
2008-08-14 13:08:53 +00:00
|
|
|
fstools_signal(amanda_t)
|
2005-10-22 22:51:01 +00:00
|
|
|
|
|
|
|
logging_search_logs(amanda_recover_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(amanda_recover_t)
|
|
|
|
|
2008-04-29 13:58:34 +00:00
|
|
|
sysadm_search_home_content_dirs(amanda_recover_t)
|