|
|
1ec3d1a |
policy_module(sanlock,1.0.0)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
########################################
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
# Declarations
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
## <desc>
|
|
|
1ec3d1a |
##
|
|
|
afef399 |
## Allow sanlock to manage nfs files
|
|
|
1ec3d1a |
##
|
|
|
1ec3d1a |
## </desc>
|
|
|
1ec3d1a |
gen_tunable(sanlock_use_nfs, false)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
## <desc>
|
|
|
1ec3d1a |
##
|
|
|
afef399 |
## Allow sanlock to manage cifs files
|
|
|
1ec3d1a |
##
|
|
|
1ec3d1a |
## </desc>
|
|
|
1ec3d1a |
gen_tunable(sanlock_use_samba, false)
|
|
|
1ec3d1a |
|
|
|
16e0bdf |
## <desc>
|
|
|
16e0bdf |
##
|
|
|
16e0bdf |
## Allow sanlock to read/write fuse files
|
|
|
16e0bdf |
##
|
|
|
16e0bdf |
## </desc>
|
|
|
16e0bdf |
gen_tunable(sanlock_use_fusefs, false)
|
|
|
16e0bdf |
|
|
|
1ec3d1a |
type sanlock_t;
|
|
|
1ec3d1a |
type sanlock_exec_t;
|
|
|
1ec3d1a |
init_daemon_domain(sanlock_t, sanlock_exec_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type sanlock_var_run_t;
|
|
|
1ec3d1a |
files_pid_file(sanlock_var_run_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type sanlock_log_t;
|
|
|
1ec3d1a |
logging_log_file(sanlock_log_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type sanlock_initrc_exec_t;
|
|
|
1ec3d1a |
init_script_file(sanlock_initrc_exec_t)
|
|
|
1ec3d1a |
|
|
|
e491048 |
type sanlock_unit_file_t;
|
|
|
e491048 |
systemd_unit_file(sanlock_unit_file_t)
|
|
|
e491048 |
|
|
|
1ec3d1a |
ifdef(`enable_mcs',`
|
|
|
1ec3d1a |
init_ranged_daemon_domain(sanlock_t, sanlock_exec_t, s0 - mcs_systemhigh)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
ifdef(`enable_mls',`
|
|
|
1ec3d1a |
init_ranged_daemon_domain(sanlock_t, sanlock_exec_t, s0 - mls_systemhigh)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
########################################
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
# sanlock local policy
|
|
|
1ec3d1a |
#
|
|
|
083d9d5 |
allow sanlock_t self:capability { chown dac_override ipc_lock kill setgid setuid sys_nice sys_resource };
|
|
|
a1f3850 |
allow sanlock_t self:process { setrlimit setsched signull signal sigkill };
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow sanlock_t self:fifo_file rw_fifo_file_perms;
|
|
|
1ec3d1a |
allow sanlock_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
manage_files_pattern(sanlock_t, sanlock_log_t, sanlock_log_t)
|
|
|
1ec3d1a |
logging_log_filetrans(sanlock_t, sanlock_log_t, file)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
manage_dirs_pattern(sanlock_t, sanlock_var_run_t, sanlock_var_run_t)
|
|
|
1ec3d1a |
manage_files_pattern(sanlock_t, sanlock_var_run_t, sanlock_var_run_t)
|
|
|
1ec3d1a |
manage_sock_files_pattern(sanlock_t, sanlock_var_run_t, sanlock_var_run_t)
|
|
|
1ec3d1a |
files_pid_filetrans(sanlock_t, sanlock_var_run_t, { file dir sock_file })
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
kernel_read_system_state(sanlock_t)
|
|
|
7e72597 |
kernel_read_kernel_sysctls(sanlock_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
domain_use_interactive_fds(sanlock_t)
|
|
|
1ec3d1a |
|
|
|
0815728 |
files_read_mnt_symlinks(sanlock_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
storage_raw_rw_fixed_disk(sanlock_t)
|
|
|
1ec3d1a |
|
|
|
956949e |
dev_read_rand(sanlock_t)
|
|
|
1ec3d1a |
dev_read_urand(sanlock_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
auth_use_nsswitch(sanlock_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
init_read_utmp(sanlock_t)
|
|
|
1ec3d1a |
init_dontaudit_write_utmp(sanlock_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
logging_send_syslog_msg(sanlock_t)
|
|
|
1ec3d1a |
|
|
|
16e0bdf |
tunable_policy(`sanlock_use_fusefs',`
|
|
|
16e0bdf |
fs_manage_fusefs_dirs(sanlock_t)
|
|
|
16e0bdf |
fs_manage_fusefs_files(sanlock_t)
|
|
|
16e0bdf |
fs_read_fusefs_symlinks(sanlock_t)
|
|
|
16e0bdf |
fs_getattr_fusefs(sanlock_t)
|
|
|
16e0bdf |
')
|
|
|
16e0bdf |
|
|
|
1ec3d1a |
tunable_policy(`sanlock_use_nfs',`
|
|
|
1ec3d1a |
fs_manage_nfs_dirs(sanlock_t)
|
|
|
1ec3d1a |
fs_manage_nfs_files(sanlock_t)
|
|
|
1ec3d1a |
fs_manage_nfs_named_sockets(sanlock_t)
|
|
|
1ec3d1a |
fs_read_nfs_symlinks(sanlock_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
tunable_policy(`sanlock_use_samba',`
|
|
|
1ec3d1a |
fs_manage_cifs_dirs(sanlock_t)
|
|
|
1ec3d1a |
fs_manage_cifs_files(sanlock_t)
|
|
|
1ec3d1a |
fs_manage_cifs_named_sockets(sanlock_t)
|
|
|
1ec3d1a |
fs_read_cifs_symlinks(sanlock_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
optional_policy(`
|
|
|
1ec3d1a |
wdmd_stream_connect(sanlock_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
optional_policy(`
|
|
|
1ec3d1a |
virt_kill_svirt(sanlock_t)
|
|
|
1ec3d1a |
virt_manage_lib_files(sanlock_t)
|
|
|
1ec3d1a |
virt_signal_svirt(sanlock_t)
|
|
|
1ec3d1a |
')
|