forked from OwlCyberDefense/refpolicy-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmilter.if
117 lines (102 loc) · 2.53 KB
/
milter.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
## <summary>Milter mail filters.</summary>
#######################################
## <summary>
## The template to define a milter domain.
## </summary>
## <param name="domain_prefix">
## <summary>
## Domain prefix to be used.
## </summary>
## </param>
#
template(`milter_template',`
gen_require(`
attribute milter_data_type, milter_domains;
')
########################################
#
# Declarations
#
type $1_milter_t, milter_domains;
type $1_milter_exec_t;
init_daemon_domain($1_milter_t, $1_milter_exec_t)
type $1_milter_data_t, milter_data_type;
files_pid_file($1_milter_data_t)
########################################
#
# Policy
#
manage_files_pattern($1_milter_t, $1_milter_data_t, $1_milter_data_t)
manage_sock_files_pattern($1_milter_t, $1_milter_data_t, $1_milter_data_t)
auth_use_nsswitch($1_milter_t)
')
########################################
## <summary>
## connect to all milter domains using
## a unix domain stream socket.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`milter_stream_connect_all',`
gen_require(`
attribute milter_data_type, milter_domains;
')
files_search_pids($1)
stream_connect_pattern($1, milter_data_type, milter_data_type, milter_domains)
')
########################################
## <summary>
## Get attributes of all milter sock files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`milter_getattr_all_sockets',`
gen_require(`
attribute milter_data_type;
')
getattr_sock_files_pattern($1, milter_data_type, milter_data_type)
')
########################################
## <summary>
## Create, read, write, and delete
## spamassissin milter data content.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`milter_manage_spamass_state',`
gen_require(`
type spamass_milter_state_t;
')
files_search_var_lib($1)
manage_files_pattern($1, spamass_milter_state_t, spamass_milter_state_t)
manage_dirs_pattern($1, spamass_milter_state_t, spamass_milter_state_t)
manage_lnk_files_pattern($1, spamass_milter_state_t, spamass_milter_state_t)
')
########################################
## <summary>
## Get the attributes of the spamassissin milter data dir.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`milter_getattr_data_dir',`
gen_require(`
type spamass_milter_data_t;
')
allow $1 spamass_milter_data_t:dir getattr;
')