/
types.go
49 lines (39 loc) · 1.2 KB
/
types.go
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
package templates
import (
"time"
"github.com/aquasecurity/starboard/pkg/apis/aquasecurity/v1alpha1"
"github.com/aquasecurity/starboard/pkg/kube"
)
// WorkloadReport is a structure that holds data to render
// an HTML report for a specified K8s workload.
type WorkloadReport struct {
Workload kube.Object
GeneratedAt time.Time
// FIXME Do not use map as the order of iteration is unpredictable.
VulnsReports map[string]v1alpha1.VulnerabilityScanResult
ConfigAuditReport *v1alpha1.ConfigAuditReport
}
// NamespaceReport is a structure that holds data to render
// an HTML report for a specified K8s namespace.
type NamespaceReport struct {
Namespace kube.Object
GeneratedAt time.Time
Top5VulnerableImages []v1alpha1.VulnerabilityReport
Top5FailedChecks []CheckWithCount
Top5Vulnerability []VulnerabilityWithCount
}
type VulnerabilityWithCount struct {
v1alpha1.Vulnerability
AffectedWorkloads int
}
type CheckWithCount struct {
v1alpha1.Check
AffectedWorkloads int
}
// NodeReport is a structure that holds data to render
// an HTML report for a specified K8s node.
type NodeReport struct {
Node kube.Object
GeneratedAt time.Time
CisKubeBenchReport *v1alpha1.CISKubeBenchReport
}