Clients¶
EUVD
¶
EUVD(
*,
base_url: str = BASE_URL,
timeout: float | None = None,
transport: Transport | None = None,
)
Client for the EU Vulnerability Database.
For example:
euvd = EUVD()
for vuln in euvd.latest():
print(vuln.id, vuln.base_score)
timeout is in seconds, 30 by default. Pass a transport to change
how requests are made. A transport sets its own timeout, so passing both
raises ValueError.
The client can be used in a with block, which closes the transport at
the end. The built-in transport holds nothing open, so this is optional.
get_json
¶
get_json(
path: str, params: Mapping[str, str] | None = None
) -> Any
Call any API path and return the decoded JSON.
Use it for endpoints this library does not cover.
latest_exploited
¶
latest_exploited() -> list[Vulnerability]
The API's list of latest exploited entries. It holds at most 8.
latest_critical
¶
latest_critical() -> list[Vulnerability]
The API's list of latest critical entries. It holds at most 8.
search
¶
search(
*,
page: int = 0,
size: int = 10,
**filters: Unpack[SearchFilters],
) -> Page
Fetch one page of search results. Pages start at 0, size is at most 100.
Filters, all optional: text, product, vendor, advisory,
assigner, exploited, and the ranges from_score/to_score,
from_epss/to_epss, from_date/to_date,
from_updated_date/to_updated_date and
from_kev_date/to_kev_date. See SearchFilters for details.
count
¶
count(**filters: Unpack[SearchFilters]) -> int
Return how many entries match the filters. Takes the same filters as search.
iter_search
¶
iter_search(
*,
size: int = MAX_PAGE_SIZE,
limit: int | None = None,
**filters: Unpack[SearchFilters],
) -> Iterator[Vulnerability]
Yield every search result, fetching pages as needed.
Takes the same filters as search. limit stops after that many
results. Without it, a broad search can return hundreds of thousands of
entries.
get_vulnerability
¶
get_vulnerability(id: str) -> VulnerabilityDetail
Fetch one entry by EUVD ID, or by another ID such as a CVE ID.
Raises NotFoundError if nothing matches.
get_advisory
¶
get_advisory(id: str) -> AdvisoryDetail
Fetch one advisory by ID. Raises NotFoundError if nothing matches.
cve_mapping
¶
cve_mapping() -> Generator[tuple[str, str], None, None]
Yield (euvd_id, cve_id) pairs for every entry linked to a CVE.
The download is large: several hundred thousand rows.
AsyncEUVD
¶
AsyncEUVD(
*,
base_url: str = BASE_URL,
timeout: float | None = None,
transport: AsyncTransport | Transport | None = None,
)
Async client for the EU Vulnerability Database.
It has the same methods as EUVD:
euvd = AsyncEUVD()
vuln = await euvd.get_vulnerability("CVE-2024-3400")
timeout is in seconds, 30 by default. The built-in transport runs each
request in a worker thread. Pass an AsyncTransport to use an async HTTP
library. A blocking Transport also works and runs in threads. A
transport sets its own timeout, so passing both raises ValueError.
The client can be used in an async with block, which closes the
transport at the end. The built-in transport holds nothing open, so this
is optional.
get_json
¶
get_json(
path: str, params: Mapping[str, str] | None = None
) -> Any
Call any API path and return the decoded JSON.
Use it for endpoints this library does not cover.
latest_exploited
¶
latest_exploited() -> list[Vulnerability]
The API's list of latest exploited entries. It holds at most 8.
latest_critical
¶
latest_critical() -> list[Vulnerability]
The API's list of latest critical entries. It holds at most 8.
search
¶
search(
*,
page: int = 0,
size: int = 10,
**filters: Unpack[SearchFilters],
) -> Page
Fetch one page of search results. Pages start at 0, size is at most 100.
Filters, all optional: text, product, vendor, advisory,
assigner, exploited, and the ranges from_score/to_score,
from_epss/to_epss, from_date/to_date,
from_updated_date/to_updated_date and
from_kev_date/to_kev_date. See SearchFilters for details.
count
¶
count(**filters: Unpack[SearchFilters]) -> int
Return how many entries match the filters. Takes the same filters as search.
iter_search
¶
iter_search(
*,
size: int = MAX_PAGE_SIZE,
limit: int | None = None,
**filters: Unpack[SearchFilters],
) -> AsyncIterator[Vulnerability]
Yield every search result, fetching pages as needed.
Takes the same filters as search. limit stops after that many
results. Without it, a broad search can return hundreds of thousands of
entries.
get_vulnerability
¶
get_vulnerability(id: str) -> VulnerabilityDetail
Fetch one entry by EUVD ID, or by another ID such as a CVE ID.
Raises NotFoundError if nothing matches.
get_advisory
¶
get_advisory(id: str) -> AdvisoryDetail
Fetch one advisory by ID. Raises NotFoundError if nothing matches.
cve_mapping
¶
cve_mapping() -> AsyncGenerator[tuple[str, str], None]
Yield (euvd_id, cve_id) pairs for every entry linked to a CVE.
The download is large: several hundred thousand rows.
SearchFilters
¶
Filters accepted by search and iter_search. All are optional.
product
¶
product: str
Words from the product name. Each must start a word in the name, in any order.
This is not an exact match: Win finds "Windows", and a two-letter word
next to others is ignored, so PAN-OS matches like PAN.
from_kev_date
¶
from_kev_date: date | str
Earliest date the entry was added to a Known Exploited Vulnerabilities list.
to_kev_date
¶
to_kev_date: date | str
Latest date the entry was added to a Known Exploited Vulnerabilities list.