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 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
tschmidtb51 committed Nov 18, 2024
1 parent 71bbbd2 commit 077fc24
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 1 deletion.
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.
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"
}
}
}
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"
}
}
}
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"
}
}
}
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"
}
}
}
24 changes: 24 additions & 0 deletions csaf_2.1/test/validator/data/testcases.json
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,30 @@
}
]
},
{
"id": "6.1.41",
"group": "mandatory",
"failures": [
{
"name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-41-01.json",
"valid": false
},
{
"name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-41-02.json",
"valid": false
}
],
"valid": [
{
"name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-41-11.json",
"valid": true
},
{
"name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-41-12.json",
"valid": true
}
]
},
{
"id": "6.2.1",
"group": "optional",
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)|(1\\.2[8-9])|(1\\.27\\.([1-9]|10|11))|(1\\.3[0-69])|(1\\.4[0]))$"
"pattern": "^6\\.(([1-3]\\.[1-9])|(1\\.10)|([12]\\.1[1-9])|(3\\.1[0-2])|([12]\\.2[0-6])|(2\\.27)|(1\\.2[8-9])|(1\\.27\\.([1-9]|10|11))|(1\\.3[0-69])|(1\\.4[0-1]))$"
},
"valid": {
"title": "List of valid examples",
Expand Down

0 comments on commit 077fc24

Please sign in to comment.