Skip to main content

Python SDK for building OpenSOAR integrations and playbooks

Project description

OpenSOAR SDK

Python SDK for building integrations and playbooks for the OpenSOAR SOAR platform.

Install

pip install opensoar-sdk

Build an Integration

from opensoar_sdk import Integration, action

class MyIntegration(Integration):
    name = "my-tool"

    async def connect(self):
        self.client = MyToolClient(self.config["api_key"])

    async def health_check(self) -> bool:
        return await self.client.ping()

    @action(timeout=30, retries=2)
    async def lookup_ip(self, ip: str) -> dict:
        return await self.client.query(ip)

Write a Playbook

from opensoar_sdk import playbook, action

@playbook(trigger="webhook", conditions={"severity": ["high", "critical"]})
async def triage_alert(alert):
    result = await enrich_ip(alert.source_ip)
    if result.malicious:
        await block_ip(alert.source_ip)
        await notify_slack(f"Blocked {alert.source_ip}")

Testing

from opensoar_sdk.testing import mock_alert, mock_run_context

async def test_my_playbook():
    alert = mock_alert(severity="high", source_ip="1.2.3.4")
    async with mock_run_context():
        await triage_alert(alert)

Part of OpenSOAR

See the main repo for full documentation.

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

opensoar_sdk-0.1.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

opensoar_sdk-0.1.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file opensoar_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: opensoar_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opensoar_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 141b1b2f5dc07a4598a9c0d748afab816009da634cd384a039b624546e7b5f9a
MD5 f307fc272ea5a2cdd8773a73c0a04be6
BLAKE2b-256 5c96b9addb3409e78ad47950b3588d048b72d14ae0b87612b5c544160615aa52

See more details on using hashes here.

Provenance

The following attestation bundles were made for opensoar_sdk-0.1.1.tar.gz:

Publisher: build.yml on opensoar-hq/opensoar-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 opensoar_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: opensoar_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opensoar_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a9003f9647c71d5b392e99e120c39451ec3060c413a6c2ed4739d02b3bfbfb7
MD5 ba0790af25d9ac1940a7207820730fa3
BLAKE2b-256 c9e409da3f0b2e6d6f2c2e3680bbed320d304405e382aba36f8760c31c4ca0d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for opensoar_sdk-0.1.1-py3-none-any.whl:

Publisher: build.yml on opensoar-hq/opensoar-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