Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sub 3621 vulnerabilities + workloads structs + enrichments #190

Merged
merged 18 commits into from
Dec 27, 2023
Merged
10 changes: 10 additions & 0 deletions armotypes/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@ package armotypes
// swagger:strfmt uuid4
// Example: 0f42fbe3-d81e-444d-8cc7-bc892c7623e9
type GUID string

type RiskFactor string

const (
RiskFactorInternetFacing RiskFactor = "Internet facing"
RiskFactorPrivileged RiskFactor = "Privileged"
RiskFactorSecretAccess RiskFactor = "Secret access"
RiskFactorDataAccess RiskFactor = "Data access"
RiskFactorHostAccess RiskFactor = "Host access"
)
104 changes: 95 additions & 9 deletions armotypes/vulnerabilitytypes.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,109 @@
package armotypes

import "time"

const (
ExploitableCisaKev = "Known Exploited (CISA KEV)"
ExploitableHighLikelihood = "High likelihood (EPSS >= 10%)"
ExploitableNo = "No"
EpssThreshold = 0.10 // 10%
)

type VulnerabilityJobParams struct {
Name string `json:"name,omitempty"`
ID string `json:"id,omitempty"`
ClusterName string `json:"clusterName"`
Namespace string `json:"namespace"`
CronTabSchedule string `json:"cronTabSchedule,omitempty"`
JobID string `json:"jobID,omitempty"`
}

type VulnerabilityWorkload struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Kind string `json:"kind"`
ClusterName string `json:"clusterName"`
ClusterShortName string `json:"clusterShortName"`
LastScanTime time.Time `json:"lastScanTime"`
CustomerGUID string `json:"customerGUID"`
ImagesCount int `json:"imagesCount"`
CriticalCount int `json:"criticalCount"`
HighCount int `json:"highCount"`
MediumCount int `json:"mediumCount"`
LowCount int `json:"lowCount"`
SeverityStats map[string][]string `json:"severityStats"`
RiskFactorsCount int `json:"riskFactorsCount"`
RiskFactors []RiskFactor `json:"riskFactors"`
Labels []string `json:"labels"`
}

type ContainerPathInfo struct {
NameSpace string `json:"namespace"`
WorkloadName string `json:"WorkloadName"`
ContainerName string `json:"containerName"`
WorkloadKind string `json:"WorkloadKind"`
ClusterName string `json:"clusterName"`
ClusterShortName string `json:"clusterShortName"`
}

type VulnerabilitiesComponent struct {
CustomerGUID string `json:"customerGUID"`
Name string `json:"name"`
Version string `json:"version"`
PackageType string `json:"packageType"`
FixVersions []string `json:"fixVersions"`
PathsInfo []ComponentPathInfo `json:"pathsInfo"`
CriticalCount int `json:"criticalCount"`
HighCount int `json:"highCount"`
MediumCount int `json:"mediumCount"`
LowCount int `json:"lowCount"`
SeverityStats map[string][]string `json:"severityStats"`
}

type ComponentPathInfo struct {
ContainerPathInfo
ImageTag string `json:"imageTag"`
ImageHash string `json:"imageHash"`
ContainerName string `json:"containerName"`
}

type Vulnerability struct {
Name string `json:"name"`
Severity string `json:"severity"`
SeverityScore int `json:"severityScore"`
IsRCE bool `json:"isRCE"`
Links []string `json:"links"`
Description string `json:"description"`
EpssInfo EpssInfo `json:"epssInfo"`
CisaKevInfo CisaKevInfo `json:"cisaKevInfo"`
Name string `json:"name"`
Severity string `json:"severity"`
SeverityScore int `json:"severityScore"`
IsRCE bool `json:"isRCE"`
Links []string `json:"links"`
Description string `json:"description"`
Exploitable string `json:"exploitable"`
ComponentsInfo []VulnerabilitiesComponent `json:"componentsInfo"`
IsFixable bool `json:"isFixable"`
CvssInfo []CvssInfo `json:"cvssInfo"`
EpssInfo EpssInfo `json:"epssInfo"`
CisaKevInfo CisaKevInfo `json:"cisaKevInfo"`
}

type CvssInfo struct {
Vector string `json:"vector"`
Version string `json:"version"`
Source string `json:"source"`
BaseScore int `json:"baseScore"`
ExploitabiltiyScore int `json:"exploitabiltiyScore"`
ImpactScore int `json:"ImpactScore"`
ExploitabilityInfo CvssExploitabilityInfo `json:"exploitabilityInfo"`
ImpactInfo CvssImpactInfo `json:"impactInfo"`
}

type CvssExploitabilityInfo struct {
AttackVector string `json:"attackVector"`
AttackComplexity string `json:"attackComplexity"`
PrivilegesRequired string `json:"privilegesRequired"`
UserInteraction string `json:"userInteraction"`
Scope string `json:"scope"`
}

type CvssImpactInfo struct {
Confidentiality string `json:"confidentiality"`
Integrity string `json:"integrity"`
Availability string `json:"availability"`
}

type EpssInfo struct {
Expand Down
Loading