aboutsummaryrefslogtreecommitdiff
blob: 4438766b415f30c3f1c53d41c70c78f4305c2317 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
policy_module(pyzor, 2.5.0)

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

attribute_role pyzor_roles;
roleattribute system_r pyzor_roles;

type pyzor_t;
type pyzor_exec_t;
userdom_user_application_domain(pyzor_t, pyzor_exec_t)
role pyzor_roles types pyzor_t;

type pyzor_etc_t;
files_type(pyzor_etc_t)

type pyzor_home_t;
userdom_user_home_content(pyzor_home_t)

type pyzor_tmp_t;
userdom_user_tmp_file(pyzor_tmp_t)

type pyzor_var_lib_t;
files_type(pyzor_var_lib_t)
ubac_constrained(pyzor_var_lib_t)

type pyzord_t;
type pyzord_exec_t;
init_daemon_domain(pyzord_t, pyzord_exec_t)

type pyzord_initrc_exec_t;
init_script_file(pyzord_initrc_exec_t)

type pyzord_log_t;
logging_log_file(pyzord_log_t)

########################################
#
# Local policy
#

manage_dirs_pattern(pyzor_t, pyzor_home_t, pyzor_home_t)
manage_files_pattern(pyzor_t, pyzor_home_t, pyzor_home_t)
manage_lnk_files_pattern(pyzor_t, pyzor_home_t, pyzor_home_t)
userdom_user_home_dir_filetrans(pyzor_t, pyzor_home_t, dir, ".pyzor")

allow pyzor_t pyzor_var_lib_t:dir list_dir_perms;
read_files_pattern(pyzor_t, pyzor_var_lib_t, pyzor_var_lib_t)

manage_files_pattern(pyzor_t, pyzor_tmp_t, pyzor_tmp_t)
manage_dirs_pattern(pyzor_t, pyzor_tmp_t, pyzor_tmp_t)
files_tmp_filetrans(pyzor_t, pyzor_tmp_t, { file dir })

kernel_read_kernel_sysctls(pyzor_t)
kernel_read_system_state(pyzor_t)

corecmd_list_bin(pyzor_t)
corecmd_getattr_bin_files(pyzor_t)

corenet_all_recvfrom_unlabeled(pyzor_t)
corenet_all_recvfrom_netlabel(pyzor_t)
corenet_tcp_sendrecv_generic_if(pyzor_t)
corenet_tcp_sendrecv_generic_node(pyzor_t)

corenet_sendrecv_http_client_packets(pyzor_t)
corenet_tcp_connect_http_port(pyzor_t)
corenet_tcp_sendrecv_http_port(pyzor_t)

dev_read_urand(pyzor_t)

fs_getattr_all_fs(pyzor_t)
fs_search_auto_mountpoints(pyzor_t)

auth_use_nsswitch(pyzor_t)

miscfiles_read_localization(pyzor_t)

mta_read_queue(pyzor_t)

tunable_policy(`use_nfs_home_dirs',`
	fs_manage_nfs_dirs(pyzor_t)
	fs_manage_nfs_files(pyzor_t)
	fs_manage_nfs_symlinks(pyzor_t)
')

tunable_policy(`use_samba_home_dirs',`
	fs_manage_cifs_dirs(pyzor_t)
	fs_manage_cifs_files(pyzor_t)
	fs_manage_cifs_symlinks(pyzor_t)
')

optional_policy(`
	amavis_manage_lib_files(pyzor_t)
	amavis_manage_spool_files(pyzor_t)
')

optional_policy(`
	spamassassin_signal_spamd(pyzor_t)
	spamassassin_read_spamd_tmp_files(pyzor_t)
')

########################################
#
# Daemon local policy
#

allow pyzord_t pyzor_var_lib_t:dir setattr_dir_perms;
manage_files_pattern(pyzord_t, pyzor_var_lib_t, pyzor_var_lib_t)
files_var_lib_filetrans(pyzord_t, pyzor_var_lib_t, { file dir })

allow pyzord_t pyzor_etc_t:dir list_dir_perms;
allow pyzord_t pyzor_etc_t:file read_file_perms;
allow pyzord_t pyzor_etc_t:lnk_file read_lnk_file_perms;

allow pyzord_t pyzord_log_t:dir setattr_dir_perms;
append_files_pattern(pyzord_t, pyzord_log_t, pyzord_log_t)
create_files_pattern(pyzord_t, pyzord_log_t, pyzord_log_t)
setattr_files_pattern(pyzord_t, pyzord_log_t, pyzord_log_t)
logging_log_filetrans(pyzord_t, pyzord_log_t, { file dir })

can_exec(pyzord_t, pyzor_exec_t)

kernel_read_kernel_sysctls(pyzord_t)
kernel_read_system_state(pyzord_t)

dev_read_urand(pyzord_t)

corecmd_exec_bin(pyzord_t)

corenet_all_recvfrom_unlabeled(pyzord_t)
corenet_all_recvfrom_netlabel(pyzord_t)
corenet_udp_sendrecv_generic_if(pyzord_t)
corenet_udp_sendrecv_generic_node(pyzord_t)
corenet_udp_bind_generic_node(pyzord_t)

corenet_sendrecv_pyzor_server_packets(pyzord_t)
corenet_udp_bind_pyzor_port(pyzord_t)
corenet_udp_sendrecv_pyzor_port(pyzord_t)

auth_use_nsswitch(pyzord_t)

logging_send_syslog_msg(pyzord_t)

locallogin_dontaudit_use_fds(pyzord_t)

miscfiles_read_localization(pyzord_t)

userdom_dontaudit_search_user_home_dirs(pyzord_t)

mta_manage_spool(pyzord_t)