-
Notifications
You must be signed in to change notification settings - Fork 3
/
report-cisScan.html.tmpl
110 lines (102 loc) · 5.24 KB
/
report-cisScan.html.tmpl
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Vulnerability Report</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body class="p-3">
<h1># {{ .CisScan.Title }}</h1>
Related resources: {{ range $idx, $res := .CisScan.RelatedResources }}<a href="{{ $res }}" target="_blank">Link {{ inc $idx }}</a> {{ end }}
<br><br>
<div class="form-group form-check">
<input id="check1" type="checkbox" class="form-check-input" onclick="if(this.checked) { $('.check-passed').addClass('d-none'); } else { $('.check-passed').removeClass('d-none'); }">
<label class="form-check-label" for="check1">Hide passed</label>
</div>
<table class="table table-striped table-hover">
<thead>
<tr class="table-primary">
<th>Id</th>
<th>Severity</th>
<th>Name</th>
<th>Result</th>
</tr>
</thead>
<tbody>
{{- range $unused, $result := .CisScan.Results }}
<tr class="{{ $length := len $result.Results }}{{if eq $length 0}}check-passed{{else}}check-failed{{end}}">
<td>{{ $result.ID }}</td>
<td>{{ $result.Severity }}</td>
<td>{{ $result.Name }} <small><p>{{ $result.Description }}</p></small>
{{ $length := len $result.Results }}{{if gt $length 0}}
Misconfigured resources: <a data-toggle="collapse" href="#res{{ replace $result.ID "." "a" }}"><span class="badge badge-pill badge-danger">{{ $length }}</span></a>
<div class="accordion collapse" id="res{{ replace $result.ID "." "a" }}">
{{- range $idx, $resources := $result.Results }}
<div class="card">
<div class="card-header p-0" id="res{{ replace $result.ID "." "b" }}{{ $idx }}">
<h2 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#res{{ replace $result.ID "." "b" }}{{ $idx }}card" aria-expanded="false" aria-controls="res{{ replace $result.ID "." "b" }}{{ $idx }}card">
{{ $resources.Target }}
</button>
</h2>
</div>
<div id="res{{ replace $result.ID "." "b" }}{{ $idx }}card" class="collapse" aria-labelledby="res{{ replace $result.ID "." "b" }}{{ $idx }}" data-parent="#res{{ replace $result.ID "." "a" }}">
<div class="card-body">
{{- range $unused, $details := $resources.Misconfigurations }}
<div class="row">
<label class="col-sm-2"><strong>Title:</strong></label>
<div class="col-sm-10">
{{ $details.Title }}
</div>
</div>
<div class="row">
<label class="col-sm-2"><strong>Description:</strong></label>
<div class="col-sm-10">
{{ $details.Description }}
</div>
</div>
<div class="row">
<label class="col-sm-2"><strong>Message:</strong></label>
<div class="col-sm-10">
{{ $details.Message }}
</div>
</div>
<div class="row">
<label class="col-sm-2"><strong>Resolution:</strong></label>
<div class="col-sm-10">
{{ $details.Resolution }}
</div>
</div>
<div class="row">
<label class="col-sm-2"><strong>Severity:</strong></label>
<div class="col-sm-10">
{{ $details.Severity }}
</div>
</div>
{{ $lengthr := len $details.References }}{{if gt $lengthr 0}}<div class="row">
<label class="col-sm-2"><strong>References:</strong></label>
<div class="col-sm-10">
{{- range $unused, $detref := $details.References }}
<p><a href="{{ $detref }}" target="_blank">{{ $detref }}</a></p>
{{ end }}
</div>
</div>{{ end }}
{{ end }}
</div>
</div>
</div>
{{end}}
</div>
{{end}}
</td>
<td><b>{{ $length := len $result.Results }}{{if eq $length 0}}<p style="color:green">PASS</p>{{else}}<p style="color:red">FAIL</p>{{end}}</b></td>
</tr>
{{- end }}
</tbody>
</table>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>