-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Added vulnerabilities as part of core spec #91
Changes from 6 commits
adb75ab
173b781
a04e72f
821fdfa
df947e9
d290235
b7e37c6
f15b462
052e702
485456c
8db5a20
35b5bc0
d3f0e50
dcad6ef
6c62cc6
0ac6b87
b42bbca
9f9f4ca
5ac7976
1ec2ca4
ae3a4ab
937b8fd
7a7d7ad
6201ede
c85bdd6
0e1df61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,14 @@ | |
"uniqueItems": true, | ||
"title": "Compositions", | ||
"description": "Compositions describe constituent parts (including components, services, and dependency relationships) and their completeness." | ||
}, | ||
"vulnerabilities": { | ||
"$id": "#/properties/vulnerabilities", | ||
"type": "array", | ||
"items": {"$ref": "#/definitions/vulnerability"}, | ||
"uniqueItems": true, | ||
"title": "Vulnerabilities", | ||
"description": "Vulnerabilities identified in components or services." | ||
} | ||
}, | ||
"definitions": { | ||
|
@@ -1074,6 +1082,315 @@ | |
"description": "The value of the property." | ||
} | ||
} | ||
}, | ||
"advisory": { | ||
"type": "object", | ||
"title": "Advisory", | ||
"description": "Location of additional advisory information.", | ||
"required": ["url"], | ||
"additionalProperties": false, | ||
"properties": { | ||
"title": { | ||
"type": "string" | ||
}, | ||
"url": { | ||
"type": "string", | ||
"format": "iri-reference" | ||
} | ||
} | ||
}, | ||
"cwe": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"title": "CWE", | ||
"description": "Integer representation of a Common Weaknesses Enumerations (CWE). For example 399 (of https://cwe.mitre.org/data/definitions/399.html)" | ||
}, | ||
"severity": { | ||
"type": "string", | ||
"title": "Severity", | ||
"description": "Textual representation of the severity of the vulnerability adopted by the risk analysis method. If an other risk analysis method is used other than whats defined in scoreSourceType, the user is expected to translate appropriately to match with an element value below.", | ||
"enum": [ | ||
"critical", | ||
"high", | ||
"medium", | ||
"low", | ||
"none", | ||
stevespringett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"unknown" | ||
stevespringett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
] | ||
}, | ||
"scoreMethod": { | ||
"type": "string", | ||
"title": "method", | ||
"description": "Specifies the risk scoring methodology/standard used.", | ||
"enum": [ | ||
"CVSSv2", | ||
"CVSSv3", | ||
"CVSSv31", | ||
"OWASP", | ||
"Other" | ||
] | ||
}, | ||
"impactAnalysisState": { | ||
"type": "string", | ||
"title": "Impact Analysis State", | ||
"description": "Textual representation of the state of the impact analysis.", | ||
"enum": [ | ||
"exploitable", | ||
stevespringett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"in_triage", | ||
"false_positive", | ||
"not_affected", | ||
stevespringett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"not_set" | ||
stevespringett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
] | ||
}, | ||
"rating": { | ||
"type": "object", | ||
"title": "Rating", | ||
"description": "Defines the risk ratings of a vulnerability.", | ||
"additionalProperties": false, | ||
"properties": { | ||
"source": { | ||
"$ref": "#/definitions/vulnerabilitySource", | ||
"description": "The source that published the vulnerability." | ||
}, | ||
"score": { | ||
"type": "number", | ||
"title": "Score", | ||
"description": "The numerical score of the rating." | ||
}, | ||
"severity": { | ||
"$ref": "#/definitions/severity" | ||
}, | ||
"method": { | ||
"$ref": "#/definitions/scoreMethod" | ||
}, | ||
"vector": { | ||
"type": "string", | ||
"title": "Vector", | ||
"description": "Textual representation of the metric values used to score the vulnerability" | ||
}, | ||
"justification": { | ||
"type": "string", | ||
"title": "Justification", | ||
"description": "An optional reason for rating the vulnerability as it was" | ||
} | ||
} | ||
}, | ||
"vulnerabilitySource": { | ||
"type": "object", | ||
"title": "Source", | ||
"description": "The source of the vulnerability where it is documented. Usually the name of the organization publishing vulnerability information", | ||
"additionalProperties": false, | ||
"properties": { | ||
"url": { | ||
"type": "string", | ||
"title": "URL", | ||
"description": "The url of the vulnerability documentation as provided by the source.", | ||
"examples": [ | ||
"https://nvd.nist.gov/vuln/detail/CVE-2019-15842" | ||
] | ||
}, | ||
"name": { | ||
"type": "string", | ||
"title": "Name", | ||
"description": "The name of the source.", | ||
"examples": [ | ||
"NVD", | ||
"National Vulnerability Database", | ||
"OSS Index", | ||
"VulnDB", | ||
"NPM Advisories" | ||
] | ||
} | ||
} | ||
}, | ||
"vulnerability": { | ||
"type": "object", | ||
"title": "Vulnerability", | ||
"description": "Defines the structure of a vulnerability.", | ||
"additionalProperties": false, | ||
"properties": { | ||
"bom-ref": { | ||
"type": "string", | ||
"title": "BOM Reference", | ||
"description": "An optional identifier which can be used to reference the vulnerability elsewhere in the BOM. Every bom-ref should be unique." | ||
}, | ||
"id": { | ||
"type": "string", | ||
"title": "ID", | ||
"description": "The id of the vulnerability as defined by the risk scoring methodology. For example CVE-2019-15842 (of https://nvd.nist.gov/vuln/detail/CVE-2019-15842)" | ||
}, | ||
"source": { | ||
"$ref": "#/definitions/vulnerabilitySource", | ||
"description": "The source that published the vulnerability." | ||
}, | ||
"references": { | ||
"type": "array", | ||
"title": "References", | ||
"description": "", | ||
stevespringett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"additionalItems": false, | ||
"items": { | ||
"required": [ | ||
"id", | ||
"source" | ||
], | ||
"additionalProperties": false, | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"title": "ID", | ||
"description": "The id of the vulnerability as defined by the risk scoring methodology. For example CVE-2019-15842 (of https://nvd.nist.gov/vuln/detail/CVE-2019-15842)" | ||
}, | ||
"source": { | ||
"$ref": "#/definitions/vulnerabilitySource", | ||
"description": "The source that published the vulnerability." | ||
} | ||
} | ||
} | ||
}, | ||
"ratings": { | ||
"type": "array", | ||
"title": "Ratings", | ||
"description": "List of the vulnerability ratings as defined by various risk rating methodologies.", | ||
"items": { | ||
"$ref": "#/definitions/rating" | ||
} | ||
}, | ||
"cwes": { | ||
"type": "array", | ||
"title": "CWEs", | ||
"description": "List of Common Weaknesses Enumerations (CWEs) codes that describes this vulnerability. For example 399 (of https://cwe.mitre.org/data/definitions/399.html)", | ||
"items": { | ||
"$ref": "#/definitions/cwe" | ||
} | ||
}, | ||
"description": { | ||
"type": "string", | ||
"title": "Description", | ||
"description": "A description of the vulnerability as provided by the source." | ||
}, | ||
"detail": { | ||
"type": "string", | ||
"title": "Details", | ||
"description": "If available, an in-depth description of the vulnerability as provided by the source organization. Details often include examples, proof-of-concepts, and other information useful in understanding root cause." | ||
}, | ||
"recommendation": { | ||
"type": "string", | ||
"title": "Details", | ||
"description": "Recommendations of how the vulnerability can be remediated or mitigated." | ||
}, | ||
Comment on lines
+1310
to
+1314
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. I saw this line in the PR description...
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.
The spec supports CVE 5.0 schema supports 'workaround', which is kinda the same thing. Do you see any issues with the current approach?
I was looking at the OSV schema and they have a single field. I also looked at CVE 5.0 schema and they support an array, but it appears to be used for languages - so a vulnerability supporting recommendations in English, French, and Mandarin for example. Do you see value in supporting an array of recommendations? I'm indifferent about it. 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.
Just to clarify, my confusion is around this part of the PR's description:
I think logically the structure makes sense, this was just a minor naming curiosity.
Good question. So far, only in contrived scenarios. I think string is good for the time being. 👍 |
||
"advisories": { | ||
"type": "array", | ||
"title": "Advisories", | ||
"description": "Published advisories of the vulnerability if provided.", | ||
"items": { | ||
"$ref": "#/definitions/advisory" | ||
} | ||
}, | ||
"created": { | ||
"type": "string", | ||
"format": "date-time", | ||
"title": "Created", | ||
"description": "The date and time (timestamp) when the vulnerability record was created in the vulnerability database." | ||
}, | ||
"published": { | ||
"type": "string", | ||
"format": "date-time", | ||
"title": "Published", | ||
"description": "The date and time (timestamp) when the vulnerability record was first published." | ||
}, | ||
"updated": { | ||
"type": "string", | ||
"format": "date-time", | ||
"title": "Updated", | ||
"description": "The date and time (timestamp) when the vulnerability record was last updated." | ||
}, | ||
"credits": { | ||
"type": "string", | ||
"title": "Credits", | ||
"description": "Individuals or organizations credited by with the discovery of the vulnerability." | ||
stevespringett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"tools": { | ||
"type": "array", | ||
"title": "Creation Tools", | ||
"description": "The tool(s) used in the creation of the BOM.", | ||
"items": {"$ref": "#/definitions/tool"} | ||
stevespringett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"analysis": { | ||
"type": "object", | ||
"title": "Impact Analysis", | ||
"description": "An assessment of the impact and exploitability of the vulnerability.", | ||
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. Is this "impact analysis" intended to include both likellihood of discovery/exploit as well as the technical/business impact of a successful exploit? I was looking for the basic Risk = Likelihood * Impact factors but maybe I'm looking in the wrong place. 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. Its currently in the 'ratings' property. One or more ratings can be specified. So if you opted to use temportal and environmental criteria in CVSS, you'll get some of that. You can also use OWASP risk rating which is directly supported. |
||
"additionalProperties": false, | ||
"properties": { | ||
"state": { | ||
"$ref": "#/definitions/impactAnalysisState" | ||
}, | ||
"impact": { | ||
"type": "string", | ||
"title": "Impact", | ||
"description": "A description of the impact." | ||
}, | ||
"detail": { | ||
"type": "string", | ||
"title": "Detail", | ||
"description": "Detailed description of the impact including methods used during assessment. If a vulnerability is not exploitable, this field should include specific details on why the component or service is not impacted by this vulnerability." | ||
} | ||
} | ||
}, | ||
"affects": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"additionalItems": false, | ||
"items": { | ||
"required": [ | ||
"ref" | ||
], | ||
"additionalProperties": false, | ||
"properties": { | ||
"ref": { | ||
"type": "string", | ||
"title": "Reference", | ||
"description": "References a component or service by the objects bom-ref" | ||
}, | ||
"ranges": { | ||
"$ref": "#/definitions/versionRangeArray" | ||
}, | ||
"versions": { | ||
"type": "array", | ||
"title": "Versions", | ||
"description": "Zero or more individual versions. Version can be combined with ranges.", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"title": "Affects", | ||
"description": "The bom-ref identifiers of the components or services that are affected by the vulnerability." | ||
}, | ||
"properties": { | ||
"type": "array", | ||
"title": "Properties", | ||
"description": "Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values.", | ||
"items": { | ||
"$ref": "#/definitions/property" | ||
} | ||
} | ||
} | ||
}, | ||
"versionRangeArray": { | ||
"type": "array", | ||
"title": "Ranges", | ||
"description": "Zero or more version ranges", | ||
"additionalItems": false, | ||
"items": { | ||
"$ref": "#/definitions/versionRange" | ||
} | ||
}, | ||
"versionRange": { | ||
"type": "string", | ||
"title": "Range", | ||
"description": "A simplified version range specification derived from node-semver. A version range is a set of comparators which specify versions that satisfy the range. A comparator is composed of an operator and a version. The set of primitive operators is: < Less than, <= Less than or equal to, > Greater than, >= Greater than or equal to, and = Equal. If no operator is specified, then equality is assumed, so this operator is optional, but MAY be included. Comparators can be joined by whitespace to form a comparator set. Only a single comparator set is allowed per range specified in the BOM. No further node-semver syntax is supported. Semver 2.0 and higher is required.", | ||
"examples": [ ">=1.2.7 <1.3.0", ">=1.2.7" ] | ||
stevespringett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
} |
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.
Is this a generic rating of this vulnerability, like the CVSS score? Or is the scoring intended to be specific to the particular application that this component is part of? If the latter, then the description could be updated to emphasize that.
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.
Multiple ratings can be specified, including those from the NVD and for the creators or operators of the application that component is a part of. OWASP Risk Rating is also supported here.