Skip to main content

Simplified BriskSec Toolbox Wrapper SDK for Python - focused on output parsing and event generation

Project description

BriskSec Toolbox Wrapper SDK for Python

A simplified Python SDK for parsing security tool outputs and generating events and findings. The Go runtime handles all the complex wrapper logic, messaging, HTTP servers, and pub/sub functionality.

Philosophy

This SDK follows a simple philosophy:

  • Focus on parsing: Your Python code should only focus on parsing tool outputs
  • Let Go handle complexity: The Go runtime manages all wrapper infrastructure
  • Type generation: Use tools/typegen to generate Python types from Go structs

Installation

pip install -e .

Usage

Basic Parser

Create a parser by extending OutputParser:

from brisksec_toolbox_wrapper_sdk import OutputParser, Event, Finding

class MyToolParser(OutputParser):
    def parse_output(self, output: str, metadata=None):
        events = []
        findings = []
        
        # Parse your tool output here
        # Convert to events and findings
        
        return {
            "events": events,
            "findings": findings
        }

Events vs Findings

  • Events: Use for asset discovery (IPs, ports, domains, etc.)
  • Findings: Use for security vulnerabilities and issues

Example: Nmap Parser

from brisksec_toolbox_wrapper_sdk import OutputParser, AssetIPEvent, AssetPortEvent

class NmapParser(OutputParser):
    def parse_output(self, output: str, metadata=None):
        events = []
        # Parse XML and create events
        events.append(AssetIPEvent(ip="192.168.1.1"))
        events.append(AssetPortEvent(ip="192.168.1.1", port="80", protocol="tcp"))
        
        return {"events": events, "findings": []}

Type Generation

The Python types are auto-generated from Go structs using tools/typegen. To regenerate types:

cd tools/typegen
go run main.go

This ensures that Python types stay in sync with the Go runtime types.

Removed Complexity

In this simplified version, we removed:

  • Complex wrapper base classes
  • HTTP server logic (FastAPI/uvicorn)
  • Message handling infrastructure
  • Pub/sub logic
  • Command execution utilities

All of this is now handled by the Go runtime, making the Python SDK focused and lightweight.

Migration from v0.1.x

If you were using the old wrapper classes:

Old approach:

class MyWrapper(BaseWrapper):
    def handle_scan(self, message):
        # Complex message handling
        pass

New approach:

class MyParser(OutputParser):
    def parse_output(self, output, metadata=None):
        # Simple output parsing
        return {"events": [], "findings": []}

The Go runtime will call your parser and handle all the infrastructure.

Development

Running Tests

pytest tests/

Code Formatting

black .
isort .

Type Checking

mypy brisksec_toolbox_wrapper_sdk/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file brisksec_toolbox_wrapper_sdk-1.2025.627.519.tar.gz.

File metadata

File hashes

Hashes for brisksec_toolbox_wrapper_sdk-1.2025.627.519.tar.gz
Algorithm Hash digest
SHA256 8005e9352be3126c33b1a0836daeadbd7a86ee1f78b0bcf709f57a553885e796
MD5 3b1f185441baa1add31c5395b01c088f
BLAKE2b-256 9c4e9accf131aa60319ebc3f2ff671a8056d5d7aff4d16a0cd27b588b9fe64d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for brisksec_toolbox_wrapper_sdk-1.2025.627.519.tar.gz:

Publisher: publish.yml on BriskStack/brisksec-toolbox-wrapper-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brisksec_toolbox_wrapper_sdk-1.2025.627.519-py3-none-any.whl.

File metadata

File hashes

Hashes for brisksec_toolbox_wrapper_sdk-1.2025.627.519-py3-none-any.whl
Algorithm Hash digest
SHA256 2ff22223c55f8e1206b9e2d6799b6ad59ca464bd6a891a3573285f52427512b9
MD5 588cc2606b2ccd6a6dd28aaaf5a6aa5d
BLAKE2b-256 14d955a18f7f5b6793e6f64c1d0a2f1fc8f16a4e3c01103febc0719e9c212e60

See more details on using hashes here.

Provenance

The following attestation bundles were made for brisksec_toolbox_wrapper_sdk-1.2025.627.519-py3-none-any.whl:

Publisher: publish.yml on BriskStack/brisksec-toolbox-wrapper-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page