Skip to content

Commit

Permalink
Sharing Groups
Browse files Browse the repository at this point in the history
- addresses parts of oasis-tcs#705
- add optional test to discourage usage sharing group with TLP:CLEAR
- add invalid example
- add valid examples
- adapt testcases list and schema
  • Loading branch information
tschmidtb51 committed Nov 18, 2024
1 parent 025eed0 commit cc06295
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 1 deletion.
26 changes: 26 additions & 0 deletions csaf_2.1/prose/edit/src/tests-02-optional.md
Original file line number Diff line number Diff line change
Expand Up @@ -887,3 +887,29 @@ The relevant path for this test is:
```
> The sharing group id uses the Nil UUID.
### Usage of Sharing Group on TLP:CLEAR
It MUST be tested that no sharing group is used if the document is `TLP:CLEAR`.
The relevant path for this test is:
```
/document/distribution/sharing_group
```
*Example 1 (which fails the test):*
```
"distribution": {
"sharing_group": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"name": "Public"
},
"tlp": {
"label": "CLEAR"
}
},
```
> The CSAF document is `TLP:CLEAR` but a sharing group is given.
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": "Optional test: Usage of Sharing Group on TLP:CLEAR (failing example 1)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-30-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"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Optional test: Usage of Sharing Group on TLP:CLEAR (valid example 1)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-30-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"
}
}
}
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": "86c81730-1a06-478d-82d4-978e41eb332f",
"name": "Example Sharing Group 1"
},
"tlp": {
"label": "RED"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Optional test: Usage of Sharing Group on TLP:CLEAR (valid example 2)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-30-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": "final",
"version": "1"
}
}
}
20 changes: 20 additions & 0 deletions csaf_2.1/test/validator/data/testcases.json
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,26 @@
}
]
},
{
"id": "6.2.30",
"group": "optional",
"failures": [
{
"name": "optional/oasis_csaf_tc-csaf_2_1-2024-6-2-30-01.json",
"valid": true
}
],
"valid": [
{
"name": "optional/oasis_csaf_tc-csaf_2_1-2024-6-2-30-11.json",
"valid": true
},
{
"name": "optional/oasis_csaf_tc-csaf_2_1-2024-6-2-30-12.json",
"valid": true
}
]
},
{
"id": "6.3.1",
"group": "informative",
Expand Down
2 changes: 1 addition & 1 deletion csaf_2.1/test/validator/testcases_json_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"title": "Number of the test",
"description": "Contains the section number of the test in the specification.",
"type": "string",
"pattern": "^6\\.(([1-3]\\.[1-9])|(1\\.10)|([12]\\.1[1-9])|(3\\.1[0-2])|([12]\\.2[0-6])|(2\\.27)|([12]\\.2[8-9])|(1\\.27\\.([1-9]|10|11))|(1\\.3[0-69])|(1\\.4[0-2]))$"
"pattern": "^6\\.(([1-3]\\.[1-9])|(1\\.10)|([12]\\.1[1-9])|(3\\.1[0-2])|([12]\\.2[0-6])|(2\\.27)|([12]\\.2[8-9])|(1\\.27\\.([1-9]|10|11))|(1\\.3[0-69])|(2\\.30)|(1\\.4[0-2]))$"
},
"valid": {
"title": "List of valid examples",
Expand Down

0 comments on commit cc06295

Please sign in to comment.