Chris PeBenito a51379
## <summary>Chrony NTP background daemon</summary>
Chris PeBenito a51379
Chris PeBenito a51379
#####################################
Chris PeBenito a51379
## <summary>
Chris PeBenito a51379
##	Execute chronyd in the chronyd domain.
Chris PeBenito a51379
## </summary>
Chris PeBenito a51379
## <param name="domain">
Chris PeBenito a51379
##	<summary>
Chris PeBenito a51379
##	The type of the process performing this action.
Chris PeBenito a51379
##	</summary>
Chris PeBenito a51379
## </param>
Chris PeBenito a51379
#
Chris PeBenito a51379
interface(`chronyd_domtrans',`
Chris PeBenito a51379
	gen_require(`
Chris PeBenito a51379
		type chronyd_t, chronyd_exec_t;
Chris PeBenito a51379
	')
Chris PeBenito a51379
Chris PeBenito a51379
	corecmd_search_bin($1)
Chris PeBenito a51379
	domtrans_pattern($1, chronyd_exec_t, chronyd_t)
Chris PeBenito a51379
')
Chris PeBenito a51379
Chris PeBenito a51379
####################################
Chris PeBenito a51379
## <summary>
Chris PeBenito a51379
##	Execute chronyd
Chris PeBenito a51379
## </summary>
Chris PeBenito a51379
## <param name="domain">
Chris PeBenito a51379
##	<summary>
Chris PeBenito a51379
##	The type of the process performing this action.
Chris PeBenito a51379
##	</summary>
Chris PeBenito a51379
## </param>
Chris PeBenito a51379
#
Chris PeBenito a51379
interface(`chronyd_exec',`
Chris PeBenito a51379
	gen_require(`
Chris PeBenito a51379
		type chronyd_exec_t;
Chris PeBenito a51379
	')
Chris PeBenito a51379
Chris PeBenito a51379
	can_exec($1, chronyd_exec_t)
Chris PeBenito a51379
')
Chris PeBenito a51379
Chris PeBenito a51379
#####################################
Chris PeBenito a51379
## <summary>
Chris PeBenito a51379
##	Read chronyd logs.
Chris PeBenito a51379
## </summary>
Chris PeBenito a51379
## <param name="domain">
Chris PeBenito a51379
##	<summary>
Chris PeBenito a51379
##	Domain allowed access.
Chris PeBenito a51379
##	</summary>
Chris PeBenito a51379
## </param>
Chris PeBenito a51379
#
Chris PeBenito a51379
interface(`chronyd_read_log',`
Chris PeBenito a51379
	gen_require(`
Chris PeBenito a51379
		type chronyd_var_log_t;
Chris PeBenito a51379
	')
Chris PeBenito a51379
Chris PeBenito a51379
	logging_search_logs($1)
Chris PeBenito a51379
	read_files_pattern($1, chronyd_var_log_t, chronyd_var_log_t)
Chris PeBenito a51379
')
Chris PeBenito a51379
Chris PeBenito a51379
####################################
Chris PeBenito a51379
## <summary>
Chris PeBenito a51379
##	All of the rules required to administrate
Chris PeBenito a51379
##	an chronyd environment
Chris PeBenito a51379
## </summary>
Chris PeBenito a51379
## <param name="domain">
Chris PeBenito a51379
##	<summary>
Chris PeBenito a51379
##	Domain allowed access.
Chris PeBenito a51379
##	</summary>
Chris PeBenito a51379
## </param>
Chris PeBenito a51379
## <param name="role">
Chris PeBenito a51379
##	<summary>
Chris PeBenito a51379
##	The role to be allowed to manage the chronyd domain.
Chris PeBenito a51379
##	</summary>
Chris PeBenito a51379
## </param>
Chris PeBenito a51379
## <rolecap/>
Chris PeBenito a51379
#
Chris PeBenito a51379
interface(`chronyd_admin',`
Chris PeBenito a51379
	gen_require(`
Chris PeBenito a51379
		type chronyd_t, chronyd_var_log_t;
Chris PeBenito a51379
		type chronyd_var_run_t, chronyd_var_lib_t;
Chris PeBenito a51379
		type chronyd_initrc_exec_t;
Chris PeBenito a51379
	')
Chris PeBenito a51379
Chris PeBenito a51379
	allow $1 chronyd_t:process { ptrace signal_perms };
Chris PeBenito a51379
	ps_process_pattern($1, chronyd_t)
Chris PeBenito a51379
Chris PeBenito a51379
	init_labeled_script_domtrans($1, chronyd_initrc_exec_t)
Chris PeBenito a51379
	domain_system_change_exemption($1)
Chris PeBenito a51379
	role_transition $2 chronyd_initrc_exec_t system_r;
Chris PeBenito a51379
	allow $2 system_r;
Chris PeBenito a51379
Chris PeBenito a51379
	logging_search_logs($1)
Chris PeBenito a51379
	admin_pattern($1, chronyd_var_log_t)
Chris PeBenito a51379
Chris PeBenito a51379
	files_search_var_lib($1)
Chris PeBenito a51379
	admin_pattern($1, chronyd_var_lib_t)
Chris PeBenito a51379
Chris PeBenito a51379
	files_search_pids($1)
Chris PeBenito a51379
	admin_pattern($1, chronyd_var_run_t)
Chris PeBenito a51379
Chris PeBenito a51379
	files_search_tmp($1)
Chris PeBenito a51379
	admin_pattern($1, chronyd_tmp_t)
Chris PeBenito a51379
')