Chris PeBenito 44fc06b
Chris PeBenito d6d16b9
policy_module(amanda,1.4.2)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
#######################################
Chris PeBenito 44fc06b
#
Chris PeBenito 44fc06b
# Declarations
Chris PeBenito 44fc06b
#
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
type amanda_t;
Chris PeBenito 44fc06b
type amanda_inetd_exec_t;
Chris PeBenito cdc86ee
inetd_service_domain(amanda_t,amanda_inetd_exec_t)
Chris PeBenito 44fc06b
role system_r types amanda_t;
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
type amanda_exec_t;
Chris PeBenito 44fc06b
domain_entry_file(amanda_t,amanda_exec_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
type amanda_log_t;
Chris PeBenito 44fc06b
logging_log_file(amanda_log_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# type for amanda configurations files
Chris PeBenito 44fc06b
type amanda_config_t;
Chris PeBenito 44fc06b
files_type(amanda_config_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# type for files in /usr/lib/amanda
Chris PeBenito 44fc06b
type amanda_usr_lib_t;
Chris PeBenito 44fc06b
files_type(amanda_usr_lib_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# type for all files in /var/lib/amanda
Chris PeBenito 44fc06b
type amanda_var_lib_t;
Chris PeBenito 44fc06b
files_type(amanda_var_lib_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# type for all files in /var/lib/amanda/gnutar-lists/
Chris PeBenito 44fc06b
type amanda_gnutarlists_t;
Chris PeBenito 44fc06b
files_type(amanda_gnutarlists_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
type amanda_tmp_t;
Chris PeBenito 44fc06b
files_tmp_file(amanda_tmp_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# type for /etc/amandates
Chris PeBenito 44fc06b
type amanda_amandates_t;
Chris PeBenito 44fc06b
files_type(amanda_amandates_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# type for /etc/dumpdates
Chris PeBenito 44fc06b
type amanda_dumpdates_t;
Chris PeBenito 44fc06b
files_type(amanda_dumpdates_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# type for amanda data
Chris PeBenito 44fc06b
type amanda_data_t;
Chris PeBenito 44fc06b
files_type(amanda_data_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# type for amrecover
Chris PeBenito 44fc06b
type amanda_recover_t;
Chris PeBenito 44fc06b
type amanda_recover_exec_t;
Chris PeBenito 44fc06b
domain_type(amanda_recover_t)
Chris PeBenito 44fc06b
domain_entry_file(amanda_recover_t,amanda_recover_exec_t)
Chris PeBenito 44fc06b
role system_r types amanda_recover_t;
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# type for recover files ( restored data )
Chris PeBenito 44fc06b
type amanda_recover_dir_t;
Chris PeBenito 44fc06b
files_type(amanda_recover_dir_t)
Chris PeBenito 44fc06b
Chris PeBenito bb7170f
optional_policy(`
Chris PeBenito 2c24358
	prelink_object_file(amanda_usr_lib_t)
Chris PeBenito 2c24358
')
Chris PeBenito 2c24358
Chris PeBenito 44fc06b
########################################
Chris PeBenito 44fc06b
#
Chris PeBenito 44fc06b
# Amanda local policy
Chris PeBenito 44fc06b
#
Chris PeBenito 44fc06b
Chris PeBenito 46c69cb
allow amanda_t self:capability { chown dac_override setuid kill };
Chris PeBenito 44fc06b
allow amanda_t self:process { setpgid signal };
Chris PeBenito 44fc06b
allow amanda_t self:fifo_file { getattr read write ioctl lock };
Chris PeBenito 44fc06b
allow amanda_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 44fc06b
allow amanda_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 44fc06b
allow amanda_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 44fc06b
allow amanda_t self:udp_socket create_socket_perms;
Chris PeBenito d6d16b9
allow amanda_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# access to amanda_amandates_t
Chris PeBenito 44fc06b
allow amanda_t amanda_amandates_t:file { getattr lock read write };
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# configuration files -> read only
Chris PeBenito 44fc06b
allow amanda_t amanda_config_t:file { getattr read };
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# access to amandas data structure
Chris PeBenito 44fc06b
allow amanda_t amanda_data_t:dir { read search write };
Chris PeBenito 44fc06b
allow amanda_t amanda_data_t:file { read write };
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# access to amanda_dumpdates_t
Chris PeBenito 44fc06b
allow amanda_t amanda_dumpdates_t:file { getattr lock read write };
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
can_exec(amanda_t,amanda_exec_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# access to amanda_gnutarlists_t (/var/lib/amanda/gnutar-lists)
Chris PeBenito 44fc06b
allow amanda_t amanda_gnutarlists_t:dir rw_dir_perms;
Chris PeBenito 44fc06b
allow amanda_t amanda_gnutarlists_t:file manage_file_perms;
Chris PeBenito 44fc06b
allow amanda_t amanda_gnutarlists_t:lnk_file manage_file_perms;
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
allow amanda_t amanda_log_t:file create_file_perms;
Chris PeBenito d9845ae
allow amanda_t amanda_log_t:dir manage_dir_perms;
Chris PeBenito 103fe28
logging_log_filetrans(amanda_t,amanda_log_t,{ file dir })
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
allow amanda_t amanda_tmp_t:dir create_dir_perms;
Chris PeBenito 44fc06b
allow amanda_t amanda_tmp_t:file create_file_perms;
Chris PeBenito 103fe28
files_tmp_filetrans(amanda_t, amanda_tmp_t, { file dir })
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
kernel_read_system_state(amanda_t)
Chris PeBenito 445522d
kernel_read_kernel_sysctls(amanda_t)
Chris PeBenito 445522d
kernel_dontaudit_getattr_unlabeled_files(amanda_t)
Chris PeBenito 445522d
kernel_dontaudit_read_proc_symlinks(amanda_t)
Don Miner c11417c
Don Miner c11417c
# Added for targeted policy
Chris PeBenito 1815bad
term_use_unallocated_ttys(amanda_t)
Chris PeBenito 44fc06b
Chris PeBenito 9d0c9b3
corenet_non_ipsec_sendrecv(amanda_t)
Chris PeBenito 44fc06b
corenet_tcp_sendrecv_all_if(amanda_t)
Chris PeBenito 44fc06b
corenet_udp_sendrecv_all_if(amanda_t)
Chris PeBenito 44fc06b
corenet_raw_sendrecv_all_if(amanda_t)
Chris PeBenito 44fc06b
corenet_tcp_sendrecv_all_nodes(amanda_t)
Chris PeBenito 44fc06b
corenet_udp_sendrecv_all_nodes(amanda_t)
Chris PeBenito 44fc06b
corenet_raw_sendrecv_all_nodes(amanda_t)
Chris PeBenito 44fc06b
corenet_tcp_sendrecv_all_ports(amanda_t)
Chris PeBenito 44fc06b
corenet_udp_sendrecv_all_ports(amanda_t)
Chris PeBenito bd70373
corenet_tcp_bind_all_nodes(amanda_t)
Chris PeBenito bd70373
corenet_udp_bind_all_nodes(amanda_t)
Chris PeBenito d9845ae
corenet_tcp_bind_all_rpc_ports(amanda_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
dev_getattr_all_blk_files(amanda_t)
Chris PeBenito 2db2c7d
dev_getattr_all_chr_files(amanda_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
fs_getattr_xattr_fs(amanda_t)
Chris PeBenito 44fc06b
fs_list_all(amanda_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
storage_raw_read_fixed_disk(amanda_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
files_read_etc_files(amanda_t)
Chris PeBenito 44fc06b
files_read_etc_runtime_files(amanda_t)
Chris PeBenito 9e04f5c
files_list_all(amanda_t)
Chris PeBenito 44fc06b
files_read_all_files(amanda_t)
Chris PeBenito 44fc06b
files_read_all_symlinks(amanda_t)
Chris PeBenito 9e04f5c
files_read_all_blk_files(amanda_t)
Chris PeBenito 9e04f5c
files_read_all_chr_files(amanda_t)
Chris PeBenito 44fc06b
files_getattr_all_pipes(amanda_t)
Chris PeBenito 44fc06b
files_getattr_all_sockets(amanda_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
corecmd_exec_shell(amanda_t)
Chris PeBenito 44fc06b
corecmd_exec_sbin(amanda_t)
Chris PeBenito 44fc06b
corecmd_exec_bin(amanda_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
libs_use_ld_so(amanda_t)
Chris PeBenito 44fc06b
libs_use_shared_libs(amanda_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
sysnet_read_config(amanda_t)
Chris PeBenito 44fc06b
Chris PeBenito bb7170f
optional_policy(`
Chris PeBenito 44fc06b
	auth_read_shadow(amanda_t)
Chris PeBenito 44fc06b
')
Chris PeBenito 44fc06b
Chris PeBenito bb7170f
optional_policy(`
Chris PeBenito 44fc06b
	logging_send_syslog_msg(amanda_t)
Chris PeBenito 44fc06b
')
Chris PeBenito 44fc06b
Chris PeBenito bb7170f
optional_policy(`
Chris PeBenito 44fc06b
	nis_use_ypbind(amanda_t)
Chris PeBenito 44fc06b
')
Chris PeBenito 44fc06b
Chris PeBenito bb7170f
optional_policy(`
Chris PeBenito 1815bad
	nscd_socket_use(amanda_t)
Chris PeBenito 44fc06b
')
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
########################################
Chris PeBenito 44fc06b
#
Chris PeBenito 44fc06b
# Amanda recover local policy
Chris PeBenito 44fc06b
Chris PeBenito cdc86ee
allow amanda_recover_t self:capability { fowner fsetid kill setgid setuid chown dac_override };
Chris PeBenito 44fc06b
allow amanda_recover_t self:process { sigkill sigstop signal };
Chris PeBenito 44fc06b
allow amanda_recover_t self:fifo_file { getattr ioctl read write };
Chris PeBenito 44fc06b
allow amanda_recover_t self:unix_stream_socket { connect create read write };
Chris PeBenito 44fc06b
allow amanda_recover_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 44fc06b
allow amanda_recover_t self:udp_socket create_socket_perms;
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
allow amanda_recover_t amanda_log_t:dir rw_dir_perms;
Chris PeBenito 44fc06b
allow amanda_recover_t amanda_log_t:file manage_file_perms;
Chris PeBenito 44fc06b
allow amanda_recover_t amanda_log_t:lnk_file create_lnk_perms;
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
# access to amanda_recover_dir_t
Chris PeBenito 44fc06b
allow amanda_recover_t amanda_recover_dir_t:dir create_dir_perms;
Chris PeBenito 44fc06b
allow amanda_recover_t amanda_recover_dir_t:file create_file_perms;
Chris PeBenito 44fc06b
allow amanda_recover_t amanda_recover_dir_t:lnk_file create_lnk_perms;
Chris PeBenito 44fc06b
allow amanda_recover_t amanda_recover_dir_t:sock_file create_file_perms;
Chris PeBenito 44fc06b
allow amanda_recover_t amanda_recover_dir_t:fifo_file create_file_perms;
Chris PeBenito 103fe28
userdom_sysadm_home_dir_filetrans(amanda_recover_t,amanda_recover_dir_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
allow amanda_recover_t amanda_tmp_t:dir create_dir_perms;
Chris PeBenito 44fc06b
allow amanda_recover_t amanda_tmp_t:file create_file_perms;
Chris PeBenito 44fc06b
allow amanda_recover_t amanda_tmp_t:lnk_file create_lnk_perms;
Chris PeBenito 44fc06b
allow amanda_recover_t amanda_tmp_t:sock_file create_file_perms;
Chris PeBenito 44fc06b
allow amanda_recover_t amanda_tmp_t:fifo_file create_file_perms;
Chris PeBenito 103fe28
files_tmp_filetrans(amanda_recover_t,amanda_tmp_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
kernel_read_system_state(amanda_recover_t)
Chris PeBenito 445522d
kernel_read_kernel_sysctls(amanda_recover_t)
Chris PeBenito 44fc06b
Chris PeBenito 9d0c9b3
corenet_non_ipsec_sendrecv(amanda_recover_t)
Chris PeBenito 44fc06b
corenet_tcp_sendrecv_all_if(amanda_recover_t)
Chris PeBenito 44fc06b
corenet_udp_sendrecv_all_if(amanda_recover_t)
Chris PeBenito 44fc06b
corenet_tcp_sendrecv_all_nodes(amanda_recover_t)
Chris PeBenito 44fc06b
corenet_udp_sendrecv_all_nodes(amanda_recover_t)
Chris PeBenito 44fc06b
corenet_tcp_sendrecv_all_ports(amanda_recover_t)
Chris PeBenito 44fc06b
corenet_udp_sendrecv_all_ports(amanda_recover_t)
Chris PeBenito 44fc06b
corenet_tcp_bind_all_nodes(amanda_recover_t)
Chris PeBenito 44fc06b
corenet_udp_bind_all_nodes(amanda_recover_t)
Chris PeBenito cdc86ee
corenet_tcp_bind_reserved_port(amanda_recover_t)
Chris PeBenito 44fc06b
corenet_tcp_connect_amanda_port(amanda_recover_t)
Chris PeBenito 9d0c9b3
corenet_sendrecv_amanda_client_packets(amanda_recover_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
corecmd_exec_shell(amanda_recover_t)
Chris PeBenito 44fc06b
corecmd_exec_bin(amanda_recover_t)
Chris PeBenito 44fc06b
Chris PeBenito 15722ec
domain_use_interactive_fds(amanda_recover_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
files_read_etc_files(amanda_recover_t)
Chris PeBenito 44fc06b
files_read_etc_runtime_files(amanda_recover_t)
Chris PeBenito 44fc06b
files_search_tmp(amanda_recover_t)
Chris PeBenito 44fc06b
files_search_pids(amanda_recover_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
fstools_domtrans(amanda_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
libs_use_ld_so(amanda_recover_t)
Chris PeBenito 44fc06b
libs_use_shared_libs(amanda_recover_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
logging_search_logs(amanda_recover_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
miscfiles_read_localization(amanda_recover_t)
Chris PeBenito 44fc06b
Chris PeBenito 44fc06b
sysnet_read_config(amanda_recover_t)
Chris PeBenito 44fc06b
Chris PeBenito 103fe28
userdom_search_sysadm_home_content_dirs(amanda_recover_t)
Chris PeBenito 44fc06b
Chris PeBenito bb7170f
optional_policy(`
Chris PeBenito 44fc06b
	nis_use_ypbind(amanda_recover_t)
Chris PeBenito 44fc06b
')
Chris PeBenito cdc86ee
Chris PeBenito cdc86ee
optional_policy(`
Chris PeBenito cdc86ee
	nscd_socket_use(amanda_recover_t)
Chris PeBenito cdc86ee
')