-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathprometheusd.if
148 lines (129 loc) · 3.21 KB
/
prometheusd.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
144
145
146
147
## <summary>policy for prometheusd</summary>
########################################
## <summary>
## Create a set of derived types for various
## prometheus exporters,
## </summary>
## <param name="prefix">
## <summary>
## The name to be used for deriving type names.
## </summary>
## </param>
#
template(`prometheusd_exporter_template',`
# gen_require(`
# attribute prometheusd_exporter_domain;
# type prometheusd_t;
# ')
type $1_prometheusd_exporter_t;
type $1_prometheusd_exporter_exec_t;
init_daemon_domain($1_prometheusd_exporter_t, $1_prometheusd_exporter_exec_t)
role system_r types $1_prometheusd_exporter_t;
')
########################################
## <summary>
## Create a set of derived types for various
## prometheus modules,
## </summary>
## <param name="prefix">
## <summary>
## The name to be used for deriving type names.
## </summary>
## </param>
#
template(`prometheusd_module_template',`
type $1_prometheusd_t;
type $1_prometheusd_exec_t;
init_daemon_domain($1_prometheusd_t, $1_prometheusd_exec_t)
role system_r types $1_prometheusd_t;
type $1_prometheusd_conf_t;
files_config_file($1_prometheusd_conf_t)
type $1_prometheusd_data_t;
files_type($1_prometheusd_data_t)
')
########################################
## <summary>
## Execute prometheusd_exec_t in the prometheusd domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`prometheusd_domtrans',`
gen_require(`
type prometheusd_t, prometheusd_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, prometheusd_exec_t, prometheusd_t)
')
######################################
## <summary>
## Execute prometheusd in the caller domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`prometheusd_exec',`
gen_require(`
type prometheusd_exec_t;
')
corecmd_search_bin($1)
can_exec($1, prometheusd_exec_t)
')
#######################################
## <summary>
## Allow domain to connect to alertmananger port. Used for reverse proxy
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`connect_alertmanager_prometheusd_port',`
gen_require(`
class tcp_socket name_connect;
type alertmanager_prometheusd_port_t;
')
allow $1 alertmanager_prometheusd_port_t:tcp_socket name_connect;
')
#######################################
## <summary>
## Read prometheus time series database.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`prometheusd_read_db',`
gen_require(`
type prometheusd_db_t;
')
files_search_usr($1)
read_files_pattern($1, prometheusd_db_t, prometheusd_db_t)
')
#######################################
## <summary>
## Manage prometheusd time series database.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`prometheusd_manage_db',`
gen_require(`
type prometheusd_db_t;
')
files_search_usr($1)
manage_dirs_pattern($1, prometheusd_db_t, prometheusd_db_t)
manage_files_pattern($1, prometheusd_db_t, prometheusd_db_t)
')