/
cis.go
71 lines (61 loc) · 1.69 KB
/
cis.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package dto
import (
"github.com/KubeOperator/KubeOperator/pkg/model"
)
type CisTask struct {
model.CisTask
}
type CisBatch struct {
Items []CisTask
Operation string
}
type CisTaskCreate struct {
Policy string `json:"policy"`
}
type CisTaskDetail struct {
ClusterName string `json:"clusterName"`
ClusterVersion string `json:"clusterVersion"`
model.CisTaskWithResult
CisReport CisReport `json:"cisReport"`
}
type CisReport struct {
Controls CisControlList `json:"Controls"`
Totals CisTotals `json:"Totals"`
}
type CisControlList []CisControl
type CisTestList []CisTest
type CisResultList []CisResult
type CisTotals struct {
TotalPass int `json:"total_pass"`
TotalFail int `json:"total_fail"`
TotalWarn int `json:"total_warn"`
TotalInfo int `json:"total_info"`
}
type CisControl struct {
Id string `json:"id"`
Version string `json:"version"`
Text string `json:"text"`
NodeType string `json:"node_type"`
Tests CisTestList `json:"tests"`
TotalPass int `json:"total_pass"`
TotalFail int `json:"total_fail"`
TotalWarn int `json:"total_warn"`
TotalInfo int `json:"total_info"`
}
type CisTest struct {
Section string `json:"section"`
Pass int `json:"pass"`
Fail int `json:"fail"`
Warn int `json:"warn"`
Info int `json:"info"`
Desc string `json:"desc"`
Results CisResultList `json:"results"`
}
type CisResult struct {
TestNumber string `json:"test_number"`
TestDesc string `json:"test_desc"`
Remediation string `json:"remediation"`
Status string `json:"status"`
Scored bool `json:"scored"`
Reason string `json:"reason"`
}