cvesearch

Crates.iocvesearch
lib.rscvesearch
version0.1.1
sourcesrc
created_at2016-11-21 21:46:48.057396
updated_at2016-11-26 20:58:29.016423
descriptionProvides a client library for the CIRCL CVE Search
homepage
repositoryhttps://github.com/wisespace-io/cve-search
max_upload_size
id7329
size18,589
Flávio Oliveira (wisespace-io)

documentation

README

License

cve-search

Rust library for searching database of security vulnerabilities. The library uses the web service provided by CIRCL

Usage

Available on crates.io

Add this to your Cargo.toml

[dependencies]
cvesearch = "0.1"

Example

extern crate cvesearch;

use cvesearch::CVESearch;

fn main() {
    let cve = CVESearch::new();

    // All vulnerabilities on Apache ActiveMQ 
    let vuls = cve.search(String::from("apache"), String::from("activemq")).unwrap();
    let vuls_array = vuls.as_array().unwrap();
    for results in vuls_array.iter() {
        let obj = results.as_object().unwrap();
        println!("{} - {}", obj.get("id").unwrap(), obj.get("summary").unwrap());
    }

    // See details: https://cve.circl.lu/cve/CVE-2016-5284
    let vul = cve.get_cve("CVE-2016-5284".into()).unwrap();
    let vul_obj = vul.as_object().unwrap();
    println!("===> Summary {}", vul_obj.get("summary").unwrap());

    // DBInfo, example: last time vendors db has been updated
    let info = cve.db_info().unwrap();
    let obj = info.as_object().unwrap();
    println!("===> Vendors database updated at {}", obj.get("vendorU").unwrap());
}

License

Licensed under either of

Commit count: 9

cargo fmt