Skip to content

Latest commit

 

History

History
76 lines (61 loc) · 1.69 KB

README.md

File metadata and controls

76 lines (61 loc) · 1.69 KB

cwe-api

License: MIT

This is a crate for convenient use of the Common Weakness Enumeration (CWE) API. This is not an official crate produced by the CWE program.

The code in this crate is generated using Progenitor, based on the published CWE OpenAPI specification.

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

$ 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.

CLI Example

$ 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 file.