Skip to content

Commit 8e19dc4

Browse files
committed
SSVC
- addresses parts of #803 - add test 6.1.49 for inconsistent SSVC timestamp - add invalid examples - add valid examples
1 parent 789e037 commit 8e19dc4

10 files changed

+259
-81
lines changed

csaf_2.1/prose/edit/src/tests-01-mndtr-45-inconsistent-disclosure-date.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ The relevant path for this test is:
4141
]
4242
```
4343

44-
> The document is labeled `TLP:CLEAR` and in status `final` but the `disclosure_date` is newer than the date of newest item in the `revision_history`.
44+
> The document is labeled `TLP:CLEAR` and in status `final` but the `disclosure_date` is newer than the `date` of newest item in the `revision_history`.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
### Inconsistent SSVC Timestamp
2+
3+
For each vulnerability, it MUST be tested that the SSVC `timestamp` is earlier or equal to the `date` of the newest item of the `revision_history`
4+
if the document status is `final` or `interim`.
5+
As the timestamps might use different timezones, the sorting MUST take timezones into account.
6+
7+
The relevant path for this test is:
8+
9+
```
10+
/vulnerabilities[]/metrics[]/content/ssvc_v1/timestamp
11+
```
12+
13+
*Example 1 (which fails the test):*
14+
15+
```
16+
"document": {
17+
// ...
18+
"distribution": {
19+
"tlp": {
20+
"label": "CLEAR"
21+
}
22+
},
23+
// ...
24+
"tracking": {
25+
// ...
26+
"revision_history": [
27+
{
28+
"date": "2024-01-24T10:00:00.000Z",
29+
"number": "1",
30+
"summary": "Initial version."
31+
}
32+
],
33+
"status": "final",
34+
// ...
35+
}
36+
},
37+
"vulnerabilities": [
38+
{
39+
"cve": "CVE-1900-0001",
40+
"metrics": [
41+
{
42+
"content": {
43+
"ssvc_v1": {
44+
"id": "CVE-1900-0001",
45+
"schemaVersion": "1-0-1",
46+
"selections": [
47+
{
48+
"name": "Exploitation",
49+
"namespace": "ssvc",
50+
"values": [
51+
"Active"
52+
],
53+
"version": "1.1.0"
54+
}
55+
],
56+
"timestamp": "2024-07-13T10:00:00.000Z"
57+
}
58+
},
59+
// ...
60+
}
61+
]
62+
}
63+
]
64+
```
65+
66+
> The document is in status `final` but the SSVC `timestamp` is newer than the `date` of newest item in the `revision_history`.

csaf_2.1/prose/edit/src/tests-01-mndtr-49-prohibited-ssvc-decision-point-namespace.md

Lines changed: 0 additions & 54 deletions
This file was deleted.

csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-49-01.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"name": "OASIS CSAF TC",
1414
"namespace": "https://csaf.io"
1515
},
16-
"title": "Mandatory test: Prohibited SSVC Decision Point Namespace (failing example 1)",
16+
"title": "Mandatory test: Inconsistent SSVC Timestamp (failing example 1)",
1717
"tracking": {
1818
"current_release_date": "2024-01-24T10:00:00.000Z",
1919
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-49-01",
@@ -48,15 +48,15 @@
4848
"schemaVersion": "1-0-1",
4949
"selections": [
5050
{
51-
"name": "Mission Impact",
52-
"namespace": "SSVC",
51+
"name": "Exploitation",
52+
"namespace": "ssvc",
5353
"values": [
54-
"None"
54+
"Active"
5555
],
56-
"version": "1.0.0"
56+
"version": "1.1.0"
5757
}
5858
],
59-
"timestamp": "2024-01-24T10:00:00.000Z"
59+
"timestamp": "2024-07-13T10:00:00.000Z"
6060
}
6161
},
6262
"products": [

csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-49-02.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,25 @@
1313
"name": "OASIS CSAF TC",
1414
"namespace": "https://csaf.io"
1515
},
16-
"title": "Mandatory test: Prohibited SSVC Decision Point Namespace (failing example 2)",
16+
"title": "Mandatory test: Inconsistent SSVC Timestamp (failing example 2)",
1717
"tracking": {
18-
"current_release_date": "2024-01-24T10:00:00.000Z",
18+
"current_release_date": "2024-02-29T10:00:00.000Z",
1919
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-49-02",
2020
"initial_release_date": "2024-01-24T10:00:00.000Z",
2121
"revision_history": [
2222
{
2323
"date": "2024-01-24T10:00:00.000Z",
2424
"number": "1",
2525
"summary": "Initial version."
26+
},
27+
{
28+
"date": "2024-02-29T10:00:00.000Z",
29+
"number": "2",
30+
"summary": "Second version."
2631
}
2732
],
2833
"status": "final",
29-
"version": "1"
34+
"version": "2"
3035
}
3136
},
3237
"product_tree": {
@@ -48,15 +53,15 @@
4853
"schemaVersion": "1-0-1",
4954
"selections": [
5055
{
51-
"name": "Attack Complexity",
52-
"namespace": "CVSS",
56+
"name": "Exploitation",
57+
"namespace": "ssvc",
5358
"values": [
54-
"Low"
59+
"Public PoC"
5560
],
56-
"version": "3.0.1"
61+
"version": "1.1.0"
5762
}
5863
],
59-
"timestamp": "2024-01-24T10:00:00.000Z"
64+
"timestamp": "2024-02-28T14:30:00.000-20:00"
6065
}
6166
},
6267
"products": [
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
3+
"document": {
4+
"category": "csaf_base",
5+
"csaf_version": "2.1",
6+
"distribution": {
7+
"tlp": {
8+
"label": "CLEAR"
9+
}
10+
},
11+
"publisher": {
12+
"category": "other",
13+
"name": "OASIS CSAF TC",
14+
"namespace": "https://csaf.io"
15+
},
16+
"title": "Mandatory test: Inconsistent SSVC Timestamp (failing example 3)",
17+
"tracking": {
18+
"current_release_date": "2024-02-29T10:00:00.000Z",
19+
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-49-03",
20+
"initial_release_date": "2024-01-24T10:00:00.000Z",
21+
"revision_history": [
22+
{
23+
"date": "2024-01-24T10:00:00.000Z",
24+
"number": "1",
25+
"summary": "Initial version."
26+
},
27+
{
28+
"date": "2024-02-29T10:00:00.000Z",
29+
"number": "2",
30+
"summary": "Second version."
31+
}
32+
],
33+
"status": "final",
34+
"version": "2"
35+
}
36+
},
37+
"product_tree": {
38+
"full_product_names": [
39+
{
40+
"product_id": "CSAFPID-9080700",
41+
"name": "Product A"
42+
}
43+
]
44+
},
45+
"vulnerabilities": [
46+
{
47+
"cve": "CVE-1900-0001",
48+
"metrics": [
49+
{
50+
"content": {
51+
"ssvc_v1": {
52+
"id": "CVE-1900-0001",
53+
"schemaVersion": "1-0-1",
54+
"selections": [
55+
{
56+
"name": "Exploitation",
57+
"namespace": "ssvc",
58+
"values": [
59+
"Public PoC"
60+
],
61+
"version": "1.1.0"
62+
}
63+
],
64+
"timestamp": "2024-02-29T14:30:00.000+04:00"
65+
}
66+
},
67+
"products": [
68+
"CSAFPID-9080700"
69+
]
70+
}
71+
]
72+
}
73+
]
74+
}

csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-49-11.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"name": "OASIS CSAF TC",
1414
"namespace": "https://csaf.io"
1515
},
16-
"title": "Mandatory test: Prohibited SSVC Decision Point Namespace (valid example 1)",
16+
"title": "Mandatory test: Inconsistent SSVC Timestamp (valid example 1)",
1717
"tracking": {
1818
"current_release_date": "2024-01-24T10:00:00.000Z",
1919
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-49-11",
@@ -48,12 +48,12 @@
4848
"schemaVersion": "1-0-1",
4949
"selections": [
5050
{
51-
"name": "Mission Impact",
51+
"name": "Exploitation",
5252
"namespace": "ssvc",
5353
"values": [
54-
"None"
54+
"Active"
5555
],
56-
"version": "1.0.0"
56+
"version": "1.1.0"
5757
}
5858
],
5959
"timestamp": "2024-01-24T10:00:00.000Z"

csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-49-12.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,25 @@
1313
"name": "OASIS CSAF TC",
1414
"namespace": "https://csaf.io"
1515
},
16-
"title": "Mandatory test: Prohibited SSVC Decision Point Namespace (valid example 2)",
16+
"title": "Mandatory test: Inconsistent SSVC Timestamp (valid example 2)",
1717
"tracking": {
18-
"current_release_date": "2024-01-24T10:00:00.000Z",
18+
"current_release_date": "2024-02-29T10:00:00.000Z",
1919
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-49-12",
2020
"initial_release_date": "2024-01-24T10:00:00.000Z",
2121
"revision_history": [
2222
{
2323
"date": "2024-01-24T10:00:00.000Z",
2424
"number": "1",
2525
"summary": "Initial version."
26+
},
27+
{
28+
"date": "2024-02-29T10:00:00.000Z",
29+
"number": "2",
30+
"summary": "Second version."
2631
}
2732
],
2833
"status": "final",
29-
"version": "1"
34+
"version": "2"
3035
}
3136
},
3237
"product_tree": {
@@ -48,15 +53,15 @@
4853
"schemaVersion": "1-0-1",
4954
"selections": [
5055
{
51-
"name": "Attack Complexity",
52-
"namespace": "cvss",
56+
"name": "Exploitation",
57+
"namespace": "ssvc",
5358
"values": [
54-
"Low"
59+
"Public PoC"
5560
],
56-
"version": "3.0.1"
61+
"version": "1.1.0"
5762
}
5863
],
59-
"timestamp": "2024-01-24T10:00:00.000Z"
64+
"timestamp": "2024-02-28T14:30:00.000-19:00"
6065
}
6166
},
6267
"products": [

0 commit comments

Comments
 (0)