https://github.com/alilleybrinker/cwe-api
Rust implementation of a CWE API consumer.
https://github.com/alilleybrinker/cwe-api
cwe rust
Last synced: 9 months ago
JSON representation
Rust implementation of a CWE API consumer.
- Host: GitHub
- URL: https://github.com/alilleybrinker/cwe-api
- Owner: alilleybrinker
- License: mit
- Created: 2024-08-14T00:35:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-23T18:59:23.000Z (over 1 year ago)
- Last Synced: 2025-02-14T01:51:46.217Z (11 months ago)
- Topics: cwe, rust
- Language: Rust
- Homepage: https://docs.rs/cwe-api
- Size: 87.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `cwe-api`
[][license]
This is a crate for convenient use of the [Common Weakness Enumeration (CWE)
API][cwe_api]. This is __not__ an official crate produced by the CWE program.
The code in this crate is generated using [Progenitor][progenitor], based on
the published [CWE OpenAPI specification][cwe_openapi].
## Packages
This repository includes two Rust crates:
- `cwe-api`: a library crate for accessing the CWE API.
- `cwe-api-cli`: a binary crate that provides a CLI for accessing the CWE API.
## Installing the CLI
```sh
$ git clone https://github.com/alilleybrinker/cwe-api.git
$ cd cwe-api
$ cargo install --path cwe-api-cli
```
This requires `git` and a [Rust toolchain installation][rust_install].
## CLI Example
```sh
$ cwe-api cwe info 230
[
{
"ID": "230",
"Type": "variant_weakness"
}
]
$ cwe-api cwe parents 230
[
{
"ID": "229",
"Primary_Parent": true,
"Type": "base_weakness",
"ViewID": "1000"
},
{
"ID": "1407",
"Type": "category",
"ViewID": "1400"
},
{
"ID": "851",
"Type": "category",
"ViewID": "844"
},
{
"ID": "993",
"Type": "category",
"ViewID": "888"
}
]
```
## License
The code is licensed under the MIT license. You can view the full contents
in the [LICENSE][license] file.
[cwe_api]: https://github.com/CWE-CAPEC/REST-API-wg/blob/main/Quick%20Start.md
[cwe_openapi]: https://github.com/CWE-CAPEC/REST-API-wg/blob/main/openapi.json
[progenitor]: https://github.com/oxidecomputer/progenitor
[license]: https://github.com/alilleybrinker/cwe-api/blob/main/LICENSE
[rust_install]: https://www.rust-lang.org/tools/install