Skip to content

Commit 32b212a

Browse files
feat: Make "cpeApplicability" structure generic.
This "renames" (not actually a rename, see below) the existing "cpeApplicability" structure and its children from CPE-specific names to generic names. For example, "cpeApplicability" becomes "applicability." This is intended to permit future record format updates to add support for additional kinds of software identifiers. This change itself does not add any new kinds of software identifiers. The prior "cpeApplicability" structure remains entirely supported, though CNAs and any future ADPs enriching with software ID information should be encouraged to use the more expressive new "applicability" structure instead, and use of both at the same time should be treated as an error to avoid ambiguity. Signed-off-by: Andrew Lilley Brinker <[email protected]>
1 parent ddd04fb commit 32b212a

File tree

1 file changed

+80
-8
lines changed

1 file changed

+80
-8
lines changed

schema/CVE_Record_Format.json

Lines changed: 80 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
},
213213
"cpes": {
214214
"type": "array",
215-
"description": "Affected products defined by CPE. This is an array of CPE values (vulnerable and not), we use an array so that we can make multiple statements about the same version and they are separate (if we used a JSON object we'd essentially be keying on the CPE name and they would have to overlap). Also, this allows things like cveDataVersion or cveDescription to be applied directly to the product entry. This also allows more complex statements such as \"Product X between versions 10.2 and 10.8\" to be put in a machine-readable format. As well since multiple statements can be used multiple branches of the same product can be defined here. NOTE: Consider using the newer cpeApplicability block for defining CPE data using the CPE Applicability Language which includes more options for defining CPE Names.",
215+
"description": "Affected products defined by CPE. This is an array of CPE values (vulnerable and not), we use an array so that we can make multiple statements about the same version and they are separate (if we used a JSON object we'd essentially be keying on the CPE name and they would have to overlap). Also, this allows things like cveDataVersion or cveDescription to be applied directly to the product entry. This also allows more complex statements such as \"Product X between versions 10.2 and 10.8\" to be put in a machine-readable format. As well since multiple statements can be used multiple branches of the same product can be defined here. NOTE: Consider using the newer applicability block for defining CPE data using the CPE Applicability Language which includes more options for defining CPE Names.",
216216
"uniqueItems": true,
217217
"items": {
218218
"title": "CPE Name",
@@ -500,6 +500,56 @@
500500
"required": ["orgId"],
501501
"additionalProperties": false
502502
},
503+
"applicability": {
504+
"type": "array",
505+
"items": {
506+
"$ref": "#/definitions/applicabilityElement"
507+
}
508+
},
509+
"applicabilityElement": {
510+
"description": "Affected products defined using one or more software identifiers and applicability parameters. An operator property allows AND or OR logic between identifiers or combinations thereof. The negate and vulnerable Boolean properties allow applicability combinations to be inverted and/or defined as vulnerable or not. Multiple version fields are provided for capturing ranges of products when defining a Match String Range. NOTE: When defining an applicability block, it is recommended that it align with (as much as possible) the product data provided within the affected block.",
511+
"properties": {
512+
"operator": {
513+
"type": "string",
514+
"enum": ["AND", "OR"]
515+
},
516+
"negate": {
517+
"type": "boolean"
518+
},
519+
"nodes": {
520+
"type": "array",
521+
"items": {
522+
"$ref": "#/definitions/node"
523+
}
524+
}
525+
}
526+
},
527+
"node": {
528+
"description": "Defines a configuration node in an applicability statement.",
529+
"properties": {
530+
"operator": {
531+
"type": "string",
532+
"enum": ["AND", "OR"]
533+
},
534+
"negate": {
535+
"type": "boolean"
536+
},
537+
"cpeMatch": {
538+
"type": "array",
539+
"items": {
540+
"$ref": "#/definitions/cpe_match"
541+
}
542+
}
543+
},
544+
"allOf": [
545+
{ "required": ["operator"] },
546+
{
547+
"anyOf": [
548+
{ "required": ["cpeMatch"] }
549+
]
550+
}
551+
]
552+
},
503553
"cpeApplicabilityElement": {
504554
"description": "Affected products defined using an implementation of the CPE Applicability Language, mostly copied/forked from the NIST NVD CVE API v2.0 schema (optional). An operator property allows AND or OR logic between CPEs or combinations of CPEs. The negate and vulnerable Boolean properties allow CPEs to be inverted and/or defined as vulnerable or not. Multiple version fields are provided for capturing ranges of products when defining a CPE Match String Range. NOTE: When defining a cpeApplicability block, it is recommended that it align with (as much as possible) the product data provided within the affected block.",
505555
"properties": {
@@ -654,11 +704,20 @@
654704
"$ref": "#/definitions/taxonomyMappings"
655705
}
656706
},
657-
"required": [
658-
"providerMetadata",
659-
"descriptions",
660-
"affected",
661-
"references"
707+
"allOf": [
708+
{
709+
"required": [
710+
"providerMetadata",
711+
"descriptions",
712+
"affected",
713+
"references"
714+
]
715+
},
716+
{
717+
"not": {
718+
"required": ["applicability", "cpeApplicability"]
719+
}
720+
}
662721
],
663722
"patternProperties": {
664723
"^x_[^.]*$": {}
@@ -720,6 +779,12 @@
720779
"affected": {
721780
"$ref": "#/definitions/affected"
722781
},
782+
"applicability": {
783+
"type": "array",
784+
"items": {
785+
"$ref": "#/definitions/applicabilityElement"
786+
}
787+
},
723788
"cpeApplicability": {
724789
"type": "array",
725790
"items": {
@@ -766,8 +831,15 @@
766831
"$ref": "#/definitions/taxonomyMappings"
767832
}
768833
},
769-
"required": [
770-
"providerMetadata"
834+
"allOf": [
835+
{
836+
"required": ["providerMetadata"]
837+
},
838+
{
839+
"not": {
840+
"required": ["applicability", "cpeApplicability"]
841+
}
842+
}
771843
],
772844
"minProperties": 2,
773845
"patternProperties": {

0 commit comments

Comments
 (0)