Skip to content

Commit

Permalink
Merge pull request #753 from tschmidtb51/schema
Browse files Browse the repository at this point in the history
Schema identifier added to JSONs
  • Loading branch information
tschmidtb51 authored Jul 2, 2024
2 parents a00c000 + e37ffd7 commit dc591fc
Show file tree
Hide file tree
Showing 333 changed files with 386 additions and 30 deletions.
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/bsi-2022-0001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"aggregate_severity": {
"text": "Moderate"
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/cisco-sa-20180328-smi2.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"title": "Cisco IOS and IOS XE Software Smart Install Remote Code Execution Vulnerability",
"category": "Cisco Security Advisory",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/csaf_vex/2022-evd-uc-01-a-001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_vex",
"csaf_version": "2.1",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/csaf_vex/2022-evd-uc-01-f-001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_vex",
"csaf_version": "2.1",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/csaf_vex/2022-evd-uc-01-na-001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_vex",
"csaf_version": "2.1",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/csaf_vex/2022-evd-uc-01-ui-001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_vex",
"csaf_version": "2.1",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/csaf_vex/2022-evd-uc-02-na-001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_vex",
"csaf_version": "2.1",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/csaf_vex/2022-evd-uc-03-ms-001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_vex",
"csaf_version": "2.1",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/csaf_vex/2022-evd-uc-04-001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_vex",
"csaf_version": "2.1",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/csaf_vex/2022-evd-uc-05-001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_vex",
"csaf_version": "2.1",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/csaf_vex/2022-evd-uc-06-001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_vex",
"csaf_version": "2.1",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/csaf_vex/2022-evd-uc-07-001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_vex",
"csaf_version": "2.1",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/csaf_vex/2022-evd-uc-08-001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_vex",
"csaf_version": "2.1",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/csaf_vex/2022-evd-uc-09-001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_vex",
"csaf_version": "2.1",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/csaf_vex/sec-vex-2022-0001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_vex",
"csaf_version": "2.1",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/rhsa-2019_1862.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"aggregate_severity": {
"namespace": "https://access.redhat.com/security/updates/classification/",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/rhsa-2021_5186.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"aggregate_severity": {
"namespace": "https://access.redhat.com/security/updates/classification/",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/rhsa-2021_5217.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"aggregate_severity": {
"namespace": "https://access.redhat.com/security/updates/classification/",
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/examples/csaf/rhsa-2022_0011.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"aggregate_severity": {
"namespace": "https://access.redhat.com/security/updates/classification/",
Expand Down
10 changes: 10 additions & 0 deletions csaf_2.1/json_schema/csaf_json_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,19 @@
}
},
"required": [
"$schema",
"document"
],
"properties": {
"$schema": {
"title": "JSON schema",
"description": "Contains the URL of the CSAF JSON schema which the document promises to be valid for.",
"type": "string",
"enum": [
"https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json"
],
"format": "uri"
},
"document": {
"title": "Document level meta-data",
"description": "Captures the meta-data about this document describing a particular set of security advisories.",
Expand Down
8 changes: 6 additions & 2 deletions csaf_2.1/prose/edit/src/conformance.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ A CSAF content management system satisfies the "CSAF content management system"
new advisories for that group. He might also do the user management for the group up to a configured level.
* prefills the following fields in new CSAF documents with the values given below or based on the templates from configuration:
* `/document/csaf_version` with the value `2.0`
* `/$schema` with the value prescribed by the schema
* `/document/csaf_version` with the value prescribed by the schema
* `/document/language`
* `/document/notes`
* `legal_disclaimer` (Terms of use from the configuration)
Expand All @@ -286,7 +287,8 @@ A CSAF content management system satisfies the "CSAF content management system"
* prefills all fields which have be present in the existing CSAF document
* adds a new item in `/document/tracking/revision_history[]`
* updates the following fields with the values given below or based on the templates from configuration:
* `/document/csaf_version` with the value `2.0`
* `/$schema` with the value prescribed by the schema
* `/document/csaf_version` with the value prescribed by the schema
* `/document/language`
* `/document/notes`
* `legal_disclaimer` (Terms of use from the configuration)
Expand Down Expand Up @@ -513,6 +515,8 @@ Secondly, the program fulfills the following for all items of:
* type `/$defs/full_product_name_t/cpe`: If a CPE is invalid, the CSAF 2.0 to CSAF 2.1 converter SHOULD removed the invalid value and output a
warning that an invalid CPE was detected and removed. Such a warning MUST include the invalid CPE.
* `/$schema`: The CSAF 2.0 to CSAF 2.1 converter MUST set property with the value prescribed by the schema.
* `/document/csaf_version`: The CSAF 2.0 to CSAF 2.1 converter MUST update the value to `2.1`.
* `/document/distribution/tlp/label`: If a TLP label is given, the CSAF 2.0 to CSAF 2.1 converter MUST convert it according to the table below:
| CSAF 2.0 (using TLP v1.0) | CSAF 2.1 (using TLP v2.0) |
Expand Down
8 changes: 7 additions & 1 deletion csaf_2.1/prose/edit/src/guidance-on-size.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,13 @@ A string which is an enum has a fixed maximum length given by its longest value.
> Later versions of CSAF might add, modify or delete possible value which could change the longest value.
> Therefore, this sizes should not be implemented as fixed limits if forward compatibility is desired.
It seems to be safe to assume that the length of each value is not greater than 50. This applies to:
The value of `/$schema` is a fixed URL, currently pointing to the JSON schema location.
It seems to be safe to assume that the length of this value is not greater than 5. This applies to:

* `/$schema` (64)

For all other values, it seems to be safe to assume that the length of each value is not greater than 50.
This applies to:

* `/document/csaf_version` (3)
* `/document/distribution/tlp/label` (12)
Expand Down
1 change: 1 addition & 0 deletions csaf_2.1/prose/edit/src/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Furthermore, it is the foundation all other profiles are build on.
A CSAF document SHALL fulfill the following requirements to satisfy the profile "CSAF Base":

* The following elements MUST exist and be valid:
* `/$schema`
* `/document/category`
* `/document/csaf_version`
* `/document/distribution/tlp/label`
Expand Down
4 changes: 2 additions & 2 deletions csaf_2.1/prose/edit/src/schema-elements-02-properties.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Properties

These final three subsections document the three properties of a CSAF document.
The single mandatory property `document`, as well as the optional properties `product_tree` and `vulnerabilities` in that order.
These final four subsections document the four properties of a CSAF document.
The two mandatory properties `$schema` and `document`, as well as the optional properties `product_tree` and `vulnerabilities` in that order.
11 changes: 11 additions & 0 deletions csaf_2.1/prose/edit/src/schema-elements-02-props-01-schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Schema Property

JSON schema (`$schema`) of value type `string` and `enum` with format `uri` contains the URL of the CSAF JSON schema which the document promises to be valid for.
The single valid value for this `enum` is:

```
https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json
```

> This value allows for tools to identify that a JSON document is meant to be valid against this schema.
> Tools can use that to support users by automatically checking whether the CSAF adheres to the JSON schema identified by this URL.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"acknowledgments": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
Expand Down
Loading

0 comments on commit dc591fc

Please sign in to comment.