You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
prowler-report/template.html

190 lines
7.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<title>Prowler Scan Results</title>
</head>
<style type="text/css">
.container {
padding-top: 80px;
max-width: 1400px;
}
.b-pass, .b-pass:focus, .b-pass:active {
color: black;
background-color: rgba(102,178,102,.2) !important;
}
.b-fail, .b-fail:focus, .b-fail:active {
color: black;
background-color: rgba(255,76,76,.2) !important;
}
.b-info, .b-info:focus, .b-info:active {
color: black;
background-color: rgba(128,163,221,.2) !important;
}
.totals {
display: inline-block;
margin: 0 auto;
padding: 1em;
}
.row {
padding-left: 1em;
padding-right: 1em;
}
</style>
<body>
<div class="container">
<h1>Prowler Scan Results</h1>
<div class="row">
<h2>Summary</h2>
<div class="col col-4 totals">Accounts:<br /> {{ totals['accounts'] | join(', ') }}</div>
<div class="col col-4 totals">Regions:<br /> {{ totals['regions'] | join(', ') }}</div>
<div class="col col-4 totals">Total Scans:<br /> {{ totals['scan_results'] | length }}</div>
<canvas id="result_doughnut" width="350" height="300"></canvas>
<canvas id="severity_doughnut" width="350" height="300"></canvas>
</div>
<div class="row">
<h2>Findings</h2>
<div class="accordion" id="accordion">
{% for res_type in totals['results_summary'] %}
<div class="accordion-item">
<h2 class="accordion-header" id="heading{{ loop.index }}">
<button class="accordion-button collapsed b-{{ res_type }}" type="button" data-bs-toggle="collapse" data-bs-target="#collapse{{ loop.index }}" aria-expanded="false" aria-controls="collapse{{ loop.index }}">
{{ res_type | capitalize }} (<strong>{{ totals['results_summary'][res_type] | length }} total</strong>)
</button>
</h2>
<div id="collapse{{ loop.index }}" class="accordion-collapse collapse" aria-labelledby="heading{{ loop.index }}" data-bs-parent="#accordion">
<div class="accordion-body">
<table class="table table-sm" data-toggle="table">
<thead>
<tr>
<th data-sort="int">Account ID</th>
<th data-sort="string">Region</th>
<th data-sort="string">ID</th>
<th data-sort="string">Text</th>
<th data-sort="string">Notes</th>
<th data-sort="string">Compliance</th>
<th data-sort="string">Severity</th>
<th data-sort="string">Service Name</th>
</tr>
</thead>
<tbody>
{% for i in totals['results_summary'][res_type] %}
<tr>
<td>{{ i['account_id'] }}</td>
<td>{{ i['region'] | truncate(12) }}</td>
<td>{{ i['title_id'] }}</td>
<td><strong>{{ i['title_text'] }}</strong></td>
<td>{{ i['notes'] }}</td>
<td>{{ i['compliance'] }}</td>
<td>{{ i['severity'] }}</td>
<td>{{ i['service_name'] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<script src="https://cdn.rawgit.com/joequery/Stupid-Table-Plugin/master/stupidtable.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.bundle.min.js" integrity="sha512-SuxO9djzjML6b9w9/I07IWnLnQhgyYVSpHZx0JV97kGBfTIsUYlWflyuW4ypnvhBrslz1yJ3R+S14fdCWmSmSA==" crossorigin="anonymous"></script>
<script>
var set_title = function(t){
return {
display: true,
text: t,
fontColor: 'black',
}
}
$('table').each(function(){
$(this).stupidtable();
});
var ctx = document.getElementById('result_doughnut');
var result_doughnut = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ['Pass', 'Fail', 'Info'],
datasets: [{
label: '',
data: [
{{ totals['results_summary']['pass'] | length }},
{{ totals['results_summary']['fail'] | length }},
{{ totals['results_summary']['info'] | length }}
],
backgroundColor: [
'rgba(102,178,102, 0.2)',
'rgba(255,76,76, 0.2)',
'rgba(127,127,255, 0.2)'
],
borderColor: [
'rgba(102,178,102, 1)',
'rgba(255,76,76, 1)',
'rgba(127,127,255, 1)'
],
borderWidth: 1
}]
},
options: {
responsive: false,
title: set_title("Results")
}
});
var ctx = document.getElementById('severity_doughnut');
var severity_doughnut = new Chart(ctx, {
type: 'doughnut',
data: {
labels: [
'Unmarked','Software and configuration checks',
'Informational', 'Low', 'Medium', 'High', 'Critical'
],
datasets: [{
label: '',
data: [
{% for t in totals['all_by_sev'] %}
{{ totals['all_by_sev'][t] | length }}{% if not loop.last %}, {% endif %}
{% endfor %}
],
backgroundColor: [
'rgba(255,222,173, 0.2)',
'rgba(255,173,206, 0.2)',
'rgba(173,206,255, 0.2)',
'rgba(206,255,173, 0.2)',
'rgba(229,229,0, 0.2)',
'rgba(232,72,85, 0.2)',
'rgba(208,64,76, 0.5)',
],
borderColor: [
'rgba(255,222,173, 1)',
'rgba(255,173,206, 1)',
'rgba(173,206,255, 1)',
'rgba(206,255,173, 1)',
'rgba(229,229,0, 1)',
'rgba(232,72,85, 1)',
'rgba(208,64,76, 1)',
],
borderWidth: 1
}]
},
options: {
responsive: false,
title: set_title("Severities")
}
});
</script>
</body>
</html>