Commit 80d6772
authored
Tests 6.1.4 through 6.1.7 (#42)
* Update CSAF schema 2.1, add support for handling notes
Introduced `NoteTrait` and `WithGroupIds` traits, extending functionality to handle notes and group IDs across CSAF structures. Updated relevant getter implementations for compatibility with these enhancements.
* Add validation for undefined product_group_id in CSAF documents
This adds a new validation function, `test_6_1_04_missing_definition_of_product_group_id`, to ensure all product group IDs used in notes, vulnerabilities, remediations, threats, and flags are defined in the product tree.
* Add validation for duplicate product group IDs (test_6_1_05)
Introduce a new validation to detect multiple definitions of the same product group ID in CSAF documents. This ensures data integrity by identifying conflicts within the `product_tree` structure. Includes corresponding unit tests for CSAF 2.0 and 2.1 versions.
* Add validation for conflicting remediation, minor cleanup
Extended the test to include a case where a product listed as fixed has a conflicting remediation category of "no_fix_planned". Ensures better coverage and accuracy in remediation validation logic.
* Update RFC3339 regex to disallow leap seconds
Revised the date-time validation regex to exclude leap seconds, ensuring stricter compliance with RFC3339. Updated test cases and error messages to reflect the change and improve clarity for non-compliant date-time issues.
* Add validation for conflicting product status groups.
This commit introduces `test_6_1_06_contradicting_product_status` to verify that no product has contradictory status groups (e.g., affected vs. not affected). Includes error handling, tests, and updates to the module index.
* Add support for accessing CVSS, EPSS, and content paths in traits
Expanded `ContentTrait` and related implementations to include methods for accessing CVSS v2/v3/v4, EPSS, and JSON content paths. Updated CSAF 2.0 and 2.1 schema integrations with new fields and improved consistency in metrics handling.
* Add validation for duplicate vulnerability metrics check
Introduced a new validation test (test_6_1_07) to ensure no product is assigned the same type of vulnerability metric multiple times. This includes support for various metrics like CVSS and EPSS, with detailed error handling and unit tests for CSAF 2.1 compliance.
* Add support for CSAF 2.0 tests in test_6_1_07 validation.
This update introduces `run_csaf20_tests` to validate CSAF 2.0 cases alongside CSAF 2.1. Common path prefixes are refactored for clarity and reuse, ensuring consistent test implementation across versions.
* Update CSAF schema enforcing stricter validation rules
Replaced JSON schema reference and file name for CSAF v2.1. Introduced `additionalProperties: false` across the schema to ensure no extraneous fields are allowed. Added new fields such as `first_known_exploitation_dates`, `license_expression`, and others. Updated deserialization logic with `deny_unknown_fields` to improve validation rigor.
* Add `get_source` method to traits and fixed validation 6.1.7
Introduced the `get_source` method in relevant traits and implementations to access the source of vulnerability metrics. Enhanced the duplicate metric validation logic to account for sources, updating error messages to reflect source details.1 parent d00216e commit 80d6772
File tree
16 files changed
+2326
-249
lines changed- csaf-lib
- src/csaf
- csaf2_0
- csaf2_1
- validations
16 files changed
+2326
-249
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
9 | 16 | | |
10 | 17 | | |
11 | 18 | | |
| |||
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| |||
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
77 | | - | |
78 | | - | |
| 85 | + | |
| 86 | + | |
79 | 87 | | |
80 | | - | |
81 | 88 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
95 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
96 | 106 | | |
97 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
98 | 145 | | |
99 | 146 | | |
100 | 147 | | |
| |||
112 | 159 | | |
113 | 160 | | |
114 | 161 | | |
115 | | - | |
| 162 | + | |
116 | 163 | | |
117 | 164 | | |
118 | 165 | | |
119 | 166 | | |
| 167 | + | |
120 | 168 | | |
121 | 169 | | |
122 | 170 | | |
| |||
126 | 174 | | |
127 | 175 | | |
128 | 176 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 177 | + | |
| 178 | + | |
132 | 179 | | |
133 | 180 | | |
134 | 181 | | |
| |||
154 | 201 | | |
155 | 202 | | |
156 | 203 | | |
| 204 | + | |
157 | 205 | | |
158 | 206 | | |
159 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
160 | 212 | | |
161 | 213 | | |
162 | 214 | | |
| |||
169 | 221 | | |
170 | 222 | | |
171 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
172 | 230 | | |
173 | 231 | | |
174 | 232 | | |
| |||
202 | 260 | | |
203 | 261 | | |
204 | 262 | | |
| 263 | + | |
205 | 264 | | |
206 | 265 | | |
207 | 266 | | |
| |||
222 | 281 | | |
223 | 282 | | |
224 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
225 | 288 | | |
226 | 289 | | |
227 | 290 | | |
| |||
249 | 312 | | |
250 | 313 | | |
251 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
252 | 323 | | |
253 | 324 | | |
254 | 325 | | |
| |||
0 commit comments