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 enforce usage of sharing group names
- add invalid examples
- add valid examples
- adapt testcases list and schema
  • Loading branch information
tschmidtb51 committed Nov 18, 2024
1 parent 3487dad commit dcee34c
Show file tree
Hide file tree
Showing 9 changed files with 269 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### Missing Sharing Group Name

It MUST be tested that the sharing group name exists and equals the predefined reserved value from section [#cite](document-property---distribution---sharing-group) if the precondition is fulfilled.

The relevant path for this test is:

```
/document/distribution/sharing_group/name
```

*Example 1 (which fails the test):*

```
"distribution": {
"sharing_group": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
// ...
},
```

> The Max UUID is used but the sharing group name does not exist.
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": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Missing Sharing Group Name (failing example 1)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-42-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,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": "00000000-0000-0000-0000-000000000000"
},
"tlp": {
"label": "RED"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Missing Sharing Group Name (failing example 2)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-42-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": "No sharing restrictions"
},
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Missing Sharing Group Name (failing example 3)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-42-03",
"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": "Releasable to OASIS CSAF TC member organizations"
},
"tlp": {
"label": "AMBER"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Missing Sharing Group Name (failing example 4)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-42-04",
"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"
}
}
}
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: Missing Sharing Group Name (valid example 1)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-42-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": "RED"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Missing Sharing Group Name (valid example 2)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-42-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"
}
}
}
32 changes: 32 additions & 0 deletions csaf_2.1/test/validator/data/testcases.json
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,38 @@
}
]
},
{
"id": "6.1.42",
"group": "mandatory",
"failures": [
{
"name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-42-01.json",
"valid": false
},
{
"name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-42-02.json",
"valid": false
},
{
"name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-42-03.json",
"valid": false
},
{
"name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-42-04.json",
"valid": false
}
],
"valid": [
{
"name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-42-11.json",
"valid": true
},
{
"name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-42-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-1]))$"
"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-2]))$"
},
"valid": {
"title": "List of valid examples",
Expand Down

0 comments on commit dcee34c

Please sign in to comment.