|
Chris PeBenito |
29af4c |
policy_module(ntp, 1.10.0)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Declarations
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type ntp_drift_t;
|
|
Chris PeBenito |
17de1b |
files_type(ntp_drift_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type ntpd_t;
|
|
Chris PeBenito |
17de1b |
type ntpd_exec_t;
|
|
Chris PeBenito |
0bfccd |
init_daemon_domain(ntpd_t, ntpd_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
48f645 |
type ntpd_initrc_exec_t;
|
|
Chris PeBenito |
48f645 |
init_script_file(ntpd_initrc_exec_t)
|
|
Chris PeBenito |
48f645 |
|
|
Chris PeBenito |
878691 |
type ntpd_key_t;
|
|
Chris PeBenito |
878691 |
files_type(ntpd_key_t)
|
|
Chris PeBenito |
878691 |
|
|
Chris PeBenito |
17de1b |
type ntpd_log_t;
|
|
Chris PeBenito |
17de1b |
logging_log_file(ntpd_log_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type ntpd_tmp_t;
|
|
Chris PeBenito |
17de1b |
files_tmp_file(ntpd_tmp_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
cca4a2 |
type ntpd_tmpfs_t;
|
|
Chris PeBenito |
cca4a2 |
files_tmpfs_file(ntpd_tmpfs_t)
|
|
Chris PeBenito |
cca4a2 |
|
|
Chris PeBenito |
17de1b |
type ntpd_var_run_t;
|
|
Chris PeBenito |
17de1b |
files_pid_file(ntpd_var_run_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type ntpdate_exec_t;
|
|
Chris PeBenito |
0bfccd |
init_system_domain(ntpd_t, ntpdate_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# sys_resource and setrlimit is for locking memory
|
|
Chris PeBenito |
17de1b |
# ntpdate wants sys_nice
|
|
Chris PeBenito |
82cdff |
allow ntpd_t self:capability { chown dac_override kill setgid setuid sys_time ipc_lock ipc_owner sys_chroot sys_nice sys_resource };
|
|
Chris PeBenito |
17de1b |
dontaudit ntpd_t self:capability { net_admin sys_tty_config fsetid sys_nice };
|
|
Chris PeBenito |
878691 |
allow ntpd_t self:process { signal_perms getcap setcap setsched setrlimit };
|
|
Chris PeBenito |
0b36a2 |
allow ntpd_t self:fifo_file rw_fifo_file_perms;
|
|
Chris PeBenito |
82cdff |
allow ntpd_t self:shm create_shm_perms;
|
|
Chris PeBenito |
17de1b |
allow ntpd_t self:unix_dgram_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow ntpd_t self:unix_stream_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow ntpd_t self:tcp_socket create_stream_socket_perms;
|
|
Chris PeBenito |
33c7e6 |
allow ntpd_t self:udp_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
0bfccd |
manage_files_pattern(ntpd_t, ntp_drift_t, ntp_drift_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
3f67f7 |
can_exec(ntpd_t, ntpd_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
878691 |
read_files_pattern(ntpd_t, ntpd_key_t, ntpd_key_t)
|
|
Chris PeBenito |
82cdff |
read_lnk_files_pattern(ntpd_t, ntpd_key_t, ntpd_key_t)
|
|
Chris PeBenito |
878691 |
|
|
Chris PeBenito |
c0868a |
allow ntpd_t ntpd_log_t:dir setattr;
|
|
Chris PeBenito |
3f67f7 |
manage_files_pattern(ntpd_t, ntpd_log_t, ntpd_log_t)
|
|
Chris PeBenito |
3f67f7 |
logging_log_filetrans(ntpd_t, ntpd_log_t, { file dir })
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# for some reason it creates a file in /tmp
|
|
Chris PeBenito |
0bfccd |
manage_dirs_pattern(ntpd_t, ntpd_tmp_t, ntpd_tmp_t)
|
|
Chris PeBenito |
0bfccd |
manage_files_pattern(ntpd_t, ntpd_tmp_t, ntpd_tmp_t)
|
|
Chris PeBenito |
17de1b |
files_tmp_filetrans(ntpd_t, ntpd_tmp_t, { file dir })
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
cca4a2 |
manage_dirs_pattern(ntpd_t, ntpd_tmpfs_t, ntpd_tmpfs_t)
|
|
Chris PeBenito |
cca4a2 |
manage_files_pattern(ntpd_t, ntpd_tmpfs_t, ntpd_tmpfs_t)
|
|
Chris PeBenito |
cca4a2 |
fs_tmpfs_filetrans(ntpd_t, ntpd_tmpfs_t, { dir file })
|
|
Chris PeBenito |
cca4a2 |
|
|
Chris PeBenito |
0bfccd |
manage_files_pattern(ntpd_t, ntpd_var_run_t, ntpd_var_run_t)
|
|
Chris PeBenito |
0bfccd |
files_pid_filetrans(ntpd_t, ntpd_var_run_t, file)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_kernel_sysctls(ntpd_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(ntpd_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_network_state(ntpd_t)
|
|
Chris PeBenito |
82cdff |
kernel_request_load_module(ntpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
190066 |
corenet_all_recvfrom_unlabeled(ntpd_t)
|
|
Chris PeBenito |
190066 |
corenet_all_recvfrom_netlabel(ntpd_t)
|
|
Chris PeBenito |
668b30 |
corenet_tcp_sendrecv_generic_if(ntpd_t)
|
|
Chris PeBenito |
668b30 |
corenet_udp_sendrecv_generic_if(ntpd_t)
|
|
Chris PeBenito |
c12621 |
corenet_tcp_sendrecv_generic_node(ntpd_t)
|
|
Chris PeBenito |
c12621 |
corenet_udp_sendrecv_generic_node(ntpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_ports(ntpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_ports(ntpd_t)
|
|
Chris PeBenito |
c12621 |
corenet_tcp_bind_generic_node(ntpd_t)
|
|
Chris PeBenito |
c12621 |
corenet_udp_bind_generic_node(ntpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_bind_ntp_port(ntpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_connect_ntp_port(ntpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_sendrecv_ntp_server_packets(ntpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_sendrecv_ntp_client_packets(ntpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dev_read_sysfs(ntpd_t)
|
|
Chris PeBenito |
17de1b |
# for SSP
|
|
Chris PeBenito |
17de1b |
dev_read_urand(ntpd_t)
|
|
Dan Walsh |
3eaa99 |
dev_rw_realtime_clock(ntpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
fs_getattr_all_fs(ntpd_t)
|
|
Chris PeBenito |
17de1b |
fs_search_auto_mountpoints(ntpd_t)
|
|
Dan Walsh |
3eaa99 |
# Necessary to communicate with gpsd devices
|
|
Dan Walsh |
3eaa99 |
fs_rw_tmpfs_files(ntpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
878691 |
term_use_ptmx(ntpd_t)
|
|
Chris PeBenito |
878691 |
|
|
Chris PeBenito |
17de1b |
auth_use_nsswitch(ntpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corecmd_exec_bin(ntpd_t)
|
|
Chris PeBenito |
17de1b |
corecmd_exec_shell(ntpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_use_interactive_fds(ntpd_t)
|
|
Chris PeBenito |
17de1b |
domain_dontaudit_list_all_domains_state(ntpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(ntpd_t)
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files(ntpd_t)
|
|
Chris PeBenito |
17de1b |
files_read_usr_files(ntpd_t)
|
|
Chris PeBenito |
17de1b |
files_list_var_lib(ntpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
init_exec_script_files(ntpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(ntpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(ntpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
userdom_dontaudit_use_unpriv_user_fds(ntpd_t)
|
|
Chris PeBenito |
296273 |
userdom_list_user_home_dirs(ntpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
# for cron jobs
|
|
Chris PeBenito |
0bfccd |
cron_system_entry(ntpd_t, ntpdate_exec_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
cca4a2 |
gpsd_rw_shm(ntpd_t)
|
|
Chris PeBenito |
cca4a2 |
')
|
|
Chris PeBenito |
cca4a2 |
|
|
Chris PeBenito |
cca4a2 |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
firstboot_dontaudit_use_fds(ntpd_t)
|
|
Chris PeBenito |
9af48e |
firstboot_dontaudit_rw_pipes(ntpd_t)
|
|
Chris PeBenito |
93f445 |
firstboot_dontaudit_rw_stream_sockets(ntpd_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
878691 |
hal_dontaudit_write_log(ntpd_t)
|
|
Chris PeBenito |
878691 |
')
|
|
Chris PeBenito |
878691 |
|
|
Chris PeBenito |
878691 |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
logrotate_exec(ntpd_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
seutil_sigchld_newrole(ntpd_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
udev_read_db(ntpd_t)
|
|
Chris PeBenito |
17de1b |
')
|