diff --git a/schema/CVE_Record_Format.json b/schema/CVE_Record_Format.json index fde05ad596..6ecd83a8b2 100644 --- a/schema/CVE_Record_Format.json +++ b/schema/CVE_Record_Format.json @@ -212,7 +212,7 @@ }, "cpes": { "type": "array", - "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.", + "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.", "uniqueItems": true, "items": { "title": "CPE Name", @@ -500,6 +500,85 @@ "required": ["orgId"], "additionalProperties": false }, + "applicability": { + "type": "array", + "items": { + "$ref": "#/definitions/applicabilityElement" + } + }, + "applicabilityElement": { + "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.", + "properties": { + "operator": { + "type": "string", + "enum": ["AND", "OR"] + }, + "negate": { + "type": "boolean" + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/definitions/node" + } + } + } + }, + "node": { + "description": "Defines a configuration node in an applicability statement.", + "properties": { + "operator": { + "type": "string", + "enum": ["AND", "OR"] + }, + "negate": { + "type": "boolean" + }, + "cpeMatch": { + "type": "array", + "items": { + "$ref": "#/definitions/cpe_match" + } + }, + "omniborMatch": { + "type": "array", + "items": { + "$ref": "#/definitions/omnibor_match" + } + } + }, + "allOf": [ + { "required": ["operator"] }, + { + "anyOf": [ + { "required": ["cpeMatch"] }, + { "required": ["omniborMatch"] } + ] + } + ] + }, + "omnibor_match": { + "description": "OmniBOR match string", + "type": "object", + "properties": { + "vulnerable": { + "type": "boolean", + "description": "Indicates whether the Artifact ID is being used to specify a vulnerable or not-vulnerable artifact." + }, + "artifactId": { + "type": "string", + "pattern": "^gitoid:blob:sha256:[0-9a-f]{64}$", + "description": "The Artifact ID of the artifact to be matched against." + }, + "target": { + "type": "string", + "enum": ["artifact", "build_input"], + "description": "Specifies how consumers of the Artifact ID should search for matches. If the 'target' is 'artifact', then the Artifact ID is identifying an artifact which should be searched for directly (for example, within a file system by matching against Artifact IDs for files). If the 'target' is 'build_input' then the Artifact ID is identifying a build input, and consumers should match the Artifact ID against IDs found in OmniBOR Input Manifests for their software." + } + }, + "required": ["vulnerable", "artifactId", "target"], + "additionalProperties": false + }, "cpeApplicabilityElement": { "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.", "properties": { @@ -608,6 +687,12 @@ "affected": { "$ref": "#/definitions/affected" }, + "applicability": { + "type": "array", + "items": { + "$ref": "#/definitions/applicabilityElement" + } + }, "cpeApplicability": { "type": "array", "items": { @@ -654,11 +739,20 @@ "$ref": "#/definitions/taxonomyMappings" } }, - "required": [ - "providerMetadata", - "descriptions", - "affected", - "references" + "allOf": [ + { + "required": [ + "providerMetadata", + "descriptions", + "affected", + "references" + ] + }, + { + "not": { + "required": ["applicability", "cpeApplicability"] + } + } ], "patternProperties": { "^x_[^.]*$": {} @@ -720,6 +814,12 @@ "affected": { "$ref": "#/definitions/affected" }, + "applicability": { + "type": "array", + "items": { + "$ref": "#/definitions/applicabilityElement" + } + }, "cpeApplicability": { "type": "array", "items": { @@ -766,8 +866,15 @@ "$ref": "#/definitions/taxonomyMappings" } }, - "required": [ - "providerMetadata" + "allOf": [ + { + "required": ["providerMetadata"] + }, + { + "not": { + "required": ["applicability", "cpeApplicability"] + } + } ], "minProperties": 2, "patternProperties": {