@csaf-rs/ssvc 0.4.0 → 0.4.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 +12 -49
- package/package.json +1 -1
- package/ssvc_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -1,71 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @csaf-rs/ssvc
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A WebAssembly build of the **SSVC (Stakeholder-Specific Vulnerability Categorization)** Rust implementation, for use with JavaScript/TypeScript.
|
|
4
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
5
|
Learn more at the [official SSVC documentation](https://certcc.github.io/SSVC/).
|
|
6
6
|
|
|
7
|
+
For the Rust crate, source code, and full project documentation, see the [csaf-rs/ssvc on GitHub](https://github.com/csaf-rs/ssvc).
|
|
8
|
+
|
|
7
9
|
## Features
|
|
8
10
|
|
|
9
|
-
This
|
|
10
|
-
It features full serde support. The library supports both native Rust usage and WebAssembly (WASM) bindings for JavaScript/web applications.
|
|
11
|
+
This package provides validation and processing of SSVC decision points and selection lists, with support for SSVC namespaces and extensions.
|
|
11
12
|
|
|
12
13
|
## Installation
|
|
13
14
|
|
|
14
|
-
Add to your project:
|
|
15
|
-
|
|
16
15
|
```bash
|
|
17
|
-
|
|
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
|
-
}
|
|
16
|
+
npm install @csaf-rs/ssvc
|
|
47
17
|
```
|
|
48
18
|
|
|
49
|
-
|
|
19
|
+
## Usage
|
|
50
20
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
# Install wasm-pack if you haven't already
|
|
55
|
-
cargo install wasm-pack
|
|
56
|
-
# Build for web
|
|
57
|
-
wasm-pack build --target web --out-dir pkg -- --features wasm
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
#### Usage
|
|
21
|
+
The WASM module must be initialized once before its functions can be used:
|
|
61
22
|
|
|
62
23
|
```javascript
|
|
63
|
-
import
|
|
24
|
+
import init, { validateSelectionList } from '@csaf-rs/ssvc';
|
|
25
|
+
|
|
26
|
+
await init();
|
|
64
27
|
|
|
65
28
|
const jsonData = {...}; // Your SSVC selection list
|
|
66
29
|
|
|
67
30
|
try {
|
|
68
|
-
const result =
|
|
31
|
+
const result = validateSelectionList(JSON.stringify(jsonData), false);
|
|
69
32
|
if (result.success) {
|
|
70
33
|
console.log("Valid SSVC data");
|
|
71
34
|
} else {
|
package/package.json
CHANGED
package/ssvc_bg.wasm
CHANGED
|
Binary file
|