Skip to content

Commit 8bdbcbe

Browse files
Merge pull request #148 from desenna/fix/schema-1.4
fix: add missing `Vulnerability.properties` types in schema 1.4
2 parents acb644d + 970eeb2 commit 8bdbcbe

File tree

5 files changed

+52
-0
lines changed

5 files changed

+52
-0
lines changed

schema/bom-1.4.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,8 @@ message Vulnerability {
526526
optional VulnerabilityAnalysis analysis = 16;
527527
// affects
528528
repeated VulnerabilityAffects affects = 17;
529+
// Specifies optional, custom, properties
530+
repeated Property properties = 18;
529531
}
530532

531533
message VulnerabilityReference {

schema/bom-1.4.xsd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,6 +2014,16 @@ limitations under the License.
20142014
</xs:sequence>
20152015
</xs:complexType>
20162016
</xs:element>
2017+
<xs:element name="properties" type="bom:propertiesType" minOccurs="0" maxOccurs="1">
2018+
<xs:annotation>
2019+
<xs:documentation>Provides the ability to document properties in a key/value store.
2020+
This provides flexibility to include data not officially supported in the standard
2021+
without having to use additional namespaces or create extensions. Property names
2022+
of interest to the general public are encouraged to be registered in the
2023+
CycloneDX Property Taxonomy - https://github.com/CycloneDX/cyclonedx-property-taxonomy.
2024+
Formal registration is OPTIONAL.</xs:documentation>
2025+
</xs:annotation>
2026+
</xs:element>
20172027
</xs:sequence>
20182028
<xs:attribute name="bom-ref" type="bom:refType">
20192029
<xs:annotation>

tools/src/test/resources/1.4/valid-vulnerability-1.4.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,24 @@
116116
}
117117
]
118118
}
119+
],
120+
"properties": [
121+
{
122+
"name": "Foo",
123+
"value": "Bar"
124+
},
125+
{
126+
"name": "Foo",
127+
"value": "You"
128+
},
129+
{
130+
"name": "Foo",
131+
"value": "Two"
132+
},
133+
{
134+
"name": "Bar",
135+
"value": "Foo"
136+
}
119137
]
120138
}
121139
]

tools/src/test/resources/1.4/valid-vulnerability-1.4.textproto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,20 @@ vulnerabilities {
100100
status: VULNERABILITY_AFFECTED_STATUS_AFFECTED
101101
}
102102
}
103+
properties {
104+
name: "Foo"
105+
value: "Bar"
106+
}
107+
properties {
108+
name: "Foo"
109+
value: "You"
110+
}
111+
properties {
112+
name: "Foo"
113+
value: "Two"
114+
}
115+
properties {
116+
name: "Bar"
117+
value: "Foo"
118+
}
103119
}

tools/src/test/resources/1.4/valid-vulnerability-1.4.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@
116116
</versions>
117117
</target>
118118
</affects>
119+
<properties>
120+
<property name="Foo">Bar</property>
121+
<property name="Foo">You</property>
122+
<property name="Foo">Two</property>
123+
<property name="Bar">Foo</property>
124+
</properties>
119125
</vulnerability>
120126
</vulnerabilities>
121127
</bom>

0 commit comments

Comments
 (0)