Skip to main content

A library for querying the OSS Index free catalogue of open source components to help developers identify vulnerabilities, understand risk, and keep their software safe.

Project description

Python Library for quering OSS Index

GitHub Workflow Status Python Version Support PyPI Version Documentation GitHub license GitHub issues GitHub forks GitHub stars


This OSSIndex module for Python provides a common interface to querying the OSS Index.

This module is not designed for standalone use. If you're looking for a tool that can detect your application's dependencies and assess them for vulnerabilities against the OSS Index, perhaps you should check out Jake.

You can of course use this library in your own applications.

Installation

Install from pypi.org as you would any other Python module:

pip install ossindex-lib

Usage

First create an instance of OssIndex, optionally enabling local caching

o = OssIndex()

Then supply a List of PackageURL objects that you want to ask OSS Index about. If you don't want to care about generating this list yourself, perhaps look to a tool like Jake (which uses this library) and will do all the hard work for you!

As a quick test, you could run:

o = OssIndex()
results: List[OssIndexComponent] = o.get_component_report(packages=[
    PackageURL.from_string(purl='pkg:pypi/pip@19.2.0')
])
for r in results:
    print("{}: {} known vulnerabilities".format(r.get_coordinates(), len(r.get_vulnerabilities())))
    v: Vulnerability
    for v in r.get_vulnerabilities():
        print('    - {}'.format(str(v)))

... which would output something like ...

pkg:pypi/pip@19.2.0: 1 known vulnerabilities
    - <Vulnerability id=e4c955a3-2004-472e-920b-783fea46c3cd, name=OSSINDEX-783f-ea46-c3cd, cvss_score=3.6>

Logging

This library send log events to a standard Python logger named ossindex. You can configure the logger to output as required through the standard Python logging configuration.

Todos

  1. Support authentication against OSS Index

Python Support

We endeavour to support all functionality for all current actively supported Python versions. However, some features may not be possible/present in older Python versions due to their lack of support.

Changelog

See our CHANGELOG.

The Fine Print

Remember:

It is worth noting that this is NOT SUPPORTED by Sonatype, and is a contribution of ours to the open source community (read: you!)

  • Use this contribution at the risk tolerance that you have
  • Do NOT file Sonatype support tickets related to ossindex-lib
  • DO file issues here on GitHub, so that the community can pitch in

Phew, that was easier than I thought. Last but not least of all - have fun!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ossindex-lib-1.0.0rc1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

ossindex_lib-1.0.0rc1-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file ossindex-lib-1.0.0rc1.tar.gz.

File metadata

  • Download URL: ossindex-lib-1.0.0rc1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ossindex-lib-1.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 5d18bf333d964f6809b4777d6be4ec980f761b4657601900fc7432432cacb333
MD5 de82a6e00b9c1da63807e64f49e2eb01
BLAKE2b-256 a6f33df52e623636aa65c1b3fc1a9ed594875d6a7d970c11e79366efb6db7cac

See more details on using hashes here.

Provenance

File details

Details for the file ossindex_lib-1.0.0rc1-py3-none-any.whl.

File metadata

  • Download URL: ossindex_lib-1.0.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ossindex_lib-1.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 da47c955b2ab302d8de68f75df33a193cb6dbb8577d9ee2f99bf7e36b8acd722
MD5 6665a2c50f60c99603215774020f8e2f
BLAKE2b-256 cb612c595bc7bdb6b333c53e232b460e09fd83ad4d2a0a456425e7f5b344f249

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page