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. When fields is
omitted, the compact :data:DEFAULT_SEARCH_FIELDS projection is used
(heavy fields like sourceData/description are opt-in via
fields=["*"] or an explicit list).
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.
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.
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', timeout: float | Timeout | NotGiven = not_given) -> list[dict[str, Any]]
Audit a list of software (CPE dicts or strings) for vulnerabilities.
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'
|
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', timeout: float | Timeout | NotGiven = not_given) -> list[dict[str, Any]]
Audit a host: its software plus optional application/OS/hardware CPEs.
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, timeout: float | Timeout | NotGiven = not_given) -> dict[str, Any]
Audit RPM/DEB/APK package lists for a Linux host.
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 (non-free licenses only). |
False
|
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, timeout: float | Timeout | NotGiven = not_given) -> dict[str, Any]
Audit a list of packages in PURL format.
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 (non-free licenses only). |
False
|
Source code in src/vulners/_resources/_sync/audit.py
sbom_audit
¶
sbom_audit(file: str | PathLike[str], *, timeout: float | Timeout | NotGiven = not_given) -> dict[str, Any]
Audit an SBOM file (SPDX or CycloneDX) for vulnerabilities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
str | PathLike[str]
|
Path to the SBOM file to upload. |
required |
Source code in src/vulners/_resources/_sync/audit.py
cve_audit
¶
Audit a single CVE identifier.
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 (at least one).
Source code in src/vulners/_resources/_sync/audit.py
kb_audit
¶
kb_audit(os: str, kb_list: Sequence[str], *, timeout: float | Timeout | NotGiven = not_given) -> dict[str, Any]
Audit a Windows host by its installed KB list.
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', 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", "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'
|
Raises:
| Type | Description |
|---|---|
ValueError
|
|
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").
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. Each element is a dict;
records delivered as raw Elasticsearch hits are normalized to their
"_source" document.
Source code in src/vulners/_resources/_sync/archive.py
download_collection
¶
download_collection(collection: str, path: str | PathLike[str], *, update_from: datetime | None = None, timeout: float | Timeout | NotGiven = not_given) -> int
Stream a collection archive straight to path; return bytes written.
The raw (still-compressed) archive bytes are written to path chunk by
chunk — nothing is buffered in memory and nothing is decompressed — so a
multi-gigabyte collection downloads in constant memory. Pass
update_from to fetch only the entries changed after that moment (the
collection-update endpoint) instead of the whole collection.
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. |
required |
update_from
|
datetime | None
|
When given, download the collection update since this moment instead of the full archive. |
None
|
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.
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.
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).
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. Pass update_from to stream
only the entries changed after that moment (must be at most 25 hours
ago) instead of the whole family.
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).
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).
Source code in src/vulners/_resources/_sync/archive.py
getsploit
¶
Download the raw getsploit exploit database archive (legacy v3).
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
|
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.
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'
|
Source code in src/vulners/_resources/_sync/misc.py
get_web_application_rules
¶
Return the Vulners web-application (burp) detection rule set.
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
Summary of every found vulnerability (id, title, score, severity...).
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 of vulnerabilities found on hosts, with host information.
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
Per-host summary (agent id, ip, fqdn, os, vulnerability counts).
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 of scans (host ip/fqdn, os, scan date, cvss score).
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 of hosts with their cumulative 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
|
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
¶
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
¶
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 | None | NotGiven = 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 | None | NotGiven
|
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.
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.
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
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
|
Source code in src/vulners/_resources/_sync/vscanner.py
disabled_notification
staticmethod
¶
Build a stub notification object with "disabled" period.
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
list
¶
List the account's projects.
Source code in src/vulners/_resources/_sync/vscanner.py
create
¶
create(*, name: str, license_id: UUID, notification: Mapping[str, Any], result_expire_in: int | None | NotGiven = 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 | None | NotGiven
|
Expire results after N days; |
not_given
|
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
Update a project (full replace).
Source code in src/vulners/_resources/_sync/vscanner.py
delete
¶
Delete a project.
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.
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 a project's tasks.
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 |
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
Update a scan task (full replace).
Source code in src/vulners/_resources/_sync/vscanner.py
start
¶
Start a task as soon as possible.
Source code in src/vulners/_resources/_sync/vscanner.py
delete
¶
Delete a task.
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.
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.
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
|