-
Notifications
You must be signed in to change notification settings - Fork 11
/
raw tables.html
642 lines (531 loc) · 26.6 KB
/
raw tables.html
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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="Jonathan Gruber Imperva">
<!-- Favicon icon -->
<link rel="icon" type="image/png" sizes="16x16" href="favico.png">
<title>Site Configuration Assessment</title>
<!-- CSS LIBRARIES -->
<!-- Bootstrap Core CSS -->
<link href="css/lib/bootstrap/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/lib/calendar2/semantic.ui.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body class="fix-header fix-sidebar">
<!-- page wrapper -->
<div class="main-wrapper">
<!-- HEADER BAR -->
<div class="header">
<nav class="navbar top-navbar navbar-expand-md navbar-light">
<!-- Logo -->
<div class="navbar-header>
<a class=" navbar-brand" href="dashboard.php">
<!-- Dashboard logo icon -->
<b style="font-size:30;color:#37347F"><img src="incapse.png" alt="homepage" class="dark-logo" style=" height:auto;margin-right: 2.5em" />
</b>
</a>
</div>
<div class="navbar-collapse">
<!-- toggle and nav items -->
<ul class="navbar-nav mr-auto mt-md-0">
<!-- 3 LINES WHEN BROWSER COMPRESSED -->
<li class="nav-item m-l-4"> <a class="nav-link sidebartoggler hidden-sm-down text-muted " href="javascript:void(0)"><i
class="fa fa-th-large"></i></a> </li>
</ul>
</div>
<!-- End Logo -->
</nav>
</div>
<!-- End header header -->
<!-- Left Sidebar -->
<div id="sidebar" class="left-sidebar">
</div>
<!-- End Left Sidebar -->
<!-- Container fluid pour page centrale -->
<div class="page-wrapper">
<!-- Bread crumb -->
<div class="row page-titles">
<div class="col-md-5 align-self-center">
<h3 class="text-primary">Sites Settings Assessment</h3> </div>
<div class="col-md-7 align-self-center">
</div>
</div>
<!-- End Bread crumb -->
<div class="container-fluid">
<!-- ROW for Security Settings table summary <div class="col-lg-4" >-->
<div class="row">
<div class="card">
<div class="card-title">
<h4>Security Settings Breakdown</h4>
</div>
<br />
<div id="threats_settings" style="overflow-x:auto;">
<table id="security_table" class="display nowrap table table-hover table-striped table-bordered"
data-page-length='25'>
<thead>
<tr>
<th>Account Number</th>
<th>Site ID</th>
<th>Site Name</th>
<th>Site Status</th>
<th>Backdoor</th>
<th>SQL injection</th>
<th>Cross Site Scripting</th>
<th>Illegal Resource Access</th>
<th>Remote File Inclusion</th>
<th>DDoS mode</th>
<th>DDoS Threshold</th>
<th>Block Bad Bots</th>
<th>Challenge Suspected Bots</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Account Number</th>
<th>Site ID</th>
<th>Site Name</th>
<th>Site Status</th>
<th>Backdoor</th>
<th>SQL injection</th>
<th>Cross Site Scripting</th>
<th>Illegal Resource Access</th>
<th>Remote File Inclusion</th>
<th>DDoS mode</th>
<th>DDoS Threshold</th>
<th>Block Bad Bots</th>
<th>Challenge Suspected Bots</th>
</tr>
</tfoot>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<!-- END ROW for security Settings table summary -->
<hr />
<!-- ROW for Threat statistics table summary -->
<div class="row">
<div class="card">
<div class="card-title">
<h4>Security Statistics Account</h4>
</div>
<br />
<table class="table table-bordered table-striped table-hover table-responsive" id="api_list_stats">
<tr>
<th>Total Events</th>
<th>Bad Bots Events</th>
<th>XSS Incidents</th>
<th>SQLi Incidents</th>
<th>Illegal Resource Access</th>
<th>RFI Events</th>
<th>DDoS L7 Events</th>
</tr>
</table>
</div>
</div>
<!-- END ROW for Threat Statistics table summary -->
<hr />
<!-- ROW for Performance Settings table summary <div class="col-lg-4" >-->
<div class="row">
<div class="card">
<div class="card-title">
<h4>Caching Settings</h4>
</div>
<br />
<div id="caching_settings" style="overflow-x:auto;">
<table class="table table-bordered table-striped table-hover table-responsive" id="performance_table"
data-page-length='25'>
<thead>
<tr>
<th>Site ID</th>
<th>Site Name</th>
<th>Site Creation Date</th>
<th>Site Status</th>
<th>Caching Settings</th>
<th>Incapsula A Record</th>
<th>CNAME Record</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Site ID</th>
<th>Site Name</th>
<th>Site Creation Date</th>
<th>Site Status</th>
<th>Caching Settings</th>
<th>Incapsula A Record</th>
<th>CNAME Record</th>
</tr>
</tfoot>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<hr />
<!-- END ROW for Performance Settings table summary -->
<!-- ROW for ACL Security Settings table Access Control List-->
<div class="row">
<div class="card">
<div class="card-title">
<h4>Access Control Settings Breakdown</h4>
</div>
<br />
<div id="acl_settings" style="overflow-x:auto;">
<table id="acl_table" class="display nowrap table table-hover table-striped table-bordered"
data-page-length='25'>
<thead>
<tr>
<th>Account Number</th>
<th>Site ID</th>
<th>Site Name</th>
<th>ACL IP Blaklist</th>
<th>ACL Country Blacklist</th>
<th>Blacklist URL Pattern & Value</th>
<th>Whitelist Rules</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Account Number</th>
<th>Site ID</th>
<th>Site Name</th>
<th>ACL IP Blaklist</th>
<th>ACL Country Blacklist</th>
<th>Blacklist URL Pattern & Value</th>
<th>Whitelist Rules</th>
</tr>
</tfoot>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<!-- END ROW for security Settings table summary -->
<hr />
<!-- New table for IncapRules-->
<div class="row">
<div class="card">
<div class="card-title">
<h4>All IncapRules</h4>
</div>
<br />
<div id="incapRule_settings" style="overflow-x:auto;">
<table id="incapRule_table" class="display nowrap table table-hover table-striped table-bordered"
data-page-length='25'>
<thead>
<tr>
<th>Account Number</th>
<th>Site ID</th>
<th>Site Name</th>
<th>IncapRule ID</th>
<th>IncapRule Name</th>
<th>Action</th>
<th>Rule</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Account Number</th>
<th>Site ID</th>
<th>Site Name</th>
<th>IncapRule ID</th>
<th>IncapRule Name</th>
<th>Action</th>
<th>Rule</th>
</tr>
</tfoot>
<tbody></tbody>
</table>
</div>
</div>
</div>
<!-- END table for IncapRules -->
<hr />
</div> <!-- end page wrapper-->
</body>
<!-- JS LIBRARIES -->
<script src="js/lib/jquery/jquery.min.js"></script>
<!-- Bootstrap tether Core JavaScript -->
<script src="js/lib/bootstrap/js/bootstrap.min.js"></script>
<script type='text/javascript' src='js\lib\datatables\datatables.min.js'></script>
<!--Menu sidebar -->
<script type='text/javascript' src='js\lib\datatables\cdn.datatables.net\buttons\1.2.2\js\datatables.buttons.min.js'></script>
<script type="text/javascript" src="https://cdn.datatables.net/r/dt/jq-2.1.4,jszip-2.5.0,pdfmake-0.1.18,dt-1.10.9,af-2.0.0,b-1.0.3,b-colvis-1.0.3,b-html5-1.0.3,b-print-1.0.3,se-1.0.1/datatables.min.js"></script>
<script src="js/lib/calendar-2/moment.latest.min.js"></script>
<script src="js/jquery.slimscroll.js"></script> <!-- to have scroll within a div part -->
<script src="js/scripts.js"></script>
<script src="js/lib/sticky-kit-master/dist/sticky-kit.min.js"></script>
<script>
$(function () {
$("#sidebar").load("sidebar.html");
});
</script>
<!-- print table site list and settings -->
<script>
$(document).ready(function () {
var list_sites = '';
var sites_performance = '';
$.ajax({
url: 'export_sites.json',
datatype: 'json',
type: 'get',
cache: false,
success: function (data) {
console.log("EXPORT SITES SETTINGS");
console.log(data);
$(data).each(function (index, value) {
list_sites += '<tr>';
list_sites += '<td>' + value.account_id + '</td>';
list_sites += '<td>' + value.site_id + '</td>';
list_sites += '<td>' + value.domain + '</td>';
list_sites += '<td>' + value.status + '</td>';
list_sites += '<td>' + value.security.waf.rules[5].action_text + '</td>';
list_sites += '<td>' + value.security.waf.rules[0].action_text + '</td>';
list_sites += '<td>' + value.security.waf.rules[1].action_text + '</td>';
list_sites += '<td>' + value.security.waf.rules[2].action_text + '</td>';
list_sites += '<td>' + value.security.waf.rules[6].action_text + '</td>';
list_sites += '<td>' + value.security.waf.rules[4].activation_mode_text + '</td>';
list_sites += '<td>' + value.security.waf.rules[4].ddos_traffic_threshold + '</td>';
list_sites += '<td>' + value.security.waf.rules[3].block_bad_bots + '</td>';
list_sites += '<td>' + value.security.waf.rules[3].challenge_suspected_bots + '</td>';
list_sites += '</tr>';
sites_performance += '<tr>';
sites_performance += '<td>' + value.site_id + '</td>';
sites_performance += '<td>' + value.domain + '</td>';
sites_performance += '<td>' + moment(value.site_creation_date).format('DD MMM YY') + '</td>';
sites_performance += '<td>' + value.status + '</td>';
sites_performance += '<td>' + value.performance_configuration.acceleration_level + '</td>';
if (typeof value.dns[1] === 'undefined') {
sites_performance += '<td>' + "no A records" + '</td>';
} else {
sites_performance += '<td>' + value.dns[1].set_data_to[0] + ", " + value.dns[1].set_data_to[0] + '</td>';
}
if (value.dns.length === 0) {
sites_performance += '<td>' + "NA" + '</td>';
} else {
sites_performance += '<td>' + value.dns[0].set_data_to + '</td>';
}
sites_performance += '</tr>';
});
$("#security_table tbody").append(list_sites);
$('#performance_table tbody').append(sites_performance);
$('#security_table').DataTable({
dom: 'Bfrtip',
buttons: [{
extend: 'excelHtml5',
title: 'security assessment'
},
{
extend: 'pdfHtml5',
title: 'security assessment',
orientation: 'landscape'
}]
});
$('#security_table tr td').each(function () {
if ($(this).text() == "Alert Only") $(this).css('color', 'red');
if ($(this).text() == "1000") $(this).css('color', 'orange');
if ($(this).text() == "off") $(this).css('color', 'red');
});
$('#security_table tr td:nth-child(12)').each(function () {
if ($(this).text() != "true") $(this).css('color', 'red');
});
$('#performance_table').DataTable({
dom: 'Bfrtip',
buttons: [{
extend: 'excelHtml5',
title: 'caching assessment'
},
{
extend: 'pdfHtml5',
title: 'caching assessment'
}]
}
);
$('#performance_table tr td:nth-child(4)').each(function () {
if ($(this).text() != "fully-configured") $(this).css('color', 'orange');
if ($(this).text() == "fully-configured") $(this).css('color', 'green');
});
}
});
});
</script>
<!-- print table stats 7 days -->
<script>
$(document).ready(function () {
$.ajax({
url: 'export_stats_7_days.json',
datatype: 'json',
type: 'get',
cache: false,
success: function (data) {
console.log("EXPORT SITES STATISTICS");
console.log(data);
}
});
});
</script>
<!-- complete the security stats table -->
<script>
$(document).ready(function () {
var list_stats = '';
var count_XSS_events = 0;
var count_ddos_events = 0;
$.ajax({
url: 'export_stats_7_days.json',
datatype: 'json',
type: 'get',
cache: false,
success: function (data) {
list_stats += '<tr>';
list_stats += '<td>' + data.threats[5].incidents + '</td>';
list_stats += '<td>' + data.threats[10].incidents + '</td>';
list_stats += '<td>' + data.threats[0].incidents + '</td>';
list_stats += '<td>' + data.threats[3].incidents + '</td>';
list_stats += '<td>' + data.threats[5].incidents + '</td>';
list_stats += '<td>' + data.threats[9].incidents + '</td>';
list_stats += '<td>' + data.threats[8].incidents + '</td>';
$('#api_list_stats').append(list_stats);
}
});
});
</script>
<!-- print ACL settings -->
<script>
$(document).ready(function () {
var list_acl = '';
$.ajax({
url: 'export_sites.json',
datatype: 'json',
type: 'get',
cache: false,
success: function (data) {
$(data).each(function (index, value) {
list_acl += '<tr>';
list_acl += '<td>' + value.account_id + '</td>';
list_acl += '<td>' + value.site_id + '</td>';
list_acl += '<td>' + value.domain + '</td>';
if (value.security.hasOwnProperty("acls") == true) {
if (value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_ips') != undefined) {
list_acl += '<td>';
for (l = 0; l < value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_ips').ips.length; l++) {
list_acl += value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_ips').ips[l];
if (l != value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_ips').ips.length - 1) {
list_acl += ', ';
}
}
list_acl += '</td>';
} else {
list_acl += '<td>' + "" + '</td>';
}
if (value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_countries') != undefined) {
if (value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_countries').geo.continents != undefined) {
if (value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_countries').geo.countries != undefined) {
list_acl += '<td>' + value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_countries').geo.countries + ", " + value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_countries').geo.continents + '</td>';
} else {
list_acl += '<td>' + value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_countries').geo.continents + '</td>';
}
} else {
list_acl += '<td>' + value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_countries').geo.countries + '</td>';
}
} else {
list_acl += '<td>' + "" + '</td>';
}
// ADD A LOOP ON THE URLS TO SCAN THEM ALL
if (value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_urls') != undefined) {
list_acl += '<td>';
for (k = 0; k < value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_urls').urls.length; k++) {
list_acl += value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_urls').urls[k].pattern + " " + value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_urls').urls[k].value;
if (k != value.security.acls.rules.find(x => x.id === 'api.acl.blacklisted_urls').urls.length - 1) {
list_acl += ", ";
}
}
list_acl += '</td>';
} else {
list_acl += '<td>' + "" + '</td>';
}
if (value.security.acls.rules.find(x => x.id === 'api.acl.whitelisted_ips') != undefined) {
list_acl += '<td>';
for (l = 0; l < value.security.acls.rules.find(x => x.id === 'api.acl.whitelisted_ips').ips.length; l++) {
list_acl += value.security.acls.rules.find(x => x.id === 'api.acl.whitelisted_ips').ips[l];
if (l != value.security.acls.rules.find(x => x.id === 'api.acl.whitelisted_ips').ips.length - 1) {
list_acl += ', ';
}
}
list_acl += '</td>';
} else {
list_acl += '<td>' + "" + '</td>';
}
} else {
list_acl += '<td>' + '</td>';
list_acl += '<td>' + '</td>';
list_acl += '<td>' + '</td>';
list_acl += '<td>' + '</td>';
}
list_acl += '</tr>';
});
$("#acl_table tbody").append(list_acl);
$('#acl_table').DataTable({
dom: 'Bfrtip',
buttons: [{
extend: 'excelHtml5',
title: 'ACL Settings'
},
{
extend: 'pdfHtml5',
title: 'ACL Settings'
}]
});
}
});
});
</script>
<!--Print all IncapRules-->
<script>
$(document).ready(function () {
let incapRulesList = '';
$.ajax({
url: 'export_sites.json',
datatype: 'json',
type: 'get',
cache: false,
success: function (data) {
$(data).each(function (index, value) {
if (value.hasOwnProperty('incap_rules') == true) {
let prefixRow = '<td>' + value.account_id + '</td>' + '<td>' + value.site_id + '</td>' + '<td>' + value.domain + '</td>';
for (let rule in value.incap_rules) {
incapRulesList += '<tr>';
incapRulesList += prefixRow + '<td>' + value.incap_rules[rule].id + '</td>' + '<td>' + value.incap_rules[rule].name + '</td>' + '<td>' + value.incap_rules[rule].action + '</td>' + '<td>' + value.incap_rules[rule].rule + '</td>';
incapRulesList += '</tr>';
}
}
});
$("#incapRule_table tbody").append(incapRulesList);
//Fix bad alignment with Datatable
$("#incapRule_table tbody td").css('text-align', 'left');
$('#incapRule_table').DataTable({
dom: 'Bfrtip',
buttons: [{
extend: 'excelHtml5',
title: 'IncapRule List'
},
{
extend: 'pdfHtml5',
title: 'IncapRule List',
orientation: 'landscape'
}]
});
}
});
});
</script>
</html>