aboutsummaryrefslogtreecommitdiff
blob: 95c89765159141e03d525a9b7a277b485d08346e (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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
policy_module(sendmail)

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

attribute_role sendmail_roles;

attribute_role sendmail_unconfined_roles;
roleattribute system_r sendmail_unconfined_roles;

type sendmail_initrc_exec_t;
init_script_file(sendmail_initrc_exec_t)

type sendmail_keytab_t;
files_type(sendmail_keytab_t)

type sendmail_log_t;
logging_log_file(sendmail_log_t)

type sendmail_runtime_t alias sendmail_var_run_t;
files_runtime_file(sendmail_runtime_t)

type sendmail_tmp_t;
files_tmp_file(sendmail_tmp_t)

type sendmail_t;
mta_sendmail_mailserver(sendmail_t)
mta_mailserver_delivery(sendmail_t)
mta_mailserver_sender(sendmail_t)
role sendmail_roles types sendmail_t;

type unconfined_sendmail_t;
application_type(unconfined_sendmail_t)
mta_sendmail_entry_point(unconfined_sendmail_t)
role sendmail_unconfined_roles types unconfined_sendmail_t;

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

allow sendmail_t self:capability { chown dac_override setgid setuid sys_nice sys_tty_config };
allow sendmail_t self:process { setpgid setrlimit setsched signal signull };
allow sendmail_t self:fifo_file rw_fifo_file_perms;
allow sendmail_t self:unix_stream_socket { accept listen };
allow sendmail_t self:tcp_socket { accept listen };

allow sendmail_t sendmail_keytab_t:file read_file_perms;

allow sendmail_t sendmail_log_t:dir setattr_dir_perms;
append_files_pattern(sendmail_t, sendmail_log_t, sendmail_log_t)
create_files_pattern(sendmail_t, sendmail_log_t, sendmail_log_t)
setattr_files_pattern(sendmail_t, sendmail_log_t, sendmail_log_t)
logging_log_filetrans(sendmail_t, sendmail_log_t, { file dir })

manage_dirs_pattern(sendmail_t, sendmail_tmp_t, sendmail_tmp_t)
manage_files_pattern(sendmail_t, sendmail_tmp_t, sendmail_tmp_t)
files_tmp_filetrans(sendmail_t, sendmail_tmp_t, { file dir })

allow sendmail_t sendmail_runtime_t:file manage_file_perms;
files_runtime_filetrans(sendmail_t, sendmail_runtime_t, file)

kernel_read_network_state(sendmail_t)
kernel_read_kernel_sysctls(sendmail_t)
kernel_read_system_state(sendmail_t)

corenet_all_recvfrom_netlabel(sendmail_t)
corenet_tcp_sendrecv_generic_if(sendmail_t)
corenet_tcp_sendrecv_generic_node(sendmail_t)
corenet_tcp_bind_generic_node(sendmail_t)

corenet_sendrecv_smtp_server_packets(sendmail_t)
corenet_tcp_bind_smtp_port(sendmail_t)

corenet_sendrecv_all_client_packets(sendmail_t)
corenet_tcp_connect_all_ports(sendmail_t)

corecmd_exec_bin(sendmail_t)
corecmd_exec_shell(sendmail_t)

dev_read_sysfs(sendmail_t)
dev_read_urand(sendmail_t)

domain_use_interactive_fds(sendmail_t)

files_read_all_tmp_files(sendmail_t)
files_read_etc_runtime_files(sendmail_t)
files_read_usr_files(sendmail_t)
files_search_spool(sendmail_t)

fs_getattr_all_fs(sendmail_t)
fs_search_auto_mountpoints(sendmail_t)
fs_rw_anon_inodefs_files(sendmail_t)

term_dontaudit_use_console(sendmail_t)
term_dontaudit_use_generic_ptys(sendmail_t)

init_use_fds(sendmail_t)
init_use_script_ptys(sendmail_t)
init_read_utmp(sendmail_t)
init_dontaudit_write_utmp(sendmail_t)
init_rw_script_tmp_files(sendmail_t)

auth_use_nsswitch(sendmail_t)

libs_read_lib_files(sendmail_t)

logging_send_syslog_msg(sendmail_t)
logging_dontaudit_write_generic_logs(sendmail_t)

miscfiles_read_generic_certs(sendmail_t)
miscfiles_read_localization(sendmail_t)
miscfiles_read_generic_tls_privkey(sendmail_t)

userdom_dontaudit_use_unpriv_user_fds(sendmail_t)

mta_etc_filetrans_aliases(sendmail_t, file, "aliases")
mta_etc_filetrans_aliases(sendmail_t, file, "aliases.db")
mta_etc_filetrans_aliases(sendmail_t, file, "__db.aliases.db")
mta_etc_filetrans_aliases(sendmail_t, file, "aliasesdb-stamp")
mta_manage_aliases(sendmail_t)
mta_manage_queue(sendmail_t)
mta_manage_spool(sendmail_t)
mta_read_config(sendmail_t)
mta_sendmail_exec(sendmail_t)

optional_policy(`
	cfengine_dontaudit_write_log_files(sendmail_t)
')

optional_policy(`
	cron_read_pipes(sendmail_t)
')

optional_policy(`
	clamav_search_lib(sendmail_t)
	clamav_stream_connect(sendmail_t)
')

optional_policy(`
	cyrus_stream_connect(sendmail_t)
')

optional_policy(`
	dovecot_write_inherited_tmp_files(sendmail_t)
')

optional_policy(`
	exim_domtrans(sendmail_t)
	exim_manage_spool_files(sendmail_t)
	exim_manage_spool_dirs(sendmail_t)
	exim_read_log(sendmail_t)
')

optional_policy(`
	fail2ban_read_lib_files(sendmail_t)
	fail2ban_rw_stream_sockets(sendmail_t)
')

optional_policy(`
	kerberos_read_keytab(sendmail_t)
	kerberos_use(sendmail_t)
')

optional_policy(`
	milter_stream_connect_all(sendmail_t)
')

optional_policy(`
	munin_dontaudit_search_lib(sendmail_t)
')

optional_policy(`
	postfix_domtrans_postdrop(sendmail_t)
	postfix_domtrans_master(sendmail_t)
	postfix_domtrans_postqueue(sendmail_t)
	postfix_read_config(sendmail_t)
	postfix_search_spool(sendmail_t)
')

optional_policy(`
	procmail_domtrans(sendmail_t)
	procmail_rw_tmp_files(sendmail_t)
')

optional_policy(`
	seutil_sigchld_newrole(sendmail_t)
')

optional_policy(`
	sasl_connect(sendmail_t)
')

optional_policy(`
	userdom_use_inherited_user_terminals(sendmail_t)
')

optional_policy(`
	uucp_domtrans_uux(sendmail_t)
')

########################################
#
# Unconfined local policy
#

optional_policy(`
	mta_etc_filetrans_aliases(unconfined_sendmail_t, file, "aliases")
	mta_etc_filetrans_aliases(unconfined_sendmail_t, file, "aliases.db")
	mta_etc_filetrans_aliases(unconfined_sendmail_t, file, "__db.aliases.db")
	mta_etc_filetrans_aliases(unconfined_sendmail_t, file, "aliasesdb-stamp")
	unconfined_domain(unconfined_sendmail_t)
')