-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: add version range to mariner provider #585
Changes from all commits
390b1a7
919e946
4cf49c4
4b91ad0
77c4098
72b96a9
2515b78
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"type": "object", | ||
"title": "os-vulnerability", | ||
"description": "represents vulnerability records for common linux distributions", | ||
"properties": { | ||
"Vulnerability": { | ||
"type": "object", | ||
"properties": { | ||
"CVSS": { | ||
"type": "array", | ||
"items": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"base_metrics": { | ||
"type": "object", | ||
"properties": { | ||
"base_score": { | ||
"type": "number" | ||
}, | ||
"base_severity": { | ||
"type": "string" | ||
}, | ||
"exploitability_score": { | ||
"type": "number" | ||
}, | ||
"impact_score": { | ||
"type": "number" | ||
} | ||
}, | ||
"required": [ | ||
"base_score", | ||
"base_severity", | ||
"exploitability_score", | ||
"impact_score" | ||
] | ||
}, | ||
"status": { | ||
"type": "string" | ||
}, | ||
"vector_string": { | ||
"type": "string" | ||
}, | ||
"version": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"base_metrics", | ||
"status", | ||
"vector_string", | ||
"version" | ||
] | ||
} | ||
] | ||
}, | ||
"Description": { | ||
"type": "string" | ||
}, | ||
"FixedIn": { | ||
"type": "array", | ||
"items": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"Name": { | ||
"type": "string" | ||
}, | ||
"NamespaceName": { | ||
"type": "string" | ||
}, | ||
"VendorAdvisory": { | ||
"type": "object", | ||
"properties": { | ||
"AdvisorySummary": { | ||
"type": "array", | ||
"items": {} | ||
}, | ||
"NoAdvisory": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"required": [ | ||
"NoAdvisory" | ||
] | ||
}, | ||
"Version": { | ||
"type": "string" | ||
}, | ||
"VersionFormat": { | ||
"type": "string" | ||
}, | ||
"VulnerableRange": { | ||
"type": ["string", "null"] | ||
}, | ||
"Module": { | ||
"type": ["string", "null"] | ||
} | ||
}, | ||
"required": [ | ||
"Name", | ||
"NamespaceName", | ||
"Version", | ||
"VersionFormat" | ||
] | ||
} | ||
] | ||
}, | ||
"Link": { | ||
"type": "string" | ||
}, | ||
"Metadata": { | ||
"type": "object", | ||
"properties": { | ||
"Issued": { | ||
"type": "string" | ||
}, | ||
"RefId": { | ||
"type": "string" | ||
}, | ||
"CVE": { | ||
"type": "array", | ||
"items": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"Name": { | ||
"type": "string" | ||
}, | ||
"Link": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"Name" | ||
] | ||
} | ||
] | ||
}, | ||
"NVD": { | ||
"type": "object", | ||
"properties": { | ||
"CVSSv2": { | ||
"type": "object", | ||
"properties": { | ||
"Score": { | ||
"type": "number" | ||
}, | ||
"Vectors": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"Score" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"Name": { | ||
"type": "string" | ||
}, | ||
"NamespaceName": { | ||
"type": "string" | ||
}, | ||
"Severity": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"Description", | ||
"FixedIn", | ||
"Link", | ||
"Metadata", | ||
"Name", | ||
"NamespaceName", | ||
"Severity" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"Vulnerability" | ||
] | ||
} |
wagoodman marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -272,8 +272,8 @@ class Meta: | |
"type": "Attribute", | ||
} | ||
) | ||
criterion: Optional[Criterion] = field( | ||
default=None, | ||
criterion: List[Criterion] = field( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the important change to the generated model. It might be worth backing out all. the My understanding is that right now there will always be exactly 2 items on the list, at least right now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This Vunnel parser is written to ignore the failure to parse individual definitions anyway: https://github.com/anchore/vunnel/blob/main/src/vunnel/providers/mariner/parser.py#L45 Based on some experimentation, the new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on offline discussion, we will pin |
||
default_factory=list, | ||
metadata={ | ||
"type": "Element", | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dev note: we might have to unpin this eventually to generate the models at a later date, but this pin keeps the diff less noisy until we want to tackle this issue