Resources¶
Each namespace on the client (v.search, v.audit, …) is a resource. The classes below are
the synchronous resources; the async client exposes an Async* mirror of each, with the
same non-iterator methods as awaitable coroutines. The auto-paginating streaming iterators are
renamed with an a prefix (aiter_query, aiter_collection) and are async generators consumed
with async for, not coroutines.
Search¶
vulners._resources._sync.search.Search
¶
Bases: BaseResource
Search the Vulners database.
Source code in src/vulners/_resources/_sync/_base.py
query
¶
query(query: str, *, limit: int = 20, offset: int = 0, fields: Sequence[str] | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> SearchPage[Bulletin]
Search using Lucene query syntax.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
A Vulners Lucene query (see https://vulners.com/help). |
required |
limit
|
int
|
Maximum number of documents to return in this page. |
20
|
offset
|
int
|
Number of documents to skip. |
0
|
fields
|
Sequence[str] | NotGiven
|
Restrict the returned fields. When omitted, the compact
:data: |
not_given
|
Returns:
| Type | Description |
|---|---|
SearchPage[Bulletin]
|
A cursor-aware :class: |
SearchPage[Bulletin]
|
|
SearchPage[Bulletin]
|
further pages up to the 10000-document window. |
Raises:
| Type | Description |
|---|---|
SearchWindowExceeded
|
|
Source code in src/vulners/_resources/_sync/search.py
iter_query
¶
iter_query(query: str, *, page_size: int = 100, fields: Sequence[str] | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> Iterator[Bulletin]
Iterate every matching :class:Bulletin, auto-paginating.
Fetches pages of page_size documents and yields their rows lazily,
stopping at the 10000-document search window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
A Vulners Lucene query (see https://vulners.com/help). |
required |
page_size
|
int
|
Number of documents to fetch per underlying page request. |
100
|
fields
|
Sequence[str] | NotGiven
|
Restrict the returned fields, as in :meth: |
not_given
|
Yields:
| Type | Description |
|---|---|
Bulletin
|
Each matching :class: |
Bulletin
|
up to the 10000-document search window. |
Source code in src/vulners/_resources/_sync/search.py
get_multiple_bulletins
¶
get_multiple_bulletins(ids: Sequence[str], *, fields: Sequence[str] | NotGiven = not_given, references: bool = False) -> dict[str, Bulletin]
Fetch several documents by id, keyed by id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ids
|
Sequence[str]
|
Document ids to fetch (e.g. |
required |
fields
|
Sequence[str] | NotGiven
|
Restrict the returned fields on each document; the server default projection is used when omitted. |
not_given
|
references
|
bool
|
When |
False
|
Returns:
| Type | Description |
|---|---|
dict[str, Bulletin]
|
A mapping of id to the family-specific :class: |
Source code in src/vulners/_resources/_sync/search.py
get_bulletin
¶
get_bulletin(id: str, *, fields: Sequence[str] | NotGiven = not_given) -> Bulletin | None
Fetch a single document by id, or None if it does not exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The document id to fetch (e.g. |
required |
fields
|
Sequence[str] | NotGiven
|
Restrict the returned fields; the server default projection is used when omitted. |
not_given
|
Returns:
| Type | Description |
|---|---|
Bulletin | None
|
The family-specific :class: |
Bulletin | None
|
matches |
Source code in src/vulners/_resources/_sync/search.py
exploits
¶
exploits(query: str, *, lucene: bool = False, limit: int = 20, offset: int = 0, fields: Sequence[str] | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> SearchPage[Bulletin]
Search for public exploits matching a query.
Restricts a Lucene search to the exploit bulletin family. A bare
CVE id (e.g. CVE-2021-44228) is phrase-quoted automatically so it
matches as a single token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
A CVE id, product name, or Lucene fragment. |
required |
lucene
|
bool
|
Treat |
False
|
limit
|
int
|
Maximum number of documents to return in this page. |
20
|
offset
|
int
|
Number of documents to skip. |
0
|
fields
|
Sequence[str] | NotGiven
|
Restrict the returned fields, as in :meth: |
not_given
|
Returns:
| Type | Description |
|---|---|
SearchPage[Bulletin]
|
A cursor-aware :class: |
Raises:
| Type | Description |
|---|---|
SearchWindowExceeded
|
|
Source code in src/vulners/_resources/_sync/search.py
collections
¶
List every collection available in Vulners.
Returns:
| Type | Description |
|---|---|
Any
|
A list of collection descriptors, each with |
Any
|
|
Source code in src/vulners/_resources/_sync/search.py
autocomplete
¶
autocomplete(query: str, *, timeout: float | Timeout | NotGiven = not_given) -> list[str | list[str]]
Return possible completions for a partial Lucene query.
Same endpoint as :meth:Misc.query_autocomplete.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
The partial Lucene query to complete. |
required |
Returns:
| Type | Description |
|---|---|
list[str | list[str]]
|
Ordered completions: each element is a completion string, or a |
list[str | list[str]]
|
|
Source code in src/vulners/_resources/_sync/search.py
suggest
¶
suggest(field_name: str, *, type: Literal['distinct'] = 'distinct', timeout: float | Timeout | NotGiven = not_given) -> Any
Return distinct value suggestions for a document field.
Same endpoint as :meth:Misc.get_suggestion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_name
|
str
|
The document field to suggest values for. |
required |
type
|
Literal['distinct']
|
Suggestion type; only |
'distinct'
|
Source code in src/vulners/_resources/_sync/search.py
cpe
¶
cpe(product: str, *, vendor: str | NotGiven = not_given, size: int | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> Any
Search for CPE strings matching a product (and optional vendor).
Same endpoint as :meth:Misc.search_cpe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product
|
str
|
Product string to search a CPE for. |
required |
vendor
|
str | NotGiven
|
Optional vendor to narrow the match. |
not_given
|
size
|
int | NotGiven
|
Maximum number of results (0..10000, |
not_given
|
Source code in src/vulners/_resources/_sync/search.py
web_vulns
¶
Return the Vulners web-application (burp) detection rule set.
Same endpoint as :meth:Misc.get_web_application_rules.
Returns:
| Type | Description |
|---|---|
Any
|
The web-application (burp) detection rule set: the software |
Any
|
signatures used to detect web applications and their known |
Any
|
vulnerabilities. |
Source code in src/vulners/_resources/_sync/search.py
Documents¶
vulners._resources._sync.documents.Documents
¶
Bases: BaseResource
Fetch Vulners documents (bulletins) by id.
Source code in src/vulners/_resources/_sync/_base.py
get
¶
get(id: str, *, references: bool = False, fields: Sequence[str] | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> Bulletin | None
Fetch a single document by id, or None if it does not exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The document id to fetch (e.g. |
required |
references
|
bool
|
Also resolve the documents this bulletin references
server-side; fetch them with :meth: |
False
|
fields
|
Sequence[str] | NotGiven
|
Restrict the returned fields; the server default projection is used when omitted. |
not_given
|
Returns:
| Type | Description |
|---|---|
Bulletin | None
|
The family-specific :class: |
Bulletin | None
|
matches |
Source code in src/vulners/_resources/_sync/documents.py
get_many
¶
get_many(ids: Sequence[str], *, references: bool = False, fields: Sequence[str] | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> dict[str, Bulletin]
Fetch several documents by id, keyed by id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ids
|
Sequence[str]
|
Document ids to fetch. Ids with no matching document are absent from the result. |
required |
references
|
bool
|
Also resolve the documents these bulletins reference
server-side; fetch them with :meth: |
False
|
fields
|
Sequence[str] | NotGiven
|
Restrict the returned fields on each document; the server default projection is used when omitted. |
not_given
|
Returns:
| Type | Description |
|---|---|
dict[str, Bulletin]
|
A mapping of id to the family-specific :class: |
Source code in src/vulners/_resources/_sync/documents.py
references
¶
references(id: str, *, fields: Sequence[str] | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> dict[str, list[Bulletin]]
Fetch the documents a bulletin references, grouped by source type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The document whose references to resolve. |
required |
fields
|
Sequence[str] | NotGiven
|
Restrict the returned fields on each referenced document; the server default projection is used when omitted. |
not_given
|
Returns:
| Type | Description |
|---|---|
dict[str, list[Bulletin]]
|
A mapping of source type (e.g. |
dict[str, list[Bulletin]]
|
referencing/referenced :class: |
dict[str, list[Bulletin]]
|
document does not exist or has no references. |
Source code in src/vulners/_resources/_sync/documents.py
history
¶
Read the per-field edition history of a bulletin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The bulletin id (e.g. |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
A list of |
list[dict[str, Any]]
|
recorded field edition, newest first. |
Source code in src/vulners/_resources/_sync/documents.py
Audit¶
vulners._resources._sync.audit.Audit
¶
Bases: BaseResource
Audit software inventories and identifiers against Vulners intelligence.
Source code in src/vulners/_resources/_sync/_base.py
packages
cached
property
¶
Package-manager manifest audits (pip/npm/maven/...).
supported_os
¶
List the operating systems accepted by the Linux-package audits.
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
A mapping of OS short name (e.g. |
dict[str, str]
|
shell command Vulners recommends for enumerating that OS's |
dict[str, str]
|
installed packages. |
Source code in src/vulners/_resources/_sync/audit.py
software
¶
software(software: Sequence[AuditItem | str], *, match: Literal['partial', 'full'] = 'partial', fields: Sequence[str] | NotGiven = not_given, config: Sequence[str] | NotGiven = not_given, catalog: Literal['official', 'extended'] = 'official', cvelist_metrics: bool | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> list[dict[str, Any]]
Audit a list of software (CPE dicts or strings) for vulnerabilities.
Each result carries the input, the matched CPE criteria, the
fixed_version that resolves every finding, and the vulnerabilities.
The applied field projection is echoed in the X-Vulners-Applied-Options
response header (read it via :attr:with_raw_response).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
software
|
Sequence[AuditItem | str]
|
Entries as :class: |
required |
match
|
Literal['partial', 'full']
|
|
'partial'
|
fields
|
Sequence[str] | NotGiven
|
Vulnerability fields to include; server default when omitted. |
not_given
|
config
|
Sequence[str] | NotGiven
|
Optional configuration entries. |
not_given
|
catalog
|
Literal['official', 'extended']
|
|
'official'
|
cvelist_metrics
|
bool | NotGiven
|
When |
not_given
|
Source code in src/vulners/_resources/_sync/audit.py
host
¶
host(software: Sequence[AuditItem | str], *, application: AuditItem | str | NotGiven = not_given, operating_system: AuditItem | str | NotGiven = not_given, hardware: AuditItem | str | NotGiven = not_given, match: Literal['partial', 'full'] = 'partial', fields: Sequence[str] | NotGiven = not_given, config: Sequence[str] | NotGiven = not_given, catalog: Literal['official', 'extended'] = 'official', cvelist_metrics: bool | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> list[dict[str, Any]]
Audit a whole host: its software plus optional application, OS and hardware CPEs.
Like :meth:software, but also accepts CPEs describing the host's
application, operating system and hardware; at least one of
application/operating_system/hardware must be set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
software
|
Sequence[AuditItem | str]
|
Installed software as :class: |
required |
application
|
AuditItem | str | NotGiven
|
Optional application CPE narrowing the audit. |
not_given
|
operating_system
|
AuditItem | str | NotGiven
|
Optional operating-system CPE. |
not_given
|
hardware
|
AuditItem | str | NotGiven
|
Optional hardware CPE. |
not_given
|
match
|
Literal['partial', 'full']
|
|
'partial'
|
fields
|
Sequence[str] | NotGiven
|
Vulnerability fields to include; server default when omitted. |
not_given
|
config
|
Sequence[str] | NotGiven
|
Optional configuration entries. |
not_given
|
catalog
|
Literal['official', 'extended']
|
|
'official'
|
cvelist_metrics
|
bool | NotGiven
|
When |
not_given
|
Source code in src/vulners/_resources/_sync/audit.py
os_audit
¶
os_audit(os: str, version: str, packages: Sequence[str], *, timeout: float | Timeout | NotGiven = not_given) -> dict[str, Any]
Audit an OS package list (legacy v3 endpoint; prefer :meth:linux_audit).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
os
|
str
|
OS name, e.g. |
required |
version
|
str
|
OS version. |
required |
packages
|
Sequence[str]
|
Installed packages, one per entry. |
required |
Source code in src/vulners/_resources/_sync/audit.py
linux_audit
¶
linux_audit(os_name: str, os_version: str, packages: Sequence[str], *, os_arch: str | None = None, include_unofficial: bool = False, include_candidates: bool = False, include_any_version: bool = False, cvelist_metrics: bool = False, fields: Sequence[str] | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> dict[str, Any]
Audit RPM/DEB/APK package lists for a Linux host.
Each issue carries the package, its fixedVersion and fixedPackage,
and the applicableAdvisories that match it. The result also reports the
appliedOptions that took effect and any warnings (for example an
unsupported fields option).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
os_name
|
str
|
OS name or id ( |
required |
os_version
|
str
|
OS version. |
required |
packages
|
Sequence[str]
|
Installed packages (1..2500 entries). |
required |
os_arch
|
str | None
|
Default architecture for packages. |
None
|
include_unofficial
|
bool
|
Include unofficial packages. |
False
|
include_candidates
|
bool
|
Include |
False
|
include_any_version
|
bool
|
Include |
False
|
cvelist_metrics
|
bool
|
Add cvelist metrics. |
False
|
fields
|
Sequence[str] | NotGiven
|
Advisory enrichment options to apply; this endpoint supports
|
not_given
|
Source code in src/vulners/_resources/_sync/audit.py
library_audit
¶
library_audit(packages: Sequence[str], *, include_unofficial: bool = False, include_candidates: bool = False, include_any_version: bool = False, cvelist_metrics: bool = False, fields: Sequence[str] | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> dict[str, Any]
Audit a list of packages in PURL format.
Each issue carries the package, its fixedVersion and the
applicableAdvisories that match it (with metrics and
exploitation). The result also reports the appliedOptions that took
effect and any warnings (for example an unsupported fields option).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
packages
|
Sequence[str]
|
Packages in PURL format (1..2500 entries). |
required |
include_unofficial
|
bool
|
Include unofficial packages. |
False
|
include_candidates
|
bool
|
Include |
False
|
include_any_version
|
bool
|
Include |
False
|
cvelist_metrics
|
bool
|
Add cvelist metrics. |
False
|
fields
|
Sequence[str] | NotGiven
|
Advisory enrichment options to apply; this endpoint supports
|
not_given
|
Source code in src/vulners/_resources/_sync/audit.py
sbom_audit
¶
sbom_audit(file: str | PathLike[str], *, cvelist_metrics: bool | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> dict[str, Any]
Audit an SBOM file (SPDX or CycloneDX) for vulnerabilities.
The result reports the appliedOptions that took effect and any
warnings alongside the audit data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
str | PathLike[str]
|
Path to the SBOM file to upload. |
required |
cvelist_metrics
|
bool | NotGiven
|
When |
not_given
|
Source code in src/vulners/_resources/_sync/audit.py
cve_audit
¶
Audit a single CVE identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cve
|
str
|
The CVE identifier to audit, e.g. |
required |
Source code in src/vulners/_resources/_sync/audit.py
cve_batch_audit
¶
cve_batch_audit(cve: Sequence[str], *, timeout: float | Timeout | NotGiven = not_given) -> list[dict[str, Any]]
Audit a batch of CVE identifiers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cve
|
Sequence[str]
|
CVE identifiers to audit; at least one, e.g.
|
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
A list of audit results for the submitted CVEs. |
Source code in src/vulners/_resources/_sync/audit.py
kb_audit
¶
kb_audit(os_name: str, kb_list: Sequence[str], *, os_version: str | NotGiven = not_given, fields: Sequence[str] | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> dict[str, Any]
Audit a Windows host for missing security updates (/api/v4/audit/kb).
Reports one finding per missing update: the result's items list holds a
package with the fixedPackage (the KB that fixes it) and the
advisories for that update — each advisory carrying the KBs it
supersedes alongside its severity, family and affected products. This
replaces the flat CVE list of the deprecated v3 endpoint
(:meth:kb_audit_v3).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
os_name
|
str
|
Windows OS name, e.g. |
required |
kb_list
|
Sequence[str]
|
Installed KBs, e.g. |
required |
os_version
|
str | NotGiven
|
Optional OS build (e.g. |
not_given
|
fields
|
Sequence[str] | NotGiven
|
Advisory fields to include; server default when omitted. |
not_given
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A result mapping with |
dict[str, Any]
|
|
Source code in src/vulners/_resources/_sync/audit.py
kb_audit_v3
¶
kb_audit_v3(os: str, kb_list: Sequence[str], *, timeout: float | Timeout | NotGiven = not_given) -> dict[str, Any]
Audit a Windows host by its installed KBs (deprecated v3 endpoint).
.. deprecated::
Uses the legacy /api/v3/audit/kb/ endpoint, which returns a flat
result (kbLatest, kbMissed, cvelist). Prefer :meth:kb_audit,
which uses /api/v4/audit/kb and returns richer per-update advisories.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
os
|
str
|
Windows OS name, e.g. |
required |
kb_list
|
Sequence[str]
|
Installed KBs, e.g. |
required |
Source code in src/vulners/_resources/_sync/audit.py
win_audit
¶
win_audit(os: str, os_version: str, kb_list: Sequence[str], software: Sequence[WinAuditItem], *, platform: str | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> dict[str, Any]
Audit a Windows host by installed KBs and software.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
os
|
str
|
Windows OS name, e.g. |
required |
os_version
|
str
|
Windows OS version, e.g. |
required |
kb_list
|
Sequence[str]
|
Installed KBs. |
required |
software
|
Sequence[WinAuditItem]
|
Installed software, |
required |
platform
|
str | NotGiven
|
OS platform, e.g. |
not_given
|
Source code in src/vulners/_resources/_sync/audit.py
smart
¶
smart(software: Sequence[str], *, catalog: Literal['official', 'extended'] = 'official', fields: Sequence[str] | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> list[dict[str, Any]]
Resolve free-form software strings to CPE/PURLs and their vulnerabilities.
Each input string is matched heuristically to a CPE and/or PURLs, returning
{"input", "cpe"?, "purls", "confidence", "fixedVersion", "vulnerabilities"}
per entry.
Note
This is a preview endpoint. Billing is per submitted string (every
entry in software is charged), so keep the batch to what you need.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
software
|
Sequence[str]
|
1..500 strings, each at most 512 characters. |
required |
catalog
|
Literal['official', 'extended']
|
|
'official'
|
fields
|
Sequence[str] | NotGiven
|
Fields to include on each vulnerability (a projection). Valid
values include |
not_given
|
Raises:
| Type | Description |
|---|---|
ValueError
|
|
Source code in src/vulners/_resources/_sync/audit.py
metadata
¶
metadata(registry: str, name: str, version: str, *, timeout: float | Timeout | NotGiven = not_given) -> PackageMetadata
Look up a single package's license and version-range metadata.
Returns the package's declared licenses (as a list) along with the version
range the metadata covers. The endpoint is public and available on all
plans.
Two inputs are normalized for you: registry is lower-cased, and for
Maven the name is the groupId:artifactId coordinate — a "/" is
converted to the required ":".
Distinguishing outcomes (see :class:~vulners.PackageMetadata):
- Known package with licenses — :attr:
~vulners.PackageMetadata.licenseis a non-empty list. - Known package, no recorded license —
:attr:
~vulners.PackageMetadata.foundisTruebutlicenseis[]. - Package unknown to the registry —
:attr:
~vulners.PackageMetadata.foundisFalse(the endpoint returns an emptyrange). - API / network error — a :class:
~vulners.VulnersErroris raised; an empty license list is never a silent stand-in for an error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry
|
str
|
Package registry, e.g. |
required |
name
|
str
|
Package name. For Maven, |
required |
version
|
str
|
Package version, e.g. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
A |
PackageMetadata
|
class: |
PackageMetadata
|
|
Source code in src/vulners/_resources/_sync/audit.py
Archive¶
vulners._resources._sync.archive.Archive
¶
Bases: BaseResource
Download bulk archives of the Vulners database.
Source code in src/vulners/_resources/_sync/_base.py
fetch_collection
¶
Download an entire collection archive by type (e.g. "cve").
Buffers and decodes the whole archive in memory. For large collections
prefer :meth:iter_collection (lazy, per-element) or
:meth:download_collection (parallel, straight to disk).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
str
|
The collection type to download (e.g. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The decoded collection — parsed JSON (typically a list of records) |
Any
|
when the body decodes, otherwise the raw archive bytes. |
Source code in src/vulners/_resources/_sync/archive.py
iter_collection
¶
iter_collection(type: str, *, timeout: float | Timeout | NotGiven = not_given) -> Iterator[dict[str, Any]]
Stream a collection archive element by element (a JSON array).
Unlike :meth:fetch_collection (which buffers and decodes the whole
archive), this follows the archive redirect to storage, decompresses the
body as a stream and yields each array element lazily, so a multi-gigabyte
collection never has to be held in memory. Records delivered as raw
Elasticsearch hits are normalized to their "_source" document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
str
|
The collection type to stream (e.g. |
required |
Yields:
| Type | Description |
|---|---|
dict[str, Any]
|
Each collection element as a |
Source code in src/vulners/_resources/_sync/archive.py
download_collection
¶
download_collection(collection: str, path: str | PathLike[str], *, update_from: datetime | None = None, connections: int = 8, timeout: float | Timeout | NotGiven = not_given) -> int
Download a collection archive to path, in parallel; return bytes written.
The endpoint redirects to storage that supports HTTP range requests, so the
raw (still-compressed) archive is pulled over connections concurrent
connections and written straight to disk — saturating the link in constant
memory — with an automatic fallback to a single stream when the storage does
not offer ranges. Nothing is decompressed, so a multi-gigabyte collection
downloads without ever being held in memory. Pass update_from to fetch
only the entries changed after that moment (the collection-update endpoint).
The write is atomic: an interrupted download never clobbers an existing file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collection
|
str
|
The collection type to download (e.g. |
required |
path
|
str | PathLike[str]
|
Destination file path; an existing file is overwritten atomically. |
required |
update_from
|
datetime | None
|
When given, download the collection update since this moment instead of the full archive. |
None
|
connections
|
int
|
Number of parallel range connections (default 8). The
SDK-owned client runs them over HTTP/1.1 so each opens a real socket
and saturates the link; with your own |
8
|
Returns:
| Type | Description |
|---|---|
int
|
The number of bytes written to |
Source code in src/vulners/_resources/_sync/archive.py
fetch_collection_update
¶
fetch_collection_update(type: str, after: datetime, *, timeout: float | Timeout | NotGiven = not_given) -> Any
Download only the collection entries changed after after.
The incremental counterpart of :meth:fetch_collection, buffered and
decoded in memory. Use :meth:collection_state to obtain the cursor to
resume from.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
str
|
The collection type to download (e.g. |
required |
after
|
datetime
|
Only entries changed after this moment are included. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The decoded update — parsed JSON (typically a list of records) when |
Any
|
the body decodes, otherwise the raw archive bytes. |
Source code in src/vulners/_resources/_sync/archive.py
collection_state
¶
Read the sync cursor and counters for a collection.
Returns:
| Type | Description |
|---|---|
Any
|
A dict with |
Any
|
collection-update download), |
Any
|
|
Source code in src/vulners/_resources/_sync/archive.py
family
¶
Download an entire collection-family archive by name.
Same shape as :meth:fetch_collection, keyed by a family name (e.g.
"exploit", "unix", "software") instead of a single
collection type. Buffered and decoded in memory; for large families
prefer :meth:iter_family (lazy, per-element).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The collection family to download (e.g. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The decoded family archive — parsed JSON (typically a list of |
Any
|
records) when the body decodes, otherwise the raw archive bytes. |
Source code in src/vulners/_resources/_sync/archive.py
family_update
¶
family_update(name: str, after: datetime, *, timeout: float | Timeout | NotGiven = not_given) -> Any
Download only the family entries changed after after (max 25h ago).
The incremental counterpart of :meth:family. Use :meth:family_state
to obtain the cursor to resume from.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The collection family to download (e.g. |
required |
after
|
datetime
|
Only entries changed after this moment are included; must be at most 25 hours ago. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The decoded update — parsed JSON (typically a list of records) when |
Any
|
the body decodes, otherwise the raw archive bytes. |
Source code in src/vulners/_resources/_sync/archive.py
family_state
¶
Read the sync cursor and counters for a collection family.
Returns:
| Type | Description |
|---|---|
Any
|
A dict with |
Any
|
meth: |
Any
|
|
Source code in src/vulners/_resources/_sync/archive.py
iter_family
¶
iter_family(name: str, *, update_from: datetime | None = None, timeout: float | Timeout | NotGiven = not_given) -> Iterator[dict[str, Any]]
Stream a family archive element by element, like :meth:iter_collection.
Follows the archive redirect to storage, decompresses the body as a stream and yields each element lazily, so a multi-gigabyte family archive never has to be held in memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The collection family to stream (e.g. |
required |
update_from
|
datetime | None
|
When given, stream only the entries changed after this moment (at most 25 hours ago) instead of the whole family. |
None
|
Yields:
| Type | Description |
|---|---|
dict[str, Any]
|
Each family element as a |
Source code in src/vulners/_resources/_sync/archive.py
get_collection
¶
get_collection(type: str, *, datefrom: str = '1976-01-01', dateto: str = '2199-01-01', timeout: float | Timeout | NotGiven = not_given) -> Any
Download a collection over a date range (legacy v3 endpoint).
Buffered and decoded in memory. Prefer the v4 :meth:fetch_collection /
:meth:download_collection where available.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
str
|
The collection type to download (e.g. |
required |
datefrom
|
str
|
Start date ( |
'1976-01-01'
|
dateto
|
str
|
End date ( |
'2199-01-01'
|
Returns:
| Type | Description |
|---|---|
Any
|
The decoded collection — parsed JSON (typically a list of records) |
Any
|
when the body decodes, otherwise the raw archive bytes. |
Source code in src/vulners/_resources/_sync/archive.py
get_distributive
¶
get_distributive(os: str, version: str, *, timeout: float | Timeout | NotGiven = not_given) -> list[Any]
Download the vulnerability distributive for an OS/version (legacy v3).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
os
|
str
|
The operating system identifier (e.g. |
required |
version
|
str
|
The OS version (e.g. |
required |
Returns:
| Type | Description |
|---|---|
list[Any]
|
A list of the distributive's vulnerability documents (each the |
list[Any]
|
|
Source code in src/vulners/_resources/_sync/archive.py
getsploit
¶
Download the raw getsploit exploit database archive (legacy v3).
Buffers the whole archive in memory; for the full database prefer
:meth:download_getsploit, which streams it to disk in parallel.
Returns:
| Type | Description |
|---|---|
bytes
|
The raw archive bytes (a single-member zip whose member is the |
bytes
|
getsploit SQLite database). |
Source code in src/vulners/_resources/_sync/archive.py
download_getsploit
¶
download_getsploit(path: str | PathLike[str], *, connections: int = 8, timeout: float | Timeout | NotGiven = not_given) -> int
Stream the getsploit database archive to path, in parallel; return bytes written.
The endpoint redirects to storage that supports HTTP range requests, so the
archive is pulled over connections concurrent connections and written
straight to disk — saturating the link and using constant memory — instead
of buffering the whole database in RAM like :meth:getsploit. Prefer this
for the full database; use :meth:getsploit only for the raw bytes in memory.
The write is atomic (an interrupted download never clobbers an existing file),
and the tool falls back to a single stream if the storage does not offer ranges.
The written file is the raw archive (a single-member zip whose member is the
getsploit SQLite database); unzip it to obtain getsploit.db.
Legacy v3 endpoint; there is no v4 equivalent and the server may retire it during the 4.x lifetime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | PathLike[str]
|
Destination file path; an existing file is overwritten atomically. |
required |
connections
|
int
|
Number of parallel range connections (default 8). The
SDK-owned client runs them over HTTP/1.1 so each opens a real socket
and saturates the link; with your own |
8
|
Returns:
| Type | Description |
|---|---|
int
|
The number of bytes written to |
Source code in src/vulners/_resources/_sync/archive.py
Misc¶
vulners._resources._sync.misc.Misc
¶
Bases: BaseResource
Miscellaneous search and metadata helpers.
Source code in src/vulners/_resources/_sync/_base.py
search_cpe
¶
search_cpe(product: str, *, vendor: str | NotGiven = not_given, size: int | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> Any
Search for CPE strings matching a product (and optional vendor).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product
|
str
|
Product string to search a CPE for. |
required |
vendor
|
str | NotGiven
|
Optional vendor to narrow the match. |
not_given
|
size
|
int | NotGiven
|
Maximum number of results (0..10000, |
not_given
|
Returns:
| Type | Description |
|---|---|
Any
|
The CPE search result for |
Any
|
meth: |
Source code in src/vulners/_resources/_sync/misc.py
query_autocomplete
¶
query_autocomplete(query: str, *, timeout: float | Timeout | NotGiven = not_given) -> list[str | list[str]]
Return possible completions for a partial Lucene query.
Most suggestions are strings; the server occasionally returns a group of
related completions, which arrives as a list[str] element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
The partial Lucene query to complete. |
required |
Returns:
| Type | Description |
|---|---|
list[str | list[str]]
|
The completions, each a single string or a |
list[str | list[str]]
|
completions. Also reachable as :meth: |
Source code in src/vulners/_resources/_sync/misc.py
get_suggestion
¶
get_suggestion(field_name: str, *, type: Literal['distinct'] = 'distinct', timeout: float | Timeout | NotGiven = not_given) -> Any
Return distinct value suggestions for a document field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_name
|
str
|
The document field to suggest values for. |
required |
type
|
Literal['distinct']
|
Suggestion type; only |
'distinct'
|
Returns:
| Type | Description |
|---|---|
Any
|
The distinct values observed for |
Any
|
meth: |
Source code in src/vulners/_resources/_sync/misc.py
get_web_application_rules
¶
Return the Vulners web-application (burp) detection rule set.
Returns:
| Type | Description |
|---|---|
Any
|
The web-application (burp) detection rules. Also reachable as |
Any
|
meth: |
Source code in src/vulners/_resources/_sync/misc.py
Report¶
vulners._resources._sync.report.Report
¶
Bases: BaseResource
Reports over Linux-audit results.
Source code in src/vulners/_resources/_sync/_base.py
vulns_summary
¶
vulns_summary(*, limit: int = 30, offset: int = 0, filter: dict[str, Any] | None = None, sort: str = '', timeout: float | Timeout | NotGiven = not_given) -> Any
Summarise every found vulnerability (id, title, score, severity...).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
Maximum number of rows to return in this page. |
30
|
offset
|
int
|
Number of rows to skip. |
0
|
filter
|
dict[str, Any] | None
|
Additional report filter, if any. |
None
|
sort
|
str
|
Sort field; prefix with |
''
|
Returns:
| Type | Description |
|---|---|
Any
|
The vulnerability-summary report payload: one row per distinct vulnerability. |
Source code in src/vulners/_resources/_sync/report.py
vulns_list
¶
vulns_list(*, limit: int = 30, offset: int = 0, filter: dict[str, Any] | None = None, sort: str = '', timeout: float | Timeout | NotGiven = not_given) -> Any
List vulnerabilities found on hosts, with host information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
Maximum number of rows to return in this page. |
30
|
offset
|
int
|
Number of rows to skip. |
0
|
filter
|
dict[str, Any] | None
|
Additional report filter, if any. |
None
|
sort
|
str
|
Sort field; prefix with |
''
|
Returns:
| Type | Description |
|---|---|
Any
|
The vulnerability-list report payload: one row per vulnerability occurrence on a host. |
Source code in src/vulners/_resources/_sync/report.py
ip_summary
¶
ip_summary(*, limit: int = 30, offset: int = 0, filter: dict[str, Any] | None = None, sort: str = '', timeout: float | Timeout | NotGiven = not_given) -> Any
Summarise results per host (agent id, ip, fqdn, os, vulnerability counts).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
Maximum number of rows to return in this page. |
30
|
offset
|
int
|
Number of rows to skip. |
0
|
filter
|
dict[str, Any] | None
|
Additional report filter, if any. |
None
|
sort
|
str
|
Sort field; prefix with |
''
|
Returns:
| Type | Description |
|---|---|
Any
|
The per-host summary report payload: one row per host. |
Source code in src/vulners/_resources/_sync/report.py
scan_list
¶
scan_list(*, limit: int = 30, offset: int = 0, filter: dict[str, Any] | None = None, sort: str = '', timeout: float | Timeout | NotGiven = not_given) -> Any
List scans (host ip/fqdn, os, scan date, cvss score).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
Maximum number of rows to return in this page. |
30
|
offset
|
int
|
Number of rows to skip. |
0
|
filter
|
dict[str, Any] | None
|
Additional report filter, if any. |
None
|
sort
|
str
|
Sort field; prefix with |
''
|
Returns:
| Type | Description |
|---|---|
Any
|
The scan-list report payload: one row per scan. |
Source code in src/vulners/_resources/_sync/report.py
host_vulns
¶
host_vulns(*, limit: int = 30, offset: int = 0, filter: dict[str, Any] | None = None, sort: str = '', timeout: float | Timeout | NotGiven = not_given) -> Any
List hosts with their cumulative fix and vulnerability ids.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
Maximum number of rows to return in this page. |
30
|
offset
|
int
|
Number of rows to skip. |
0
|
filter
|
dict[str, Any] | None
|
Additional report filter, if any. |
None
|
sort
|
str
|
Sort field; prefix with |
''
|
Returns:
| Type | Description |
|---|---|
Any
|
The host-vulnerabilities report payload: one row per host with its |
Any
|
fix and vulnerability ids. |
Source code in src/vulners/_resources/_sync/report.py
vuln_info
¶
vuln_info(ip_address: str, bulletin_id: str, *, limit: int = 30, offset: int = 0, filter: dict[str, Any] | None = None, sort: str = '', timeout: float | Timeout | NotGiven = not_given) -> Any
Detail of one vulnerability on one host.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ip_address
|
str
|
The host ip the vulnerability was found on. |
required |
bulletin_id
|
str
|
The vulnerability bulletin id (e.g. a CVE id). |
required |
limit
|
int
|
Maximum number of rows to return. |
30
|
offset
|
int
|
Number of rows to skip. |
0
|
filter
|
dict[str, Any] | None
|
Additional report filter, if any. |
None
|
sort
|
str
|
Sort field; prefix with |
''
|
Source code in src/vulners/_resources/_sync/report.py
Stix¶
vulners._resources._sync.stix.Stix
¶
Bases: BaseResource
Build STIX bundles from Vulners bulletins.
Source code in src/vulners/_resources/_sync/_base.py
make_bundle_by_id
¶
make_bundle_by_id(id: str, *, opencti_id: str | None = None, timeout: float | Timeout | NotGiven = not_given) -> Any
Build a STIX bundle of objects for a bulletin id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The bulletin id to build a bundle for. |
required |
opencti_id
|
str | None
|
Existing OpenCTI object id to reuse, if any. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The decoded STIX bundle; when the server returns it as a JSON |
Any
|
string the SDK re-parses it, so the result is always a decoded |
Any
|
object. |
Source code in src/vulners/_resources/_sync/stix.py
bundle
¶
bundle(id: str, *, opencti_id: str | None = None, timeout: float | Timeout | NotGiven = not_given) -> Any
Alias of :meth:make_bundle_by_id (the short primary name).
Source code in src/vulners/_resources/_sync/stix.py
Subscriptions¶
vulners._resources._sync.subscriptions.Subscriptions
¶
Bases: BaseResource
Manage v3 email subscriptions.
The api_key argument on the mutating methods names the owner of the
subscription (sent in the body as apiKey) and defaults to the client's
own key. A privileged key sent in the X-Api-Key header can pass a
different owner key to manage that key's subscriptions.
Source code in src/vulners/_resources/_sync/_base.py
list
¶
List the email subscriptions registered under the client's API key.
Returns:
| Type | Description |
|---|---|
Any
|
The account's email subscriptions; each entry carries the |
Any
|
subscription id used by :meth: |
Source code in src/vulners/_resources/_sync/subscriptions.py
add
¶
add(*, query: str, email: str, format: Literal['html', 'json', 'pdf'] = 'html', crontab: str | NotGiven = not_given, query_type: str = 'lucene', api_key: str | None = None, timeout: float | Timeout | NotGiven = not_given) -> Any
Create an email subscription for a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
The search query to subscribe to. |
required |
email
|
str
|
Destination email address. |
required |
format
|
Literal['html', 'json', 'pdf']
|
Report format, |
'html'
|
crontab
|
str | NotGiven
|
Optional crontab schedule. |
not_given
|
query_type
|
str
|
Query language, defaults to |
'lucene'
|
api_key
|
str | None
|
Owner key for the subscription. Defaults to the client's own key; pass another key (with a privileged key on the client) to create the subscription under that key. |
None
|
Source code in src/vulners/_resources/_sync/subscriptions.py
edit
¶
edit(subscription_id: str, *, format: Literal['html', 'json', 'pdf'] | NotGiven = not_given, crontab: str | NotGiven = not_given, active: Literal['yes', 'no', 'true', 'false'] | NotGiven = not_given, api_key: str | None = None, timeout: float | Timeout | NotGiven = not_given) -> Any
Edit an existing email subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
str
|
The subscription to edit. |
required |
format
|
Literal['html', 'json', 'pdf'] | NotGiven
|
New report format, if changing. |
not_given
|
crontab
|
str | NotGiven
|
New crontab schedule, if changing. |
not_given
|
active
|
Literal['yes', 'no', 'true', 'false'] | NotGiven
|
New active state, if changing. |
not_given
|
api_key
|
str | None
|
Owner key for the subscription (see :meth: |
None
|
Source code in src/vulners/_resources/_sync/subscriptions.py
delete
¶
delete(subscription_id: str, *, api_key: str | None = None, timeout: float | Timeout | NotGiven = not_given) -> Any
Delete an email subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
str
|
The subscription to delete. |
required |
api_key
|
str | None
|
Owner key for the subscription (see :meth: |
None
|
Source code in src/vulners/_resources/_sync/subscriptions.py
SubscriptionsV4¶
vulners._resources._sync.subscriptions_v4.SubscriptionsV4
¶
Bases: BaseResource
Manage v4 subscriptions.
Source code in src/vulners/_resources/_sync/_base.py
list
¶
List every subscription on the account.
Returns:
| Type | Description |
|---|---|
Any
|
The account's subscriptions, one record per subscription. |
Source code in src/vulners/_resources/_sync/subscriptions_v4.py
get_list
¶
Alias of :meth:list, kept for the pre-release naming window.
get
¶
get(id: str | None = None, *, subscription_id: str | None = None, timeout: float | Timeout | NotGiven = not_given) -> Any
Fetch a single subscription by id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str | None
|
The subscription id. Interchangeable with |
None
|
subscription_id
|
str | None
|
The subscription id under the server's query
parameter name; interchangeable with |
None
|
Raises:
| Type | Description |
|---|---|
TypeError
|
Neither or both of |
Source code in src/vulners/_resources/_sync/subscriptions_v4.py
create
¶
create(*, name: str, query: SubscriptionQuery | Mapping[str, Any], delivery: SubscriptionDelivery | Mapping[str, Any], license_id: str | None = None, bulletin_fields: Sequence[str] | None = None, is_active: bool = True, timestamp_source: TimestampSource = 'modified', send_empty_result: bool = False, timeout: float | Timeout | NotGiven = not_given) -> Any
Create a subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Human-readable subscription name. |
required |
query
|
SubscriptionQuery | Mapping[str, Any]
|
Query definition, discriminated by |
required |
delivery
|
SubscriptionDelivery | Mapping[str, Any]
|
Delivery definition, discriminated by |
required |
license_id
|
str | None
|
License to bill against, if any. |
None
|
bulletin_fields
|
Sequence[str] | None
|
Bulletin fields to include in results. |
None
|
is_active
|
bool
|
Whether the subscription starts active. |
True
|
timestamp_source
|
TimestampSource
|
Which timestamp drives incremental delivery. |
'modified'
|
send_empty_result
|
bool
|
Deliver even when there are no new results. |
False
|
Source code in src/vulners/_resources/_sync/subscriptions_v4.py
update
¶
update(id: str, *, name: str | NotGiven = not_given, query: SubscriptionQuery | Mapping[str, Any] | NotGiven = not_given, delivery: SubscriptionDelivery | Mapping[str, Any] | NotGiven = not_given, license_id: str | NotGiven | None = not_given, bulletin_fields: Sequence[str] | NotGiven = not_given, is_active: bool | NotGiven = not_given, timestamp_source: TimestampSource | NotGiven = not_given, send_empty_result: bool | NotGiven = not_given, timeout: float | Timeout | NotGiven = not_given) -> Any
Update a subscription.
This is not a partial update. The client omits any argument you
leave unset, but the server requires query, delivery and
send_empty_result on every call and returns HTTP 400 if any of them
is missing — so pass all three on every update, even when you only mean
to change one other field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The subscription to update. |
required |
name
|
str | NotGiven
|
New subscription name. |
not_given
|
query
|
SubscriptionQuery | Mapping[str, Any] | NotGiven
|
New query definition (discriminated by |
not_given
|
delivery
|
SubscriptionDelivery | Mapping[str, Any] | NotGiven
|
New delivery definition (discriminated by |
not_given
|
license_id
|
str | NotGiven | None
|
License to bill against ( |
not_given
|
bulletin_fields
|
Sequence[str] | NotGiven
|
Bulletin fields to include in results. |
not_given
|
is_active
|
bool | NotGiven
|
Enable or disable the subscription. |
not_given
|
timestamp_source
|
TimestampSource | NotGiven
|
Which timestamp drives incremental delivery. |
not_given
|
send_empty_result
|
bool | NotGiven
|
Deliver even when there are no new results. Required on every call. |
not_given
|
Source code in src/vulners/_resources/_sync/subscriptions_v4.py
delete
¶
Delete a subscription by id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The subscription to delete. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The server's delete acknowledgement. |
Source code in src/vulners/_resources/_sync/subscriptions_v4.py
Webhooks¶
vulners._resources._sync.webhooks.Webhooks
¶
Bases: BaseResource
Manage webhook subscriptions.
The api_key argument on the mutating methods is the owner of the
subscription and defaults to the client's own key. To manage another key's
subscriptions, authenticate the client with a privileged key and pass that
other key as api_key.
Source code in src/vulners/_resources/_sync/_base.py
list
¶
List the account's webhook subscriptions.
Scoped to the client's own key: the server reads this endpoint from the
X-Api-Key header only, so there is no owner-key override here. Pair
with :meth:add to create a subscription and :meth:read to poll one
for pending payloads.
Source code in src/vulners/_resources/_sync/webhooks.py
add
¶
add(query: str, *, api_key: str | None = None, timeout: float | Timeout | NotGiven = not_given) -> Any
Create a webhook subscription for a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
The Lucene query that defines matches. |
required |
api_key
|
str | None
|
Owner key for the subscription. Defaults to the client's own key; pass another key (with a privileged key on the client) to create the subscription under that key. |
None
|
Source code in src/vulners/_resources/_sync/webhooks.py
create
¶
create(query: str, *, api_key: str | None = None, timeout: float | Timeout | NotGiven = not_given) -> Any
Alias of :meth:add (the primary CRUD-style name).
Source code in src/vulners/_resources/_sync/webhooks.py
enable
¶
enable(id: str, active: bool, *, api_key: str | None = None, timeout: float | Timeout | NotGiven = not_given) -> Any
Enable or disable a webhook subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The subscription to toggle. |
required |
active
|
bool
|
New active state. |
required |
api_key
|
str | None
|
Owner key for the subscription (see :meth: |
None
|
Source code in src/vulners/_resources/_sync/webhooks.py
set_enabled
¶
set_enabled(id: str, active: bool, *, api_key: str | None = None, timeout: float | Timeout | NotGiven = not_given) -> Any
Alias of :meth:enable (the explicit setter-style name).
Source code in src/vulners/_resources/_sync/webhooks.py
read
¶
read(id: str, *, newest_only: bool = True, api_key: str | None = None, timeout: float | Timeout | NotGiven = not_given) -> Any
Read pending webhook payloads for a subscription.
This endpoint requires the api key in the query string (the X-Api-Key
header alone is rejected), so the key is echoed as a query parameter here.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The subscription to read. |
required |
newest_only
|
bool
|
Return only the newest stored payload. |
True
|
api_key
|
str | None
|
Owner key for the subscription (see :meth: |
None
|
Source code in src/vulners/_resources/_sync/webhooks.py
delete
¶
delete(id: str, *, api_key: str | None = None, timeout: float | Timeout | NotGiven = not_given) -> Any
Delete a webhook subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The subscription to delete. |
required |
api_key
|
str | None
|
Owner key for the subscription (see :meth: |
None
|
Source code in src/vulners/_resources/_sync/webhooks.py
VScanner¶
vulners._resources._sync.vscanner.Vscanner
¶
Bases: BaseResource
VScanner product namespace on the client.
Source code in src/vulners/_resources/_sync/_base.py
projects
cached
property
¶
projects: VscannerProjects
VScanner projects, plus their nested tasks and results.
notification
staticmethod
¶
notification(period: Literal['disabled', 'asap', 'hourly', 'daily'], emails: Sequence[str] | None = None, slack_webhooks: Sequence[str] | None = None) -> dict[str, Any]
Build a notification object for a project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period
|
Literal['disabled', 'asap', 'hourly', 'daily']
|
One of |
required |
emails
|
Sequence[str] | None
|
Email destinations. |
None
|
slack_webhooks
|
Sequence[str] | None
|
Slack webhook destinations. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A notification object suitable for the |
dict[str, Any]
|
meth: |
dict[str, Any]
|
meth: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/vulners/_resources/_sync/vscanner.py
disabled_notification
staticmethod
¶
Build a notification object with delivery turned off.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A notification object with |
dict[str, Any]
|
destinations, for a project that should send no alerts. |
Source code in src/vulners/_resources/_sync/vscanner.py
The Vscanner namespace delegates to nested resources for project and license operations
(v.vscanner.projects, v.vscanner.licenses); task and result operations are nested under a
project (v.vscanner.projects.tasks, v.vscanner.projects.results):
vulners._resources._sync.vscanner.VscannerProjects
¶
Bases: BaseResource
VScanner projects, plus their tasks and results namespaces.
Source code in src/vulners/_resources/_sync/_base.py
results
cached
property
¶
results: VscannerResults
Scan-result and screenshot operations scoped to a project.
list
¶
List the account's VScanner projects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
offset
|
int
|
Number of projects to skip. |
0
|
limit
|
int
|
Maximum number of projects to return in this page. |
50
|
Returns:
| Type | Description |
|---|---|
Any
|
A page of project records. |
Source code in src/vulners/_resources/_sync/vscanner.py
create
¶
create(*, name: str, license_id: UUID, notification: Mapping[str, Any], result_expire_in: int | NotGiven | None = not_given, timeout: float | Timeout | NotGiven = not_given) -> Any
Create a project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
New project name. |
required |
license_id
|
UUID
|
The license id to use. |
required |
notification
|
Mapping[str, Any]
|
A notification object (see
:meth: |
required |
result_expire_in
|
int | NotGiven | None
|
Expire results after N days; |
not_given
|
Returns:
| Type | Description |
|---|---|
Any
|
The created project record, including its assigned project id. |
Source code in src/vulners/_resources/_sync/vscanner.py
update
¶
update(project_id: UUID, *, name: str, license_id: UUID, notification: Mapping[str, Any], result_expire_in: int | None, timeout: float | Timeout | NotGiven = not_given) -> Any
Replace a project's configuration in full.
Every field is required: unset fields overwrite the stored values rather than leaving them untouched.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
UUID
|
The project to update. |
required |
name
|
str
|
Project name. |
required |
license_id
|
UUID
|
The license id to use. |
required |
notification
|
Mapping[str, Any]
|
A notification object (see
:meth: |
required |
result_expire_in
|
int | None
|
Expire results after N days; |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The updated project record. |
Source code in src/vulners/_resources/_sync/vscanner.py
delete
¶
Delete a project and its scan data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
UUID
|
The project to delete. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The API acknowledgement of the deletion. |
Source code in src/vulners/_resources/_sync/vscanner.py
statistics
¶
statistics(project_id: UUID, *, stat: Sequence[Literal['total_hosts', 'vulnerable_hosts', 'unique_cve', 'min_max_cvss', 'vulnerabilities_rank', 'vulnerable_hosts_rank']], timeout: float | Timeout | NotGiven = not_given) -> Any
Return project statistics for the requested aggregations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
UUID
|
The project to summarize. |
required |
stat
|
Sequence[Literal['total_hosts', 'vulnerable_hosts', 'unique_cve', 'min_max_cvss', 'vulnerabilities_rank', 'vulnerable_hosts_rank']]
|
Which aggregations to compute (e.g. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
A mapping keyed by the requested aggregation names, each holding its |
Any
|
computed value. |
Source code in src/vulners/_resources/_sync/vscanner.py
vulners._resources._sync.vscanner.VscannerTasks
¶
Bases: BaseResource
Scan tasks within a VScanner project.
Source code in src/vulners/_resources/_sync/_base.py
list
¶
list(project_id: UUID, *, offset: int = 0, limit: int = 50, timeout: float | Timeout | NotGiven = not_given) -> Any
List the scan tasks defined in a project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
UUID
|
The owning project. |
required |
offset
|
int
|
Number of tasks to skip. |
0
|
limit
|
int
|
Maximum number of tasks to return in this page. |
50
|
Returns:
| Type | Description |
|---|---|
Any
|
A page of task records for the project. |
Source code in src/vulners/_resources/_sync/vscanner.py
create
¶
create(project_id: UUID, *, name: str, networks: Sequence[str], ports: Sequence[str], schedule: str, timing: str, enabled: bool, timeout: float | Timeout | NotGiven = not_given) -> Any
Create a scan task in a project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
UUID
|
The owning project. |
required |
name
|
str
|
Task name. |
required |
networks
|
Sequence[str]
|
Networks to scan (ips or domains). |
required |
ports
|
Sequence[str]
|
Ports or port ranges. |
required |
schedule
|
str
|
Crontab schedule string. |
required |
timing
|
str
|
Scan timing profile. |
required |
enabled
|
bool
|
Whether the task is enabled. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The created task record, including its assigned task id. |
Source code in src/vulners/_resources/_sync/vscanner.py
update
¶
update(project_id: UUID, task_id: UUID, *, name: str, networks: Sequence[str], ports: Sequence[str], schedule: str, timing: str, enabled: bool, timeout: float | Timeout | NotGiven = not_given) -> Any
Replace a scan task's configuration in full.
Every field is required: unset fields overwrite the stored values rather than leaving them untouched.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
UUID
|
The owning project. |
required |
task_id
|
UUID
|
The task to update. |
required |
name
|
str
|
Task name. |
required |
networks
|
Sequence[str]
|
Networks to scan (ips or domains). |
required |
ports
|
Sequence[str]
|
Ports or port ranges. |
required |
schedule
|
str
|
Crontab schedule string. |
required |
timing
|
str
|
Scan timing profile. |
required |
enabled
|
bool
|
Whether the task is enabled. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The updated task record. |
Source code in src/vulners/_resources/_sync/vscanner.py
start
¶
Queue a task to run as soon as possible, ignoring its schedule.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
UUID
|
The owning project. |
required |
task_id
|
UUID
|
The task to start. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The API acknowledgement that the task was queued. |
Source code in src/vulners/_resources/_sync/vscanner.py
delete
¶
Delete a scan task from a project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
UUID
|
The owning project. |
required |
task_id
|
UUID
|
The task to delete. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The API acknowledgement of the deletion. |
Source code in src/vulners/_resources/_sync/vscanner.py
vulners._resources._sync.vscanner.VscannerResults
¶
Bases: BaseResource
Scan results and screenshots within a VScanner project.
Source code in src/vulners/_resources/_sync/_base.py
list
¶
list(project_id: UUID, *, search: str | NotGiven = not_given, in_port: Sequence[str] | NotGiven = not_given, ex_port: Sequence[str] | NotGiven = not_given, min_cvss: float | NotGiven = not_given, max_cvss: float | NotGiven = not_given, last_seen: int | NotGiven = not_given, first_seen: int | NotGiven = not_given, last_seen_port: int | NotGiven = not_given, first_seen_port: int | NotGiven = not_given, sort: Literal['ip', 'name', 'last_seen', 'first_seen', 'resolved', 'min_cvss', 'max_cvss'] = 'last_seen', sort_dir: Literal['asc', 'desc'] = 'asc', offset: int = 0, limit: int = 50, timeout: float | Timeout | NotGiven = not_given) -> Any
List a project's scan results, with optional filtering and sorting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
UUID
|
The owning project. |
required |
search
|
str | NotGiven
|
Free-text query to match against results. |
not_given
|
in_port
|
Sequence[str] | NotGiven
|
Keep only results on these ports. |
not_given
|
ex_port
|
Sequence[str] | NotGiven
|
Drop results on these ports. |
not_given
|
min_cvss
|
float | NotGiven
|
Keep only results with a CVSS score at or above this value. |
not_given
|
max_cvss
|
float | NotGiven
|
Keep only results with a CVSS score at or below this value. |
not_given
|
last_seen
|
int | NotGiven
|
Filter by the result's last-seen time (Unix timestamp). |
not_given
|
first_seen
|
int | NotGiven
|
Filter by the result's first-seen time (Unix timestamp). |
not_given
|
last_seen_port
|
int | NotGiven
|
Filter by a port's last-seen time (Unix timestamp). |
not_given
|
first_seen_port
|
int | NotGiven
|
Filter by a port's first-seen time (Unix timestamp). |
not_given
|
sort
|
Literal['ip', 'name', 'last_seen', 'first_seen', 'resolved', 'min_cvss', 'max_cvss']
|
Field to sort by. |
'last_seen'
|
sort_dir
|
Literal['asc', 'desc']
|
Sort direction, ascending or descending. |
'asc'
|
offset
|
int
|
Number of results to skip. |
0
|
limit
|
int
|
Maximum number of results to return in this page. |
50
|
Returns:
| Type | Description |
|---|---|
Any
|
A page of scan-result records matching the filters. |
Source code in src/vulners/_resources/_sync/vscanner.py
delete
¶
delete(project_id: UUID, result_id: UUID, *, timeout: float | Timeout | NotGiven = not_given) -> Any
Delete a single scan result from a project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
UUID
|
The owning project. |
required |
result_id
|
UUID
|
The scan result to delete. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The API acknowledgement of the deletion. |
Source code in src/vulners/_resources/_sync/vscanner.py
screenshot
¶
screenshot(image_uri: str, *, as_base64: bool = False, timeout: float | Timeout | NotGiven = not_given) -> bytes
Download a result screenshot as bytes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_uri
|
str
|
The server-provided screenshot uri (from a result's
|
required |
as_base64
|
bool
|
Return base64-encoded bytes instead of raw bytes. |
False
|
Returns:
| Type | Description |
|---|---|
bytes
|
The screenshot image bytes, base64-encoded when |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/vulners/_resources/_sync/vscanner.py
vulners._resources._sync.vscanner.VscannerLicenses
¶
Bases: BaseResource
VScanner license ids.
Source code in src/vulners/_resources/_sync/_base.py
list
¶
List the account's VScanner license ids.
Returns:
| Type | Description |
|---|---|
Any
|
The license ids available to the account; pass one as |
Any
|
when creating a project (see :meth: |