Skip to content

Commit 82d7a90

Browse files
authored
feat: implement severities_and_threats rule bundle (#666)
1 parent a93231a commit 82d7a90

File tree

4 files changed

+883
-51
lines changed

4 files changed

+883
-51
lines changed

sysdig/internal/client/v2/vulnerability_rule_bundle_model.go

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,24 @@ type VulnerabilityRulePredicate struct {
2020
}
2121

2222
type VulnerabilityRulePredicateExtra struct {
23-
Level *Level `json:"level,omitempty"`
24-
Age *int `json:"age,omitempty"`
25-
VulnIDS []string `json:"vulnIds,omitempty"`
26-
Value *string `json:"value,omitempty"`
27-
Packages []Package `json:"packages,omitempty"`
28-
Key *string `json:"key,omitempty"`
29-
User *string `json:"user,omitempty"`
30-
PkgType *string `json:"pkgType,omitempty"`
23+
// Common fields for different predicate types
24+
Level *Level `json:"level,omitempty"`
25+
Age *int `json:"age,omitempty"`
26+
Days *int `json:"days,omitempty"`
27+
PkgType *string `json:"pkgType,omitempty"`
28+
VulnIDS []string `json:"vulnIds,omitempty"`
29+
Packages []Package `json:"packages,omitempty"`
30+
Key *string `json:"key,omitempty"`
31+
User *string `json:"user,omitempty"`
32+
Value interface{} `json:"value,omitempty"` // For image labels or CVSS score
33+
34+
// Disclosure Date Range
35+
StartDate *string `json:"startDate,omitempty"`
36+
EndDate *string `json:"endDate,omitempty"`
37+
38+
// EPSS
39+
Score *int `json:"score,omitempty"`
40+
Percentile *int `json:"percentile,omitempty"`
3141
}
3242

3343
type Package struct {
@@ -57,3 +67,8 @@ const (
5767
VulnerabilityRuleTypeVulnDenyList VulnerabilityRuleType = "vulnDenyList"
5868
VulnerabilityRuleTypeVulnSeverityAndThreats VulnerabilityRuleType = "vulnSeverityAndThreats"
5969
)
70+
71+
type DateRange struct {
72+
From string `json:"from"`
73+
To string `json:"to"`
74+
}

0 commit comments

Comments
 (0)