forked from oasis-tcs/csaf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- addresses parts of oasis-tcs#705 - add mandatory test to prevent usage other UUID than Max UUID in TLP:CLEAR - add invalid examples - add valid examples - adapt testcases list and schema
- Loading branch information
1 parent
71bbbd2
commit 077fc24
Showing
7 changed files
with
193 additions
and
1 deletion.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
csaf_2.1/prose/edit/src/tests-01-mndtr-41-public-sharing-group-with-no-max-uuid.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
### Public Sharing Group with no Max UUID | ||
|
||
It MUST be tested that a CSAF document with the TLP label `CLEAR` use the Max UUID as sharing group ID if any. | ||
The test SHALL pass if no sharing group is present or the Nil UUID is used and the document status is `draft`. | ||
|
||
The relevant path for this test is: | ||
|
||
``` | ||
/document/distribution/sharing_group/id | ||
``` | ||
|
||
*Example 1 (which fails the test):* | ||
|
||
``` | ||
"distribution": { | ||
"sharing_group": { | ||
"id": "5868d6be-b28a-404e-a245-0b5093b31b8b" | ||
}, | ||
"tlp": { | ||
"label": "CLEAR" | ||
} | ||
}, | ||
``` | ||
|
||
> The sharing group is present for the `TLP:CLEAR` document but it differs from the Max UUID. |
35 changes: 35 additions & 0 deletions
35
csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-41-01.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json", | ||
"document": { | ||
"category": "csaf_base", | ||
"csaf_version": "2.1", | ||
"distribution": { | ||
"sharing_group": { | ||
"id": "5868d6be-b28a-404e-a245-0b5093b31b8b" | ||
}, | ||
"tlp": { | ||
"label": "CLEAR" | ||
} | ||
}, | ||
"publisher": { | ||
"category": "other", | ||
"name": "OASIS CSAF TC", | ||
"namespace": "https://csaf.io" | ||
}, | ||
"title": "Mandatory test: Public Sharing Group with no Max UUID (failing example 1)", | ||
"tracking": { | ||
"current_release_date": "2024-01-24T10:00:00.000Z", | ||
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-41-01", | ||
"initial_release_date": "2024-01-24T10:00:00.000Z", | ||
"revision_history": [ | ||
{ | ||
"date": "2024-01-24T10:00:00.000Z", | ||
"number": "1", | ||
"summary": "Initial version." | ||
} | ||
], | ||
"status": "final", | ||
"version": "1" | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-41-02.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json", | ||
"document": { | ||
"category": "csaf_base", | ||
"csaf_version": "2.1", | ||
"distribution": { | ||
"sharing_group": { | ||
"id": "00000000-0000-0000-0000-000000000000", | ||
"name": "No sharing allowed" | ||
}, | ||
"tlp": { | ||
"label": "CLEAR" | ||
} | ||
}, | ||
"publisher": { | ||
"category": "other", | ||
"name": "OASIS CSAF TC", | ||
"namespace": "https://csaf.io" | ||
}, | ||
"title": "Mandatory test: Public Sharing Group with no Max UUID (failing example 2)", | ||
"tracking": { | ||
"current_release_date": "2024-01-24T10:00:00.000Z", | ||
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-41-02", | ||
"initial_release_date": "2024-01-24T10:00:00.000Z", | ||
"revision_history": [ | ||
{ | ||
"date": "2024-01-24T10:00:00.000Z", | ||
"number": "1", | ||
"summary": "Initial version." | ||
} | ||
], | ||
"status": "final", | ||
"version": "1" | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-41-11.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json", | ||
"document": { | ||
"category": "csaf_base", | ||
"csaf_version": "2.1", | ||
"distribution": { | ||
"sharing_group": { | ||
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff", | ||
"name": "Public" | ||
}, | ||
"tlp": { | ||
"label": "CLEAR" | ||
} | ||
}, | ||
"publisher": { | ||
"category": "other", | ||
"name": "OASIS CSAF TC", | ||
"namespace": "https://csaf.io" | ||
}, | ||
"title": "Mandatory test: Public Sharing Group with no Max UUID (valid example 1)", | ||
"tracking": { | ||
"current_release_date": "2024-01-24T10:00:00.000Z", | ||
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-41-11", | ||
"initial_release_date": "2024-01-24T10:00:00.000Z", | ||
"revision_history": [ | ||
{ | ||
"date": "2024-01-24T10:00:00.000Z", | ||
"number": "1", | ||
"summary": "Initial version." | ||
} | ||
], | ||
"status": "final", | ||
"version": "1" | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-41-12.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json", | ||
"document": { | ||
"category": "csaf_base", | ||
"csaf_version": "2.1", | ||
"distribution": { | ||
"sharing_group": { | ||
"id": "00000000-0000-0000-0000-000000000000", | ||
"name": "No sharing allowed" | ||
}, | ||
"tlp": { | ||
"label": "CLEAR" | ||
} | ||
}, | ||
"publisher": { | ||
"category": "other", | ||
"name": "OASIS CSAF TC", | ||
"namespace": "https://csaf.io" | ||
}, | ||
"title": "Mandatory test: Public Sharing Group with no Max UUID (valid example 2)", | ||
"tracking": { | ||
"current_release_date": "2024-01-24T10:00:00.000Z", | ||
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-41-12", | ||
"initial_release_date": "2024-01-24T10:00:00.000Z", | ||
"revision_history": [ | ||
{ | ||
"date": "2024-01-24T10:00:00.000Z", | ||
"number": "1", | ||
"summary": "Initial version." | ||
} | ||
], | ||
"status": "draft", | ||
"version": "1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters