Go back

Bring VulnCheck Intelligence to Your Python and Go Apps with Our New SDKs

avatar
EJ Reillyin/ej-reilly/

At VulnCheck, we continue to expand access to our exploit intelligence. Following the success of our CLI tool, which brings powerful command-line capabilities to security teams, we’re now taking a step further by introducing VulnCheck SDKs for Python and Go. These SDKs empower developers to seamlessly integrate VulnCheck’s intelligence into their applications, automate vulnerability checks, and explore data in ways that best fit their development environment.

Code VulnCheck into Your Python and Go Applications Faster

With the VulnCheck SDKs for Python and Go, integrating vulnerability intelligence into your projects becomes effortless. These SDKs abstract away the complexities of directly interacting with the VulnCheck API, providing pre-built functions and classes for common tasks, so you don’t have to manually write HTTP requests or parse JSON.

Example: Integrating VulnCheck into Your Python Code

Python
import vulncheck_sdk

# First let's setup a few variables to help us
DEFAULT_HOST = "https://api.vulncheck.com"
DEFAULT_API = DEFAULT_HOST + "/v3"
TOKEN = os.environ["VULNCHECK_API_TOKEN"] # Remember to store your token securely!

# Now let's create a configuration object
configuration = vulncheck_sdk.Configuration(host=DEFAULT_API)
configuration.api_key["Bearer"] = TOKEN

# Pass that config object to our API client and now...
with vulncheck_sdk.ApiClient(configuration) as api_client:
    # We can use two classes to explore the VulnCheck API: EndpointsApi & IndicesApi

    ### EndpointsApi has methods to query every endpoint except `/v3/index`
    # See the full list of endpoints here: https://docs.vulncheck.com/api
    endpoints_client = vulncheck_sdk.EndpointsApi(api_client)

    # CPE
    cpe = "cpe:/a:microsoft:internet_explorer:8.0.6001:beta"
    api_response = endpoints_client.cpe_get(cpe)
    for cve in api_response.data:
        print(cve)

    ### IndicesApi has methods for each index
    indices_client = vulncheck_sdk.IndicesApi(api_client)

    # VulnCheck NVD
    query_params = vulncheck_sdk.ParamsIdxReqParams(cve="CVE-2019-19781")
    api_response = indices_client.index_vulncheck_nvd2_get(query_params)

    print(api_response.data)

With just a few lines of code, you're able to connect to the VulnCheck API, retrieve Vulnerability, Exploit and IP Intelligence, and accelerate your security projects. This reduces development time and lets you focus on the core functionality of your application or automations.

Pre-built Functions for Common Tasks

One of the best parts of using the VulnCheck SDK is that it comes packed with pre-built functions for accessing VulnCheck Intelligence. For instance, say you’re managing dependencies in a Python project and want to quickly check which vulnerabilities are associated with a particular PURL. The VulnCheck SDK for Python allows you to do this in just a few lines of code:

Python
import vulncheck_sdk
from vulncheck_sdk.models.v3controllers_purl_response_data import (
    V3controllersPurlResponseData,
)

DEFAULT_HOST = "https://api.vulncheck.com"
DEFAULT_API = DEFAULT_HOST + "/v3"
TOKEN = os.environ["VULNCHECK_API_TOKEN"]

configuration = vulncheck_sdk.Configuration(host=DEFAULT_API)
configuration.api_key["Bearer"] = TOKEN

with vulncheck_sdk.ApiClient(configuration) as api_client:
    endpoints_client = vulncheck_sdk.EndpointsApi(api_client)

    purl = "pkg:hex/coherence@0.1.2"

    api_response = endpoints_client.purl_get(purl)
    data: V3controllersPurlResponseData = api_response.data

    print(data.cves)

This example shows how easy it is to lookup the CVE’s for a given PURL using the already provided methods. The SDK takes care of handling the request and parsing the response into a Python object that you can easily explore.

Explore and Visualize Data w/ Jupyter Notebook

But VulnCheck isn’t just for applications, it can also help identify trends in security and guide decision-making. The VulnCheck SDK for Python integrates seamlessly with Jupyter Notebooks, allowing data scientists, developers and security analysts to explore and visualize data interactively. This is especially useful for investigating patterns across vulnerabilities, such as botnet-related CVEs.

Imagine you want to analyze botnet-related vulnerabilities. Here’s how you can pull data from the VulnCheck API and visualize it with Python's matplotlib and pandas libraries:

Botnets Jupyter Notebook

This approach is perfect for interactive data exploration and quickly uncovering trends, such as which botnets are associated with the most vulnerabilities.

Learn more about VulnCheck’s new SDKs & Jupyter Notebook Integration

Go SDK on Github | Go SDK Docs | Python SDK on Github | Python SDK Docs | Jupyter Notebook

About VulnCheck

VulnCheck is helping organizations not just to solve the vulnerability prioritization challenge - we’re working to help equip any product manager, CSIRT/PSIRT or SecOps team and Threat Hunting team to get faster and more accurate with infinite efficiency using VulnCheck solutions.

We knew that we needed better data, faster across the board, in our industry. So that’s what we deliver to the market. We’re going to continue to deliver key insights on vulnerability management, exploitation and major trends we can extrapolate from our dataset to continuously support practitioners.

Are you interested in learning more? If so, VulnCheck's Exploit & Vulnerability Intelligence has broad threat actor coverage. Register and demo our data today.