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>
Dominick Grift 288845
##	Domain allowed to transition.
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
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Execute chronyd server in the chronyd  domain.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`chronyd_initrc_domtrans',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type chronyd_initrc_exec_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	init_labeled_script_domtrans($1, chronyd_initrc_exec_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
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>
Jeremy Solt dcbb33
##	Domain allowed access.
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
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Read and write chronyd shared memory.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`chronyd_rw_shm',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type chronyd_t, chronyd_tmpfs_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	allow $1 chronyd_t:shm rw_shm_perms;
Dan Walsh 3eaa99
	allow $1 chronyd_tmpfs_t:dir list_dir_perms;
Dan Walsh 3eaa99
	rw_files_pattern($1, chronyd_tmpfs_t, chronyd_tmpfs_t)
Dan Walsh 3eaa99
	read_lnk_files_pattern($1, chronyd_tmpfs_t, chronyd_tmpfs_t)
Dan Walsh 3eaa99
	fs_search_tmpfs($1)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Read chronyd keys files.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`chronyd_read_keys',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type chronyd_keys_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	read_files_pattern($1, chronyd_keys_t, chronyd_keys_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Append chronyd keys files.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`chronyd_append_keys',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type chronyd_keys_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	append_files_pattern($1, chronyd_keys_t, chronyd_keys_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
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(`
Dominick Grift 6bb4d4
		type chronyd_t, chronyd_var_log_t, chronyd_var_run_t;
Dominick Grift 6bb4d4
		type chronyd_var_lib_t, chronyd_tmpfs_t, chronyd_initrc_exec_t;
Dominick Grift 6bb4d4
		type chronyd_keys_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
Jeremy Solt dcbb33
	files_search_etc($1)
Jeremy Solt dcbb33
	admin_pattern($1, chronyd_keys_t)
Jeremy Solt dcbb33
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
Dan Walsh 3eaa99
	admin_pattern($1, chronyd_tmpfs_t)
Chris PeBenito a51379
')