This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
static_config.conf
343 lines (274 loc) · 14 KB
/
static_config.conf
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
/* --------------------------------------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------------------------------------- */
// icinga2 static configuration for eduroam.cz
//
//
/* --------------------------------------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------------------------------------- */
index = 0
for(realm in realms) {
key = keys(realm)[0] // get realm
/* --------------------------------------------------------------------------------------------------------- */
// coverage-info
if(typeof(realm[key].home_servers) == Array) {
apply Service "COVERAGE-INFO-" + key use(realm, key) {
import "coverage info template"
vars.realm = key
groups = [ "COVERAGE-INFO" ]
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#coverage-info"
assign where host.name == realm[key].home_servers[0]
}
}
if(typeof(realm[key].home_servers) != Array) {
apply Service "COVERAGE-INFO-" + key use(realm, key) {
import "coverage info template"
vars.realm = key
groups = [ "COVERAGE-INFO" ]
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#coverage-info"
assign where host.name == realm[key].home_servers
}
}
/* --------------------------------------------------------------------------------------------------------- */
// compromised users
if(typeof(realm[key].home_servers) == Array) {
h = get_host(realm[key].home_servers[0]) // get host
if(h != null && host.vars.type != "SP") { // host exists and does not have "SP" type
apply Service "COMPROMISED-USERS-" + key use(realm, key) {
import "compromised users template"
groups = [ "COMPROMISED-USERS" ]
enable_notifications = false
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#compromised-users"
assign where host.name == realm[key].home_servers[0]
}
}
}
if(typeof(realm[key].home_servers) != Array) {
h = get_host(realm[key].home_servers) // get host
if(h != null && host.vars.type != "SP") { // host exists and does not have "SP" type
apply Service "COMPROMISED-USERS-" + key use(realm, key) {
import "compromised users template"
groups = [ "COMPROMISED-USERS" ]
enable_notifications = false
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#compromised-users"
assign where host.name == realm[key].home_servers
ignore where host.vars.type == "SP"
}
}
}
/* --------------------------------------------------------------------------------------------------------- */
// eduroam CAT
// CAT needs to be applied for all aliases every realm has
// for following test EAP-CERTIFICATE that may use CA cert from CAT.
// The CA cert must have a predictable name (based on alias/realm) for the ease of use of the test.
for(alias in realm[key].realm_aliases.split(",")) {
if(typeof(realm[key].home_servers) == Array) {
apply Service "CAT-" + alias use(alias, realm, key) {
import "eduroam cat template"
vars.realm = alias
groups = [ "CAT" ]
enable_notifications = false
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#cat"
assign where host.name == realm[key].home_servers[0] && host.vars.type != "SP"
}
}
if(typeof(realm[key].home_servers) != Array) {
apply Service "CAT-" + alias use(alias, realm, key) {
import "eduroam cat template"
vars.realm = alias
groups = [ "CAT" ]
enable_notifications = false
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#cat"
assign where host.name == realm[key].home_servers && host.vars.type != "SP"
}
}
}
/* --------------------------------------------------------------------------------------------------------- */
// concurrent inst
if(typeof(realm[key].home_servers) == Array) {
apply Service "CONCURRENT-INST-" + key use(realm, key) {
import "concurrent inst template"
vars.realm = key
groups = [ "CONCURRENT-INST" ]
enable_notifications = false
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#concurrent-inst"
assign where host.name == realm[key].home_servers[0]
}
}
if(typeof(realm[key].home_servers) != Array) {
apply Service "CONCURRENT-INST-" + key use(realm, key) {
import "concurrent inst template"
vars.realm = key
groups = [ "CONCURRENT-INST" ]
enable_notifications = false
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#concurrent-inst"
assign where host.name == realm[key].home_servers
}
}
/* --------------------------------------------------------------------------------------------------------- */
// skip if visitor's realm does not have testing user
// or no home server exists where testing user should be authenticated
if(realm[key].testing_id == "undefined" || realm[key].home_servers == "undefined") {
continue
}
/* --------------------------------------------------------------------------------------------------------- */
// home realm alive
if(typeof(realm[key].home_servers) == Array) {
apply Service "HOME-REALM-ALIVE-" + key use(realm, key) {
import "home realm alive template"
vars.home_servers = realm[key].home_servers
vars.realm = key
groups = [ "HOME-REALM-ALIVE" ]
enable_notifications = false
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#home-realm-alive"
assign where host.name == realm[key].home_servers[0]
}
}
/* --------------------------------------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------------------------------------- */
for(radius in radius_servers) {
server = keys(radius)[0]
/* --------------------------------------------------------------------------------------------------------- */
// check_rad_eap / matrix of visits
apply Service "@" + key use(realm, server, radius, index, key) {
display_name = "@" + key
check_command = "check_rad_eap"
vars.testing_id = realm[key].testing_id // visitor's testind id
vars.testing_password = realm[key].testing_password // visitor's testing password
vars.mac_address = mac_address[index]
vars.visitors_realm = key
vars.info = "ermon.cesnet.cz is testing realm " + key + " at radius server " + server
groups = [ key ]
if((typeof(realm[key].home_servers) == Array && server in realm[key].home_servers) || (typeof(realm[key].home_servers) == String && server == realm[key].home_servers)) {
vars.home_realm_check = 1
check_interval = 300
retry_interval = 600
}
if((typeof(realm[key].home_servers) == Array && server !in realm[key].home_servers) || (typeof(realm[key].home_servers) == String && server != realm[key].home_servers)) {
vars.home_realm_check = 0
check_interval = 10800
retry_interval = 7200
enable_notifications = false
}
if(key == "cesnet.cz") {
vars.check_cert = 1
vars.server_hostname = "radius.cesnet.cz"
}
max_check_attempts = 3
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#domaci_realm"
assign where host.name == server
}
index += 1
/* --------------------------------------------------------------------------------------------------------- */
// TODO - nebylo by lepsi pro kazdy server?
// tohle rozhodne bude chtit pro kazdy server, protoze by se to melo vadidovat proti informacim z CATu
// -> muze to odhalit nejake konfiguracni problemy, kdy ma CAT nastaven napr pouze jeden server ...
//for(alias in realm[key].realm_aliases.split(",")) {
// apply Service "EAP-CERTIFICATE-" + alias use(alias, realm, radius, index, server, key) {
// import "eap certificate template"
// // testing id realm set to alias
// vars.testing_id = realm[key].testing_id.split("@")[0] + "@" + alias // visitor's testind id
// vars.testing_password = realm[key].testing_password // visitor's testing password
// vars.mac_address = mac_address[index]
// vars.visitors_realm = key
// vars.mon_realm = alias
// vars.info = "ermon.cesnet.cz is testing realm " + alias + " at radius server " + server
// enable_notifications = false
// groups = [ "EAP-CERTIFICATE" ]
// vars.doc_url = "TODO"
// assign where host.name == server
// }
// index += 1
//}
/* --------------------------------------------------------------------------------------------------------- */
// apply for each monitored realm for given server
if(key in radius[server]) {
/* --------------------------------------------------------------------------------------------------------- */
// chargeable user identity
apply Service "CHARGEABLE-USER-IDENTITY-" + key use(realm, server, radius, index, key) {
import "chargeable user identity template"
vars.testing_id = realm[key].testing_id
vars.testing_password = realm[key].testing_password
vars.mac_address = mac_address[index]
enable_notifications = false
groups = [ "CHARGEABLE-USER-IDENTITY" ]
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#chargeable-user-identity"
assign where host.name == server
}
index += 1
/* --------------------------------------------------------------------------------------------------------- */
// fake uid
apply Service "FAKE-UID-" + key use(realm, radius, index, server, key) {
import "fake uid template"
vars.testing_id = realm[key].testing_id
vars.anon_id = "anon" + random().to_string() + "@" + realm[key].testing_id.split("@")[1]
vars.testing_password = realm[key].testing_password
vars.mac_address = mac_address[index]
groups = [ "FAKE-UID" ]
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#fake-uid"
assign where host.name == server && host.vars.type != "SP"
ignore where realm[key].testing_id.contains("@") == false
}
index += 1
/* --------------------------------------------------------------------------------------------------------- */
// vcelka maja
apply Service "VCELKA-MAJA-" + key use(realm, radius, index, server, key) {
import "vcelka maja template"
vars.mac_address1 = mac_address[index]
vars.mac_address2 = mac_address[index + 1]
vars.realm = key
groups = [ "VCELKA-MAJA" ]
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#vcelka-maja"
assign where host.name == server && host.vars.type != "SP"
}
index += 2
/* --------------------------------------------------------------------------------------------------------- */
// cve-2017-9148
apply Service "CVE-2017-9148-" + key use(realm, radius, index, server, key) {
import "cve-2017-9148 template"
vars.testing_id = realm[key].testing_id
vars.mac_address1 = mac_address[index]
vars.mac_address2 = mac_address[index + 1]
vars.realm = key
groups = [ "CVE-2017-9148" ]
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#cve-2017-9148"
assign where host.name == server && host.vars.type != "SP"
}
index += 2
///* --------------------------------------------------------------------------------------------------------- */
//// MISSING-NAS-PORT-TYPE
//apply Service "MISSING-NAS-PORT-TYPE-" + key use(realm, radius, index, server, key) {
// import "missing nas port type template"
// vars.testing_id = realm[key].testing_id
// vars.mac_address = mac_address[index]
// groups = [ "MISSING-NAS-PORT-TYPE" ]
// //vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#cve-2017-9148"
// // TODO
// enable_notifications = false
// //assign where host.name == server && host.vars.type != "SP"
// assign where host.name == server && server == "radius1.cesnet.cz"
//}
//index += 1
///* --------------------------------------------------------------------------------------------------------- */
}
/* --------------------------------------------------------------------------------------------------------- */
// key in not matching the first monitored realm of server
if(key != radius[server][0]) { // suitable for services which should be applied only once to every server in case there are multiple monitored realms on one server
continue
}
/* --------------------------------------------------------------------------------------------------------- */
// big packet
apply Service "BIG-PACKET" use(realm, radius, index, server, key) {
import "big packet template"
vars.testing_id = "big-test@cesnet.cz"
vars.testing_password = big_packet_testing_password
vars.mac_address = mac_address[index]
vars.info = "ermon.cesnet.cz is testing UDP fragmentation at server " + server
vars.require_fragmented = 1
groups = [ "BIG-PACKET" ]
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#big-packet"
assign where host.name == server && host.vars.type != "SP"
}
index += 1
/* --------------------------------------------------------------------------------------------------------- */
}
}