Skip to content

peter-kwan/vulncheck-sdk-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

133 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VulnCheck Logo

⚠️ This SDK is deprecated

This version of the VulnCheck Go-SDK is deprecated. We recommend that you migrate to sdk-go-v2.

The VulnCheck SDK For Go

Bring the VulnCheck API to your Go applications.

Release Go Report Card Go Reference Lint Tests PRs Welcome

Installation

go get github.com/vulncheck-oss/sdk-go

Examples

Connecting to the API

package main

import (
 "fmt"
 "github.com/vulncheck-oss/sdk-go"
)

func main() {
    client := sdk.Connect("https://api.vulncheck.com", "vulncheck_token")
    fmt.Println(client.GetUrl())
}

Available Methods

PURL

response, err := client.GetPurl("pkg:hex/coherence@0.1.2")

if err != nil {
    panic(err)
}

fmt.Println(response.GetData())

CPE

response, err := client.GetCpe("cpe:/a:microsoft:internet_explorer:8.0.6001:beta")

if err != nil {
    panic(err)
}

fmt.Println(response.GetData())

BACKUP

response, err := client.GetIndexBackup("initial-access")

if err != nil {
    panic(err)
}

fmt.Println(response.GetData())

INDICES

response, err := client.GetIndices()

if err != nil {
    panic(err)
}

fmt.Println(response.GetData())

INDEX

queryParams := sdk.IndexQueryParameters{}

response, err := client.GetIndex("a10", queryParams)

if err != nil {
    panic(err)
}

fmt.Println(response.GetData())

INDEX (looking up a CVE in the vulncheck-nvd2 index)

response, err := client.GetIndexVulncheckNvd2(
    sdk.IndexQueryParameters{
        Cve: "CVE-2019-19781",
    }
)

if err != nil {
    return err
}

description := (*response.Data[0].Descriptions)[0].Value
cvssBaseScore := (*response.Data[0].Metrics.CvssMetricV31)[0].CvssData.BaseScore

Cursor INDEX

queryParams := sdk.IndexQueryParameters{}

response, err := client.GetCursorIndex("vulncheck-nvd2", "cursor_string", queryParams)

if err != nil {
    panic(err)
}

fmt.Println(response.GetData())

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

If you discover any security related issues, please use issue tracker.

Sponsorship

Development of this package is sponsored by VulnCheck learn more about us!

License

Apache License 2.0. Please see License File for more information.

About

Bring the VulnCheck API to your Go applications.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 100.0%