ossindex.model

Module Contents

Classes

Vulnerability

Model class that represents a Vulnerability as received back from OSS Index.

OssIndexComponent

Model class that represents a Component Report as received back from OSS Index.

class ossindex.model.Vulnerability(*, id_: str, display_name: str, title: str, description: str, cvss_score: Optional[float] = None, cvss_vector: Optional[str] = None, cve: Optional[str] = None, cwe: Optional[str] = None, version_ranges: Optional[Iterable[str]] = None, reference: str, external_references: Optional[Iterable[str]] = None)[source]

Model class that represents a Vulnerability as received back from OSS Index.

property id str[source]

OSS Index’s unique UUID for this Vulnerability.

Returns:

str

property display_name str[source]

displayName returned by OSS Index

Returns:

str

property title str[source]

title returned by OSS Index

Returns:

str

property description str[source]

description returned by OSS Index.

Returns:

str

property cvss_score Optional[float][source]

CVSS Score returned from OSS Index.

Returns:

float if set else None

property cvss_vector Optional[str][source]

CVSS Vector returned from OSS Index

Returns:

str if set else None

property cwe Optional[str][source]

CWE returned from OSS Index.

Returns:

str if set else None

property cve Optional[str][source]

CVE returned from OSS Index.

Returns:

str if set else None

property reference str[source]

Reference URL to OSS Index for this Vulnerability.

Returns:

str

property version_ranges Set[str][source]

Range of versions which are impacted by this Vulnerability.

Returns:

Set of str

property external_references Set[str][source]

List of external references that provide additional information about the vulnerability.

Returns:

Set of str

__eq__(other: object) bool[source]

Return self==value.

__hash__() int[source]

Return hash(self).

__repr__() str[source]

Return repr(self).

class ossindex.model.OssIndexComponent(*, coordinates: str, description: Optional[str] = None, reference: str, vulnerabilities: Optional[Iterable[Vulnerability]] = None)[source]

Model class that represents a Component Report as received back from OSS Index.

property coordinates str[source]

PackageURL formatted coordinates of this Component.

Returns:

str

property description Optional[str][source]

Description of the Component from OSS Index.

Returns:

str if set else None

property reference str[source]

URL to this Component on OSS Index.

Returns:

str

property vulnerabilities Set[Vulnerability][source]

Known vulnerabilities that relate to this Component.

Returns:

Set of Vulnerability

__eq__(other: object) bool[source]

Return self==value.

__hash__() int[source]

Return hash(self).

__repr__() str[source]

Return repr(self).

get_package_url() packageurl.PackageURL[source]

Get a PURL representation of this components coordinates.

Returns:

PackageURL

get_max_cvss_score() float[source]

Get the maximum CVSS Score across all Vulnerabilities known for this Component.

Returns:

float

static _reduce_on_max_cvss_score(v: Vulnerability, current_max: float) float[source]