Skip to main content

NATS wrapper for fast scanner development

Some instructions for add a new instance of scanner.

from scanner_api.wrappers import scanner_wrapper

Define the worker function which takes two argumentw (source, data).

source - infromation about publisher (e.g. nmap.reporter.masscan - this can catch only in ‘nmap.**’) data - dict with JSON data for scanner, which NATS scheduler send

worker returns a list with data to be sent to next scanner or reporter. (each element of list will be sent as separate message)

You can redefine log format according logging module.

def worker(source, data, meta):

result = [] result = processing…(data) logging.info(“i do work”) logging.warning(“i warn you”) logging.error(“i made a mistake”) return result

Make a wrapper with define scanner name. The data will be collected from NATS by this name. (e.g. name.***.*** or name). Also name its a queue name.

Define NATS host addr.

wrapper = scanner_wrapper(

nats=[“nats://127.0.0.1:4222”], name=”reporter”)

Run by passing an argument worker function. This is blocking call!

wrapper.run(worker)

LOG FORMAT: Connected to nats. Started module named ‘{name}’ Received from ‘{subject}’: {data} Starting ‘{name}’ Result: {result} n Was sent to ‘{pipeline}’

Here:

{name} - scanner name {subject} - queue name {data} - json from NATS {result} - out data from worker function {pipeline} - new addr in NATS queue

Metadata

Release files for nats-scan-wrapper 0.1.9.9.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nats-scan-wrapper 0.1.9.9.9
File Size Uploaded Provenance Actions
nats-scan-wrapper-0.1.9.9.9.tar.gz 9.2 kB Without provenance Details for nats-scan-wrapper-0.1.9.9.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nats-scan-wrapper 0.1.9.9.9
File Interpreter ABI Platform Actions
nats_scan_wrapper-0.1.9.9.9-py3-none-any.whl Python 3 none any Details for nats_scan_wrapper-0.1.9.9.9-py3-none-any.whl

Total release size: 19.7 kB

Release files / nats-scan-wrapper-0.1.9.9.9.tar.gz

Download URL nats-scan-wrapper-0.1.9.9.9.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2c9cb9998a58d84c107b693586183c63ac0e1427996a53d730a904146329f5da
BLAKE2b-256 checksum
How to use checksums
0533f85db293b5aa64f8e041faae1301610d873dd99681ae9b92e2d25a96f544
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

Release files / nats_scan_wrapper-0.1.9.9.9-py3-none-any.whl

Download URL nats_scan_wrapper-0.1.9.9.9-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b9dd3ffb2e8d5ab07281586dbc0e5a24f7f2a1be2965e59e8c283e80172ff79
BLAKE2b-256 checksum
How to use checksums
2fc79d0ff981bfe76daeefeb718e3dc0c1f3edbe6196cd21941160df47a4f853
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

Security for nats-scan-wrapper 0.1.9.9.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.9.9.9 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page