Chris PeBenito 9401ae1
policy_module(samhain, 1.1.0)
1ec3d1a
1ec3d1a
########################################
1ec3d1a
#
1ec3d1a
# Declarations
1ec3d1a
#
1ec3d1a
1ec3d1a
type samhain_etc_t;
1ec3d1a
files_config_file(samhain_etc_t)
1ec3d1a
1ec3d1a
type samhain_exec_t;
1ec3d1a
corecmd_executable_file(samhain_exec_t)
1ec3d1a
1ec3d1a
type samhain_log_t;
1ec3d1a
logging_log_file(samhain_log_t)
1ec3d1a
1ec3d1a
# Filesystem signature database
1ec3d1a
type samhain_db_t;
1ec3d1a
files_type(samhain_db_t)
1ec3d1a
1ec3d1a
type samhain_initrc_exec_t;
1ec3d1a
init_script_file(samhain_initrc_exec_t)
1ec3d1a
1ec3d1a
type samhain_var_run_t;
1ec3d1a
files_pid_file(samhain_var_run_t)
1ec3d1a
1ec3d1a
# Domain for command line access
1ec3d1a
samhain_service_template(samhain)
1ec3d1a
application_domain(samhain_t, samhain_exec_t)
1ec3d1a
1ec3d1a
# Domain for samhain service started by samhain init script
1ec3d1a
samhain_service_template(samhaind)
1ec3d1a
1ec3d1a
ifdef(`enable_mcs',`
1ec3d1a
	# This is system instead of daemon to work around
1ec3d1a
	# a type transition conflict
1ec3d1a
	init_ranged_system_domain(samhaind_t, samhain_exec_t, mcs_systemhigh)
1ec3d1a
')
1ec3d1a
1ec3d1a
ifdef(`enable_mls',`
1ec3d1a
	# This is system instead of daemon to work around
1ec3d1a
	# a type transition conflict
1ec3d1a
	init_ranged_system_domain(samhaind_t, samhain_exec_t, mls_systemhigh)
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
#
1ec3d1a
# Samhain local policy
1ec3d1a
#
1ec3d1a
1ec3d1a
manage_files_pattern(samhain_t, samhain_db_t, samhain_db_t)
1ec3d1a
files_var_lib_filetrans(samhain_t, samhain_db_t, { file dir })
1ec3d1a
1ec3d1a
domain_use_interactive_fds(samhain_t)
1ec3d1a
1ec3d1a
seutil_sigchld_newrole(samhain_t)
1ec3d1a
1ec3d1a
userdom_use_inherited_user_terminals(samhain_t)
1ec3d1a
1ec3d1a
########################################
1ec3d1a
#
1ec3d1a
# Samhaind local policy
1ec3d1a
#
1ec3d1a
1ec3d1a
# Need signal_perms to send SIGABRT/SIGKILL to termiate samhain_t
1ec3d1a
# Need signull to get the status of samhain_t
1ec3d1a
allow samhaind_t { samhain_t self }:process signal_perms;
1ec3d1a
1ec3d1a
# Only needed when starting samhain daemon from its init script.
1ec3d1a
can_exec(samhaind_t, samhain_exec_t)
1ec3d1a
1ec3d1a
read_files_pattern(samhaind_t, samhain_db_t, samhain_db_t)
1ec3d1a
1ec3d1a
# init script ptys are the stdin/out/err
1ec3d1a
# when using run_init
1ec3d1a
init_use_script_ptys(samhaind_t)