forked from OwlCyberDefense/refpolicy-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqmail.if
143 lines (125 loc) · 2.62 KB
/
qmail.if
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
## <summary>Qmail Mail Server.</summary>
########################################
## <summary>
## Template for qmail parent/sub-domain pairs.
## </summary>
## <param name="child_prefix">
## <summary>
## The prefix of the child domain.
## </summary>
## </param>
## <param name="parent_domain">
## <summary>
## The name of the parent domain.
## </summary>
## </param>
#
template(`qmail_child_domain_template',`
gen_require(`
attribute qmail_child_domain;
')
########################################
#
# Declarations
#
type $1_t, qmail_child_domain;
type $1_exec_t;
domain_type($1_t)
domain_entry_file($1_t, $1_exec_t)
role system_r types $1_t;
########################################
#
# Policy
#
domtrans_pattern($2, $1_exec_t, $1_t)
kernel_read_system_state($2)
')
########################################
## <summary>
## Transition to qmail_inject_t.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`qmail_domtrans_inject',`
gen_require(`
type qmail_inject_t, qmail_inject_exec_t;
')
domtrans_pattern($1, qmail_inject_exec_t, qmail_inject_t)
ifdef(`distro_debian',`
files_search_usr($1)
corecmd_search_bin($1)
',`
files_search_var($1)
')
')
########################################
## <summary>
## Transition to qmail_queue_t.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`qmail_domtrans_queue',`
gen_require(`
type qmail_queue_t, qmail_queue_exec_t;
')
domtrans_pattern($1, qmail_queue_exec_t, qmail_queue_t)
ifdef(`distro_debian',`
files_search_usr($1)
corecmd_search_bin($1)
',`
files_search_var($1)
')
')
########################################
## <summary>
## Read qmail configuration files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`qmail_read_config',`
gen_require(`
type qmail_etc_t;
')
files_search_var($1)
allow $1 qmail_etc_t:dir list_dir_perms;
allow $1 qmail_etc_t:file read_file_perms;
allow $1 qmail_etc_t:lnk_file read_lnk_file_perms;
ifdef(`distro_debian',`
files_search_etc($1)
')
')
########################################
## <summary>
## Define the specified domain as a
## qmail-smtp service.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access
## </summary>
## </param>
## <param name="entrypoint">
## <summary>
## The type associated with the process program.
## </summary>
## </param>
#
interface(`qmail_smtpd_service_domain',`
gen_require(`
type qmail_smtpd_t;
')
domtrans_pattern(qmail_smtpd_t, $2, $1)
')