151 lines
3.6 KiB
Plaintext
151 lines
3.6 KiB
Plaintext
|
|
policy_module(ntp,1.2.0)
|
|
|
|
########################################
|
|
#
|
|
# Declarations
|
|
#
|
|
|
|
type ntp_drift_t;
|
|
files_type(ntp_drift_t)
|
|
|
|
type ntpd_t;
|
|
type ntpd_exec_t;
|
|
init_daemon_domain(ntpd_t,ntpd_exec_t)
|
|
|
|
type ntpd_log_t;
|
|
logging_log_file(ntpd_log_t)
|
|
|
|
type ntpd_tmp_t;
|
|
files_tmp_file(ntpd_tmp_t)
|
|
|
|
type ntpd_var_run_t;
|
|
files_pid_file(ntpd_var_run_t)
|
|
|
|
type ntpdate_exec_t;
|
|
init_system_domain(ntpd_t,ntpdate_exec_t)
|
|
|
|
########################################
|
|
#
|
|
# Local policy
|
|
#
|
|
|
|
# sys_resource and setrlimit is for locking memory
|
|
# ntpdate wants sys_nice
|
|
allow ntpd_t self:capability { chown dac_override kill setgid setuid sys_time ipc_lock sys_chroot sys_nice sys_resource };
|
|
dontaudit ntpd_t self:capability { net_admin sys_tty_config fsetid sys_nice };
|
|
allow ntpd_t self:process { signal_perms setcap setsched setrlimit };
|
|
allow ntpd_t self:fifo_file { read write getattr };
|
|
allow ntpd_t self:unix_dgram_socket create_socket_perms;
|
|
allow ntpd_t self:unix_stream_socket create_socket_perms;
|
|
allow ntpd_t self:tcp_socket create_stream_socket_perms;
|
|
allow ntpd_t self:udp_socket create_socket_perms;
|
|
|
|
manage_files_pattern(ntpd_t,ntp_drift_t,ntp_drift_t)
|
|
|
|
can_exec(ntpd_t,ntpd_exec_t)
|
|
|
|
allow ntpd_t ntpd_log_t:dir setattr;
|
|
manage_files_pattern(ntpd_t,ntpd_log_t,ntpd_log_t)
|
|
logging_log_filetrans(ntpd_t,ntpd_log_t,{ file dir })
|
|
|
|
# for some reason it creates a file in /tmp
|
|
manage_dirs_pattern(ntpd_t,ntpd_tmp_t,ntpd_tmp_t)
|
|
manage_files_pattern(ntpd_t,ntpd_tmp_t,ntpd_tmp_t)
|
|
files_tmp_filetrans(ntpd_t, ntpd_tmp_t, { file dir })
|
|
|
|
manage_files_pattern(ntpd_t,ntpd_var_run_t,ntpd_var_run_t)
|
|
files_pid_filetrans(ntpd_t,ntpd_var_run_t,file)
|
|
|
|
kernel_read_kernel_sysctls(ntpd_t)
|
|
kernel_read_system_state(ntpd_t)
|
|
kernel_read_network_state(ntpd_t)
|
|
|
|
corenet_non_ipsec_sendrecv(ntpd_t)
|
|
corenet_tcp_sendrecv_all_if(ntpd_t)
|
|
corenet_udp_sendrecv_all_if(ntpd_t)
|
|
corenet_tcp_sendrecv_all_nodes(ntpd_t)
|
|
corenet_udp_sendrecv_all_nodes(ntpd_t)
|
|
corenet_tcp_sendrecv_all_ports(ntpd_t)
|
|
corenet_udp_sendrecv_all_ports(ntpd_t)
|
|
corenet_tcp_bind_all_nodes(ntpd_t)
|
|
corenet_udp_bind_all_nodes(ntpd_t)
|
|
corenet_udp_bind_ntp_port(ntpd_t)
|
|
corenet_tcp_connect_ntp_port(ntpd_t)
|
|
corenet_sendrecv_ntp_server_packets(ntpd_t)
|
|
corenet_sendrecv_ntp_client_packets(ntpd_t)
|
|
|
|
dev_read_sysfs(ntpd_t)
|
|
# for SSP
|
|
dev_read_urand(ntpd_t)
|
|
|
|
fs_getattr_all_fs(ntpd_t)
|
|
fs_search_auto_mountpoints(ntpd_t)
|
|
|
|
term_dontaudit_use_console(ntpd_t)
|
|
|
|
auth_use_nsswitch(ntpd_t)
|
|
|
|
corecmd_exec_bin(ntpd_t)
|
|
corecmd_exec_sbin(ntpd_t)
|
|
corecmd_exec_ls(ntpd_t)
|
|
corecmd_exec_shell(ntpd_t)
|
|
|
|
domain_use_interactive_fds(ntpd_t)
|
|
domain_dontaudit_list_all_domains_state(ntpd_t)
|
|
|
|
files_read_etc_files(ntpd_t)
|
|
files_read_etc_runtime_files(ntpd_t)
|
|
files_read_usr_files(ntpd_t)
|
|
files_list_var_lib(ntpd_t)
|
|
|
|
init_exec_script_files(ntpd_t)
|
|
init_use_fds(ntpd_t)
|
|
init_use_script_ptys(ntpd_t)
|
|
|
|
libs_use_ld_so(ntpd_t)
|
|
libs_use_shared_libs(ntpd_t)
|
|
|
|
logging_send_syslog_msg(ntpd_t)
|
|
|
|
miscfiles_read_localization(ntpd_t)
|
|
|
|
sysnet_read_config(ntpd_t)
|
|
|
|
userdom_dontaudit_use_unpriv_user_fds(ntpd_t)
|
|
userdom_list_sysadm_home_dirs(ntpd_t)
|
|
userdom_dontaudit_list_sysadm_home_dirs(ntpd_t)
|
|
|
|
ifdef(`targeted_policy', `
|
|
term_dontaudit_use_unallocated_ttys(ntpd_t)
|
|
term_dontaudit_use_generic_ptys(ntpd_t)
|
|
files_dontaudit_read_root_files(ntpd_t)
|
|
|
|
optional_policy(`
|
|
# The Gnome date GUI code is requesting that
|
|
# the ntp code change the date of the machine.
|
|
unconfined_rw_pipes(ntpd_t)
|
|
')
|
|
')
|
|
|
|
optional_policy(`
|
|
# for cron jobs
|
|
cron_system_entry(ntpd_t,ntpdate_exec_t)
|
|
')
|
|
|
|
optional_policy(`
|
|
firstboot_dontaudit_use_fds(ntpd_t)
|
|
')
|
|
|
|
optional_policy(`
|
|
logrotate_exec(ntpd_t)
|
|
')
|
|
|
|
optional_policy(`
|
|
seutil_sigchld_newrole(ntpd_t)
|
|
')
|
|
|
|
optional_policy(`
|
|
udev_read_db(ntpd_t)
|
|
')
|