2005-09-05 16:47:19 +00:00
|
|
|
|
2009-08-05 14:59:21 +00:00
|
|
|
policy_module(ntp, 1.9.0)
|
2005-09-05 16:47:19 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type ntp_drift_t;
|
|
|
|
files_type(ntp_drift_t)
|
|
|
|
|
|
|
|
type ntpd_t;
|
|
|
|
type ntpd_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
init_daemon_domain(ntpd_t, ntpd_exec_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
|
2008-09-15 14:20:20 +00:00
|
|
|
type ntpd_initrc_exec_t;
|
|
|
|
init_script_file(ntpd_initrc_exec_t)
|
|
|
|
|
2008-09-11 14:54:40 +00:00
|
|
|
type ntpd_key_t;
|
|
|
|
files_type(ntpd_key_t)
|
|
|
|
|
2005-09-05 16:47:19 +00:00
|
|
|
type ntpd_log_t;
|
|
|
|
logging_log_file(ntpd_log_t)
|
|
|
|
|
|
|
|
type ntpd_tmp_t;
|
|
|
|
files_tmp_file(ntpd_tmp_t)
|
|
|
|
|
2009-06-02 14:28:40 +00:00
|
|
|
type ntpd_tmpfs_t;
|
|
|
|
files_tmpfs_file(ntpd_tmpfs_t)
|
|
|
|
|
2005-09-05 16:47:19 +00:00
|
|
|
type ntpd_var_run_t;
|
|
|
|
files_pid_file(ntpd_var_run_t)
|
|
|
|
|
|
|
|
type ntpdate_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
init_system_domain(ntpd_t, ntpdate_exec_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
2005-10-13 20:59:36 +00:00
|
|
|
# sys_resource and setrlimit is for locking memory
|
2005-09-05 16:47:19 +00:00
|
|
|
# ntpdate wants sys_nice
|
2005-10-13 20:59:36 +00:00
|
|
|
allow ntpd_t self:capability { chown dac_override kill setgid setuid sys_time ipc_lock sys_chroot sys_nice sys_resource };
|
2005-09-05 16:47:19 +00:00
|
|
|
dontaudit ntpd_t self:capability { net_admin sys_tty_config fsetid sys_nice };
|
2008-09-11 14:54:40 +00:00
|
|
|
allow ntpd_t self:process { signal_perms getcap setcap setsched setrlimit };
|
2008-10-16 16:09:20 +00:00
|
|
|
allow ntpd_t self:fifo_file rw_fifo_file_perms;
|
2005-09-05 16:47:19 +00:00
|
|
|
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;
|
2006-08-15 20:00:58 +00:00
|
|
|
allow ntpd_t self:udp_socket create_socket_perms;
|
2005-09-05 16:47:19 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(ntpd_t, ntp_drift_t, ntp_drift_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
|
2009-06-26 14:40:13 +00:00
|
|
|
can_exec(ntpd_t, ntpd_exec_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
|
2008-09-11 14:54:40 +00:00
|
|
|
read_files_pattern(ntpd_t, ntpd_key_t, ntpd_key_t)
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow ntpd_t ntpd_log_t:dir setattr;
|
2009-06-26 14:40:13 +00:00
|
|
|
manage_files_pattern(ntpd_t, ntpd_log_t, ntpd_log_t)
|
|
|
|
logging_log_filetrans(ntpd_t, ntpd_log_t, { file dir })
|
2005-09-05 16:47:19 +00:00
|
|
|
|
|
|
|
# for some reason it creates a file in /tmp
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern(ntpd_t, ntpd_tmp_t, ntpd_tmp_t)
|
|
|
|
manage_files_pattern(ntpd_t, ntpd_tmp_t, ntpd_tmp_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(ntpd_t, ntpd_tmp_t, { file dir })
|
2005-09-05 16:47:19 +00:00
|
|
|
|
2009-06-02 14:28:40 +00:00
|
|
|
manage_dirs_pattern(ntpd_t, ntpd_tmpfs_t, ntpd_tmpfs_t)
|
|
|
|
manage_files_pattern(ntpd_t, ntpd_tmpfs_t, ntpd_tmpfs_t)
|
|
|
|
fs_tmpfs_filetrans(ntpd_t, ntpd_tmpfs_t, { dir file })
|
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(ntpd_t, ntpd_var_run_t, ntpd_var_run_t)
|
|
|
|
files_pid_filetrans(ntpd_t, ntpd_var_run_t, file)
|
2005-09-05 16:47:19 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(ntpd_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
kernel_read_system_state(ntpd_t)
|
2006-06-21 18:25:06 +00:00
|
|
|
kernel_read_network_state(ntpd_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled(ntpd_t)
|
|
|
|
corenet_all_recvfrom_netlabel(ntpd_t)
|
2009-01-06 20:24:10 +00:00
|
|
|
corenet_tcp_sendrecv_generic_if(ntpd_t)
|
|
|
|
corenet_udp_sendrecv_generic_if(ntpd_t)
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_sendrecv_generic_node(ntpd_t)
|
|
|
|
corenet_udp_sendrecv_generic_node(ntpd_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
corenet_tcp_sendrecv_all_ports(ntpd_t)
|
|
|
|
corenet_udp_sendrecv_all_ports(ntpd_t)
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_bind_generic_node(ntpd_t)
|
|
|
|
corenet_udp_bind_generic_node(ntpd_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
corenet_udp_bind_ntp_port(ntpd_t)
|
2005-09-13 13:06:07 +00:00
|
|
|
corenet_tcp_connect_ntp_port(ntpd_t)
|
2006-05-26 18:04:46 +00:00
|
|
|
corenet_sendrecv_ntp_server_packets(ntpd_t)
|
|
|
|
corenet_sendrecv_ntp_client_packets(ntpd_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
|
|
|
|
dev_read_sysfs(ntpd_t)
|
|
|
|
# for SSP
|
|
|
|
dev_read_urand(ntpd_t)
|
|
|
|
|
|
|
|
fs_getattr_all_fs(ntpd_t)
|
|
|
|
fs_search_auto_mountpoints(ntpd_t)
|
|
|
|
|
2008-09-11 14:54:40 +00:00
|
|
|
term_use_ptmx(ntpd_t)
|
|
|
|
|
2006-06-12 21:36:38 +00:00
|
|
|
auth_use_nsswitch(ntpd_t)
|
|
|
|
|
2005-09-05 16:47:19 +00:00
|
|
|
corecmd_exec_bin(ntpd_t)
|
|
|
|
corecmd_exec_shell(ntpd_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(ntpd_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
domain_dontaudit_list_all_domains_state(ntpd_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2006-02-06 15:40:41 +00:00
|
|
|
init_exec_script_files(ntpd_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
|
|
|
|
logging_send_syslog_msg(ntpd_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(ntpd_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fds(ntpd_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_list_user_home_dirs(ntpd_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-09-05 16:47:19 +00:00
|
|
|
# for cron jobs
|
2008-07-23 21:38:39 +00:00
|
|
|
cron_system_entry(ntpd_t, ntpdate_exec_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
')
|
|
|
|
|
2009-06-02 14:28:40 +00:00
|
|
|
optional_policy(`
|
|
|
|
gpsd_rw_shm(ntpd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-03-02 23:41:11 +00:00
|
|
|
firstboot_dontaudit_use_fds(ntpd_t)
|
2007-04-10 13:10:58 +00:00
|
|
|
firstboot_dontaudit_rw_pipes(ntpd_t)
|
2008-08-20 19:45:39 +00:00
|
|
|
firstboot_dontaudit_rw_stream_sockets(ntpd_t)
|
2005-09-05 16:47:19 +00:00
|
|
|
')
|
|
|
|
|
2008-09-11 14:54:40 +00:00
|
|
|
optional_policy(`
|
|
|
|
hal_dontaudit_write_log(ntpd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-09-05 16:47:19 +00:00
|
|
|
logrotate_exec(ntpd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-09-05 16:47:19 +00:00
|
|
|
seutil_sigchld_newrole(ntpd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-09-05 16:47:19 +00:00
|
|
|
udev_read_db(ntpd_t)
|
|
|
|
')
|