-
Notifications
You must be signed in to change notification settings - Fork 42
Update schema JSON to use cross-referencing and force more validations #704
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
Changes from 5 commits
32d7350
e9d5204
b179117
25fbdb8
a98d509
0dc08d0
e660e89
5df1fb7
a4796e9
c1d8cca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,23 +15,29 @@ | |||||
| "properties": { | ||||||
| "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" | ||||||
| "description": "A key (a short, unique string) that can be used to identify the Decision Point/Decision Point value in a shorthand way", | ||||||
| "minLength": 1, | ||||||
| "examples": ["P", "Y"] | ||||||
| }, | ||||||
| "name": { | ||||||
| "type": "string", | ||||||
| "description": "A short label that captures the description of the Decision Point or the Group of Decision Points." | ||||||
| "description": "A short label that captures the description of the Decision Point or the Group of Decision Points.", | ||||||
| "minLength": 1, | ||||||
| "examples": ["Public PoC", "Yes"] | ||||||
| }, | ||||||
| "description": { | ||||||
| "type": "string", | ||||||
| "description": "Description of the Decision Point Value" | ||||||
| "description": "Description of the Decision Point Value", | ||||||
| "minLength": 1, | ||||||
| "examples": ["One of the following is true: (1) Typical public PoC exists in sources such as Metasploit or websites like ExploitDB; or (2) the vulnerability has a well-known method of exploitation.","Attackers can reliably automate steps 1-4 of the kill chain."] | ||||||
| } | ||||||
| }, | ||||||
| "required" : [ | ||||||
| "key", | ||||||
| "name", | ||||||
| "description" | ||||||
| ] | ||||||
| }, | ||||||
| }, | ||||||
sei-vsarvepalli marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| "decision_point": { | ||||||
| "type": "object", | ||||||
| "additionalProperties": false, | ||||||
|
|
@@ -41,23 +47,32 @@ | |||||
| }, | ||||||
| "namespace": { | ||||||
| "type": "string", | ||||||
| "description": "Namespace (a short, unique string): For example, \"ssvc\" or \"cvss\" to indicate the source of the decision point" | ||||||
| "description": "Namespace (a short, unique string): For example, \"ssvc\" or \"cvss\" to indicate the source of the decision point. See SSVC Documentation for details.", | ||||||
| "pattern": "^[a-z0-9-]{3,4}[a-z0-9/\\.-]*$", | ||||||
ahouseholder marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| "examples": ["ssvc", "cvss", "ssvc-jp", "ssvc/acme", "ssvc/example.com"] | ||||||
| }, | ||||||
| "version": { | ||||||
| "type": "string", | ||||||
| "description": "Version (a semantic version string) that identifies this object" | ||||||
| "description": "Version (a semantic version string) that identifies this object", | ||||||
| "pattern": "^(0|[1-9]\d*)\\.(0|[1-9]\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$" | ||||||
|
||||||
| "pattern": "^(0|[1-9]\d*)\\.(0|[1-9]\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$" | |
| "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma missing at the end as well that is fixed now in the 0dc08d0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we stick to [0-9] instead of \d as \d matches say Arabic numerals when regex is used with unicode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Commenting without diff'ing the strings) I'd be most comfortable with the second example provided by
specifically
https://regex101.com/r/vkijKf/1/
on the basis that if the semver.org thinks that's the regex, I'd take their word for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we have is exactly that with the double backslashes for usage in the JSON schema that's all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we stick to [0-9] instead of \d as \d matches say Arabic numerals when regex is used with unicode?
I'd like that as it eliminates the ambiguousness. \d is unfortunately sometimes interpreted differently...
ahouseholder marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
ahouseholder marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
ahouseholder marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,16 +16,19 @@ | |
| "$ref": "#/$defs/schemaVersion" | ||
| }, | ||
| "version": { | ||
| "type": "string", | ||
| "description": "Version (a semantic version string) that identifies this object" | ||
| "$ref": "https://certcc.github.io/SSVC/data/schema/v1/Decision_Point-1-0-1.schema.json#/$defs/decision_point/properties/version" | ||
| }, | ||
| "name": { | ||
| "type": "string", | ||
| "description": "A short label that captures the description of the Decision Point or the Group of Decision Points." | ||
| "description": "A short label that captures the description of the Decision Point or the Group of Decision Points.", | ||
ahouseholder marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "minLength": 1, | ||
| "examples": ["SSVC Supplier","Coordinator Triage", "SSVC Deployer"] | ||
ahouseholder marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| "description": { | ||
| "type": "string", | ||
| "description": "Description of the Decision Point or the Group of Decision Points." | ||
| "description": "Description of the Decision Point or the Group of Decision Points.", | ||
|
||
| "minLength": 1, | ||
| "examples": ["The decision points used by the coordinator during publication"] | ||
| }, | ||
| "decision_points": { | ||
| "type": "array", | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,53 +5,40 @@ | |||||
| "id": { | ||||||
| "type": "string", | ||||||
| "description": "Identifier for a vulnerability could be CVE, CERT/CC VU#, OSV id, Bugtraq, GHSA etc.", | ||||||
| "examples": ["CVE-1900-1234","VU#11111","GHSA-11a1-22b2-33c3"] | ||||||
| "examples": ["CVE-1900-1234","VU#11111","GHSA-11a1-22b2-33c3"], | ||||||
| "minLength": 1 | ||||||
| }, | ||||||
| "role": { | ||||||
| "type": "string", | ||||||
| "description": "Roles to define SSVC Stakeholders https://certcc.github.io/SSVC/topics/enumerating_stakeholders/", | ||||||
| "examples": ["Supplier","Deployer","Coordinator"] | ||||||
| "examples": ["Supplier","Deployer","Coordinator"], | ||||||
| "minLength": 1 | ||||||
| }, | ||||||
| "timestamp" : { | ||||||
| "description": "Date and time in ISO format ISO 8601 format", | ||||||
| "description": "Date and time according to RFC 3339, section 5.6.", | ||||||
| "type": "string", | ||||||
| "format": "date-time" | ||||||
| "pattern": "^(?:[1-9]\\d{3}-[01]\\d-[0-3]\\d[Tt][0-2]\\d:[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:[Zz]|[+-][0-2]\\d:[0-5]\\d))$" | ||||||
|
||||||
| "pattern": "^(?:[1-9]\\d{3}-[01]\\d-[0-3]\\d[Tt][0-2]\\d:[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:[Zz]|[+-][0-2]\\d:[0-5]\\d))$" | |
| "format": "date-time" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be inside a decision point value spec. So it's a brief name for the decision point value, right? It's not describing the decision point or the group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh - those have been the same. I have not changed them. Bu happy to change them as well. You are only seeing it because the "comma" at the end added.