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

Added support for concluded value. Updated test cases. #412

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions schema/bom-1.6.proto
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,8 @@ message EvidenceIdentity {
repeated EvidenceMethods methods = 3;
// The object in the BOM identified by its bom-ref. This is often a component or service, but may be any object type supporting bom-refs. Tools used for analysis should already be defined in the BOM, either in the metadata/tools, components, or formulation.
repeated string tools = 4;
// The value of the field (cpe, purl, etc) that has been concluded based on the aggregate of all methods (if available).
optional string concludedValue = 5;
}

message EvidenceMethods {
Expand Down
5 changes: 5 additions & 0 deletions schema/bom-1.6.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4441,6 +4441,11 @@
"title": "Confidence",
"description": "The overall confidence of the evidence from 0 - 1, where 1 is 100% confidence."
},
"concludedValue": {
jkowalleck marked this conversation as resolved.
Show resolved Hide resolved
"type": "string",
"title": "Concluded Value",
"description": "The value of the field (cpe, purl, etc) that has been concluded based on the aggregate of all methods (if available)."
},
"methods": {
"type": "array",
"title": "Methods",
Expand Down
5 changes: 5 additions & 0 deletions schema/bom-1.6.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -2354,6 +2354,11 @@ limitations under the License.
<xs:documentation>The overall confidence of the evidence from 0 - 1, where 1 is 100% confidence.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="concludedValue" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>The value of the field (cpe, purl, etc) that has been concluded based on the aggregate of all methods (if available).</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="methods" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>The methods used to extract and/or analyze the evidence.</xs:documentation>
Expand Down
3 changes: 3 additions & 0 deletions tools/src/test/resources/1.6/valid-evidence-1.6.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
{
"field": "group",
"confidence": 0.1,
"concludedValue": "com.example",
"methods": [
{
"technique": "filename",
Expand All @@ -128,6 +129,7 @@
{
"field": "name",
"confidence": 0.1,
"concludedValue": "example-project",
"methods": [
{
"technique": "filename",
Expand All @@ -139,6 +141,7 @@
{
"field": "version",
"confidence": 0.1,
"concludedValue": "1.0.0",
"methods": [
{
"technique": "filename",
Expand Down
3 changes: 3 additions & 0 deletions tools/src/test/resources/1.6/valid-evidence-1.6.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ components [
value: "example-project-1.0.0.jar"
}
]
concludedValue: "com.example"
},
{
field: EVIDENCE_FIELD_NAME
Expand All @@ -133,6 +134,7 @@ components [
value: "example-project-1.0.0.jar"
}
]
concludedValue: "example-project"
},
{
field: EVIDENCE_FIELD_VERSION
Expand All @@ -144,6 +146,7 @@ components [
value: "example-project-1.0.0.jar"
}
]
concludedValue: "1.0.0"
}
]
}
Expand Down
3 changes: 3 additions & 0 deletions tools/src/test/resources/1.6/valid-evidence-1.6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<identity>
<field>group</field>
<confidence>0.1</confidence>
<concludedValue>com.example</concludedValue>
<methods>
<method>
<technique>filename</technique>
Expand All @@ -108,6 +109,7 @@
<identity>
<field>name</field>
<confidence>0.1</confidence>
<concludedValue>example-project</concludedValue>
<methods>
<method>
<technique>filename</technique>
Expand All @@ -119,6 +121,7 @@
<identity>
<field>version</field>
<confidence>0.1</confidence>
<concludedValue>1.0.0</concludedValue>
<methods>
<method>
<technique>filename</technique>
Expand Down