summaryrefslogtreecommitdiff
path: root/policy/modules/services/clockspeed.te
blob: 26d09f1bb7ef530d46ac44961dc742b2d97e2a3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

policy_module(clockspeed, 1.5.0)

########################################
#
# Declarations
#

type clockspeed_cli_t;
type clockspeed_cli_exec_t;
application_domain(clockspeed_cli_t, clockspeed_cli_exec_t)

type clockspeed_srv_t;
type clockspeed_srv_exec_t;
init_daemon_domain(clockspeed_srv_t, clockspeed_srv_exec_t)

type clockspeed_var_lib_t;
files_type(clockspeed_var_lib_t)

########################################
#
# Client local policy
#

allow clockspeed_cli_t self:capability sys_time;
allow clockspeed_cli_t self:udp_socket create_socket_perms;

read_files_pattern(clockspeed_cli_t, clockspeed_var_lib_t, clockspeed_var_lib_t)

corenet_all_recvfrom_unlabeled(clockspeed_cli_t)
corenet_all_recvfrom_netlabel(clockspeed_cli_t)
corenet_udp_sendrecv_generic_if(clockspeed_cli_t)
corenet_udp_sendrecv_generic_node(clockspeed_cli_t)
corenet_udp_sendrecv_ntp_port(clockspeed_cli_t)
corenet_sendrecv_ntp_client_packets(clockspeed_cli_t)

files_list_var_lib(clockspeed_cli_t)
files_read_etc_files(clockspeed_cli_t)

miscfiles_read_localization(clockspeed_cli_t)

userdom_use_user_terminals(clockspeed_cli_t)

########################################
#
# Server local policy
#

allow clockspeed_srv_t self:capability { sys_time net_bind_service };
allow clockspeed_srv_t self:udp_socket create_socket_perms;
allow clockspeed_srv_t self:unix_dgram_socket create_socket_perms;
allow clockspeed_srv_t self:unix_stream_socket create_socket_perms;

manage_files_pattern(clockspeed_srv_t, clockspeed_var_lib_t, clockspeed_var_lib_t)
manage_fifo_files_pattern(clockspeed_srv_t, clockspeed_var_lib_t, clockspeed_var_lib_t)

corenet_all_recvfrom_unlabeled(clockspeed_srv_t)
corenet_all_recvfrom_netlabel(clockspeed_srv_t)
corenet_udp_sendrecv_generic_if(clockspeed_srv_t)
corenet_udp_sendrecv_generic_node(clockspeed_srv_t)
corenet_udp_sendrecv_ntp_port(clockspeed_srv_t)
corenet_udp_bind_generic_node(clockspeed_srv_t)
corenet_udp_bind_clockspeed_port(clockspeed_srv_t)
corenet_sendrecv_clockspeed_server_packets(clockspeed_srv_t)

files_read_etc_files(clockspeed_srv_t)
files_list_var_lib(clockspeed_srv_t)

miscfiles_read_localization(clockspeed_srv_t)

optional_policy(`
	daemontools_service_domain(clockspeed_srv_t, clockspeed_srv_exec_t)
')