Skip to content

Commit

Permalink
Resolve part of Feature/issue 602 to add schemaVersion field (#606)
Browse files Browse the repository at this point in the history
* Updates to schema to add schemaVersion as optional field

* Updated all data/json/decision_point/* files appropriately with schemaVersion field

* run doctools.py on the current code

---------

Co-authored-by: Allen D. Householder <[email protected]>
Co-authored-by: Allen Householder <[email protected]>
  • Loading branch information
3 people authored Jul 16, 2024
1 parent f6cfca4 commit 0f85e1e
Show file tree
Hide file tree
Showing 36 changed files with 93 additions and 48 deletions.
1 change: 1 addition & 0 deletions data/json/decision_points/automatable_2_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "2.0.0",
"schemaVersion": "1-0-1",
"key": "A",
"name": "Automatable",
"description": "Can an attacker reliably automate creating exploitation events for this vulnerability?",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/exploitation_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "E",
"name": "Exploitation",
"description": "The present state of exploitation of the vulnerability.",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/exploitation_1_1_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.1.0",
"schemaVersion": "1-0-1",
"key": "E",
"name": "Exploitation",
"description": "The present state of exploitation of the vulnerability.",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/human_impact_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"schemaVersion": "1-0-1",
"namespace": "ssvc",
"version": "1.0.0",
"key": "HI",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/human_impact_2_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "2.0.0",
"schemaVersion": "1-0-1",
"key": "HI",
"name": "Human Impact",
"description": "Human Impact is a combination of Safety and Mission impacts.",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/human_impact_2_0_1.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "2.0.1",
"schemaVersion": "1-0-1",
"key": "HI",
"name": "Human Impact",
"description": "Human Impact is a combination of Safety and Mission impacts.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "MWI",
"name": "Mission and Well-Being Impact",
"description": "Mission and Well-Being Impact is a combination of Mission Prevalence and Public Well-Being Impact.",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/mission_impact_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "MI",
"name": "Mission Impact",
"description": "Impact on Mission Essential Functions of the Organization",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/mission_impact_2_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "2.0.0",
"schemaVersion": "1-0-1",
"key": "MI",
"name": "Mission Impact",
"description": "Impact on Mission Essential Functions of the Organization",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/public_safety_impact_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"schemaVersion": "1-0-1",
"namespace": "ssvc",
"version": "1.0.0",
"key": "PSI",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/public_safety_impact_2_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "2.0.0",
"schemaVersion": "1-0-1",
"key": "PSI",
"name": "Public Safety Impact",
"description": "A coarse-grained representation of impact to public safety.",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/public_safety_impact_2_0_1.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "2.0.1",
"schemaVersion": "1-0-1",
"key": "PSI",
"name": "Public Safety Impact",
"description": "A coarse-grained representation of impact to public safety.",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/public_value_added_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "PVA",
"name": "Public Value Added",
"description": "How much value would a publication from the coordinator benefit the broader community?",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "PWI",
"name": "Public Well-Being Impact",
"description": "A coarse-grained representation of impact to public well-being.",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/report_credibility_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "RC",
"name": "Report Credibility",
"description": "Is the report credible?",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/report_public_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "RP",
"name": "Report Public",
"description": "Is a viable report of the details of the vulnerability already publicly available?",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/safety_impact_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "SI",
"name": "Safety Impact",
"description": "The safety impact of the vulnerability.",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/safety_impact_2_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "2.0.0",
"schemaVersion": "1-0-1",
"key": "SI",
"name": "Safety Impact",
"description": "The safety impact of the vulnerability. (based on IEC 61508)",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/supplier_cardinality_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "SC",
"name": "Supplier Cardinality",
"description": "How many suppliers are responsible for the vulnerable component and its remediation or mitigation plan?",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/supplier_contacted_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "SC",
"name": "Supplier Contacted",
"description": "Has the reporter made a good-faith effort to contact the supplier of the vulnerable component using a quality contact method?",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/supplier_engagement_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "SE",
"name": "Supplier Engagement",
"description": "Is the supplier responding to the reporter\u2019s contact effort and actively participating in the coordination effort?",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/supplier_involvement_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "SI",
"name": "Supplier Involvement",
"description": "What is the state of the supplier\u2019s work on addressing the vulnerability?",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/system_exposure_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "EXP",
"name": "System Exposure",
"description": "The Accessible Attack Surface of the Affected System or Service",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/system_exposure_1_0_1.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.1",
"schemaVersion": "1-0-1",
"key": "EXP",
"name": "System Exposure",
"description": "The Accessible Attack Surface of the Affected System or Service",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/technical_impact_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "TI",
"name": "Technical Impact",
"description": "The technical impact of the vulnerability.",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/utility_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "U",
"name": "Utility",
"description": "The Usefulness of the Exploit to the Adversary",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/utility_1_0_1.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.1",
"schemaVersion": "1-0-1",
"key": "U",
"name": "Utility",
"description": "The Usefulness of the Exploit to the Adversary",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/value_density_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "VD",
"name": "Value Density",
"description": "The concentration of value in the target",
Expand Down
1 change: 1 addition & 0 deletions data/json/decision_points/virulence_1_0_0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "ssvc",
"version": "1.0.0",
"schemaVersion": "1-0-1",
"key": "V",
"name": "Virulence",
"description": "The speed at which the vulnerability can be exploited.",
Expand Down
2 changes: 1 addition & 1 deletion data/schema/current/Decision_Point_Group.schema.json
61 changes: 33 additions & 28 deletions data/schema/v1/Decision_Point-1-0-1.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,42 +36,47 @@
"type": "object",
"additionalProperties": false,
"properties": {
"namespace": {
"type": "string",
"description": "Namespace (a short, unique string): For example, \"ssvc\" or \"cvss\" to indicate the source of the decision point"
},
"version": {
"type": "string",
"description": "Version (a semantic version string) that identifies this object"
},
"key": {
"type": "string",
"description": "A key (a short, unique string) that can be used to identify the Decision Point/Decision Point value in a shorthand way"
},
"name": {
"type": "string",
"description": "A short label that captures the description of the Decision Point or the Group of Decision Points."
},
"description": {
"type": "string",
"description": "q Description of the Decision Point or the Group of Decision Points as defined."
},
"values": {
"description": "Decision Point Values are valid results from a Decision Point",
"uniqueItems": true,
"type": "array",
"items": {
"$ref": "#/definitions/decision_point_value"
"schemaVersion": {
"$ref": "#/definitions/schemaVersion"
},
"namespace": {
"type": "string",
"description": "Namespace (a short, unique string): For example, \"ssvc\" or \"cvss\" to indicate the source of the decision point"
},
"version": {
"type": "string",
"description": "Version (a semantic version string) that identifies this object"
},
"key": {
"type": "string",
"description": "A key (a short, unique string) that can be used to identify the Decision Point/Decision Point value in a shorthand way"
},
"name": {
"type": "string",
"description": "A short label that captures the description of the Decision Point or the Group of Decision Points."
},
"description": {
"type": "string",
"description": "q Description of the Decision Point or the Group of Decision Points as defined."
},
"values": {
"description": "Decision Point Values are valid results from a Decision Point",
"uniqueItems": true,
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/decision_point_value"
}
}
}
},
"required": [
"namespace",
"version",
"key",
"name",
"description",
"values"
"values",
"schemaVersion"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"type": "object",
"additionalProperties": false,
"properties": {
"schemaVersion": {
"$ref": "#/definitions/schemaVersion"
},
"version": {
"type": "string",
"description": "Version (a semantic version string) that identifies this object"
Expand All @@ -26,16 +29,18 @@
},
"decision_points": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "https://certcc.github.io/SSVC/data/schema/Decision_Point.schema.json"
"$ref": "https://certcc.github.io/SSVC/data/schema/v1/Decision_Point-1-0-1.schema.json"
}
}
},
"required": [
"version",
"name",
"description",
"decision_points"
"decision_points",
"schemaVersion"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"description": "Evaluated values of the Decision Point",
"title": "values",
"type": "array",
"minItems": 1,
"items": {
"description": "Each value that were down-selected for a Decision Point",
"title": "values",
Expand Down Expand Up @@ -80,6 +81,7 @@
"description" : "An array of Decision Points and their Values that were down-selected or evaluated ",
"title": "selections",
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/SsvcdecisionpointselectionSchema"
}
Expand Down
2 changes: 2 additions & 0 deletions src/ssvc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
"""
Provides SSVC modules.
"""

_schemaVersion = "1-0-1"
3 changes: 2 additions & 1 deletion src/ssvc/_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from dataclasses_json import config, dataclass_json

from . import _schemaVersion

@dataclass_json
@dataclass(kw_only=True)
Expand All @@ -31,7 +32,7 @@ class _Versioned:
"""

version: str = "0.0.0"

schemaVersion: str = _schemaVersion

@dataclass_json
@dataclass(kw_only=True)
Expand Down
Loading

0 comments on commit 0f85e1e

Please sign in to comment.