Chris PeBenito 8d4bde9
policy_module(sanlock, 1.0.0)
899b713
899b713
########################################
899b713
#
899b713
# Declarations
899b713
#
899b713
899b713
## <desc>
Chris PeBenito 8d4bde9
## 

Chris PeBenito 8d4bde9
## Allow confined virtual guests to manage nfs files
Chris PeBenito 8d4bde9
## 

899b713
## </desc>
899b713
gen_tunable(sanlock_use_nfs, false)
899b713
899b713
## <desc>
Chris PeBenito 8d4bde9
## 

Chris PeBenito 8d4bde9
## Allow confined virtual guests to manage cifs files
Chris PeBenito 8d4bde9
## 

899b713
## </desc>
899b713
gen_tunable(sanlock_use_samba, false)
899b713
899b713
type sanlock_t;
899b713
type sanlock_exec_t;
899b713
init_daemon_domain(sanlock_t, sanlock_exec_t)
899b713
899b713
type sanlock_var_run_t;
899b713
files_pid_file(sanlock_var_run_t)
899b713
899b713
type sanlock_log_t;
899b713
logging_log_file(sanlock_log_t)
899b713
899b713
type sanlock_initrc_exec_t;
899b713
init_script_file(sanlock_initrc_exec_t)
899b713
899b713
ifdef(`enable_mcs',`
899b713
	init_ranged_daemon_domain(sanlock_t, sanlock_exec_t, s0 - mcs_systemhigh)
899b713
')
899b713
899b713
ifdef(`enable_mls',`
899b713
	init_ranged_daemon_domain(sanlock_t, sanlock_exec_t, s0 - mls_systemhigh)
899b713
')
899b713
899b713
########################################
899b713
#
899b713
# sanlock local policy
899b713
#
899b713
allow sanlock_t self:capability { sys_nice ipc_lock };
899b713
allow sanlock_t self:process { setsched signull };
899b713
allow sanlock_t self:fifo_file rw_fifo_file_perms;
899b713
allow sanlock_t self:unix_stream_socket create_stream_socket_perms;
899b713
899b713
manage_files_pattern(sanlock_t, sanlock_log_t, sanlock_log_t)
899b713
logging_log_filetrans(sanlock_t, sanlock_log_t, file)
899b713
899b713
manage_dirs_pattern(sanlock_t, sanlock_var_run_t, sanlock_var_run_t)
899b713
manage_files_pattern(sanlock_t, sanlock_var_run_t, sanlock_var_run_t)
899b713
manage_sock_files_pattern(sanlock_t, sanlock_var_run_t, sanlock_var_run_t)
899b713
files_pid_filetrans(sanlock_t, sanlock_var_run_t, { file dir sock_file })
899b713
899b713
kernel_read_system_state(sanlock_t)
899b713
899b713
domain_use_interactive_fds(sanlock_t)
899b713
899b713
files_read_etc_files(sanlock_t)
899b713
899b713
storage_raw_rw_fixed_disk(sanlock_t)
899b713
899b713
dev_read_urand(sanlock_t)
899b713
899b713
init_read_utmp(sanlock_t)
899b713
init_dontaudit_write_utmp(sanlock_t)
899b713
899b713
logging_send_syslog_msg(sanlock_t)
899b713
899b713
miscfiles_read_localization(sanlock_t)
899b713
899b713
tunable_policy(`sanlock_use_nfs',`
Chris PeBenito 8d4bde9
	fs_manage_nfs_dirs(sanlock_t)
Chris PeBenito 8d4bde9
	fs_manage_nfs_files(sanlock_t)
Chris PeBenito 8d4bde9
	fs_manage_nfs_named_sockets(sanlock_t)
Chris PeBenito 8d4bde9
	fs_read_nfs_symlinks(sanlock_t)
899b713
')
899b713
899b713
tunable_policy(`sanlock_use_samba',`
Chris PeBenito 8d4bde9
	fs_manage_cifs_dirs(sanlock_t)
Chris PeBenito 8d4bde9
	fs_manage_cifs_files(sanlock_t)
Chris PeBenito 8d4bde9
	fs_manage_cifs_named_sockets(sanlock_t)
Chris PeBenito 8d4bde9
	fs_read_cifs_symlinks(sanlock_t)
899b713
')
899b713
899b713
optional_policy(`
899b713
	virt_manage_lib_files(sanlock_t)
899b713
')