@csaf-rs/ssvc 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -4
- package/package.json +6 -5
- package/ssvc_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -1,11 +1,81 @@
|
|
|
1
|
-
#
|
|
2
|
-
Implementation of the SSVC specification in Rust
|
|
1
|
+
# SSVC Rust Implementation
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
A Rust implementation of the **SSVC (Stakeholder-Specific Vulnerability Categorization)** specification.
|
|
4
|
+
SSVC is a framework for prioritizing software vulnerability remediation efforts. It helps stakeholders make informed decisions about which vulnerabilities to address first by considering factors like vulnerability severity, the stakeholder's position in the ecosystem, and their specific constraints.
|
|
5
|
+
Learn more at the [official SSVC documentation](https://certcc.github.io/SSVC/).
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
## Features
|
|
7
8
|
|
|
9
|
+
This library provides validation and processing of SSVC decision points and selection lists, with support for SSVC namespaces and extensions.
|
|
10
|
+
It features full serde support. The library supports both native Rust usage and WebAssembly (WASM) bindings for JavaScript/web applications.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
Add to your project:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cargo add ssvc
|
|
8
18
|
```
|
|
19
|
+
|
|
20
|
+
## MSRV
|
|
21
|
+
|
|
22
|
+
1.85.0
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
### Rust
|
|
27
|
+
|
|
28
|
+
```rust
|
|
29
|
+
use ssvc::selection_list::SelectionList;
|
|
30
|
+
use ssvc::validate_selection_list;
|
|
31
|
+
|
|
32
|
+
let json_data = "..."; // Your SSVC selection list
|
|
33
|
+
|
|
34
|
+
let selection_list: SelectionList =
|
|
35
|
+
serde_json::from_str(json_data).expect("SSVC SelectionList was invalid JSON");
|
|
36
|
+
|
|
37
|
+
// Validate the selection list
|
|
38
|
+
let result = validate_selection_list(&selection_list, false);
|
|
39
|
+
|
|
40
|
+
if result.success {
|
|
41
|
+
println!("Selection list is valid!");
|
|
42
|
+
} else {
|
|
43
|
+
for error in result.errors {
|
|
44
|
+
println!("Validation error: {}", error.message);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### WebAssembly
|
|
50
|
+
|
|
51
|
+
#### Build
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Install wasm-pack if you haven't already
|
|
9
55
|
cargo install wasm-pack
|
|
56
|
+
# Build for web
|
|
10
57
|
wasm-pack build --target web --out-dir pkg -- --features wasm
|
|
11
58
|
```
|
|
59
|
+
|
|
60
|
+
#### Usage
|
|
61
|
+
|
|
62
|
+
```javascript
|
|
63
|
+
import * as wasm from './pkg/ssvc.js';
|
|
64
|
+
|
|
65
|
+
const jsonData = {...}; // Your SSVC selection list
|
|
66
|
+
|
|
67
|
+
try {
|
|
68
|
+
const result = wasm.validateSelectionList(JSON.stringify(jsonData), false);
|
|
69
|
+
if (result.success) {
|
|
70
|
+
console.log("Valid SSVC data");
|
|
71
|
+
} else {
|
|
72
|
+
console.log("Validation errors:", result.errors);
|
|
73
|
+
}
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.error("Error:", error);
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) file for details.
|
package/package.json
CHANGED
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
"name": "@csaf-rs/ssvc",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "Implementation of the SSVC specification in Rust",
|
|
5
|
-
"version": "0.1
|
|
5
|
+
"version": "0.2.1",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/csaf-rs/ssvc"
|
|
10
|
+
},
|
|
7
11
|
"files": [
|
|
8
12
|
"ssvc_bg.wasm",
|
|
9
13
|
"ssvc.js",
|
|
@@ -11,10 +15,7 @@
|
|
|
11
15
|
],
|
|
12
16
|
"main": "ssvc.js",
|
|
13
17
|
"types": "ssvc.d.ts",
|
|
14
|
-
"publishConfig": {
|
|
15
|
-
"access": "public"
|
|
16
|
-
},
|
|
17
18
|
"sideEffects": [
|
|
18
19
|
"./snippets/*"
|
|
19
20
|
]
|
|
20
|
-
}
|
|
21
|
+
}
|
package/ssvc_bg.wasm
CHANGED
|
Binary file
|