Skip to main content

The DASL client library used for interacting with the DASL workspace

Project description

DASL Client Library

The DASL (Databricks Antimatter Security Lakehouse) Client Library is a Python SDK for interacting with DASL services. This library provides an interface for interacting with DASL services, allowing you to manage datasources, rules, workspace configurations, and more from Databricks notebooks.

Features

  • Simple Authentication: Automatic workspace detection in Databricks notebooks
  • Datasource Management: Create, update, list, and delete datasources
  • Rule Management: Define and manage security detection rules to identify threats
  • Workspace Configuration: Update and retrieve DASL's workspace-level settings

Installation

Install from PyPI:

pip install dasl-client

Quick Start

Databricks Notebook Environment (Recommended)

The DASL client works best in Databricks notebooks with automatic authentication:

from dasl_client import Client

# Automatically detects Databricks context and authenticates
client = Client.for_workspace()
print("Connected to DASL!")

# List existing datasources
print("Existing datasources:")
for datasource in client.list_datasources():
    print(f"  - {datasource.metadata.name}")

# List detection rules
print("Existing detection rules:")
for rule in client.list_rules():
    print(f"  - {rule.metadata.name}")

Creating a Datasource

from dasl_client import DataSource, Schedule, BronzeSpec, SilverSpec

# Create a new datasource
datasource = Datasource(
    source="aws",
    source_type="cloudtrail",
    autoloader=Autoloader(
        enabled=True,
        schedule=Schedule(
            at_least_every="1h",
            enabled=True
        )
    ),
    bronze=BronzeSpec(
        bronze_table="security_logs_bronze",
        skip_bronze_loading=False
    ),
    silver=SilverSpec(
        # Configure silver layer here, see the API reference for more details
    ),
    gold=GoldSpec(
        # Configure gold layer here, see the API reference for more details
    )
)

# Create the datasource
created_datasource = client.create_datasource(datasource)
print(f"Created datasource: {created.metadata.name}")

Creating a Detection Rule

from dasl_client.types import Rule, Schedule

# Create a new detection rule to detect failed logins
rule = Rule(
    schedule=Schedule(
        at_least_every="2h",
        enabled=True,
    ),
    input=Rule.Input(
        stream=Rule.Input.Stream(
            tables=[
                Rule.Input.Stream.Table(name="http_activity"),
            ],
            filter="disposition = 'Blocked'",
            starting_timestamp=datetime(2025, 7, 8, 16, 47, 30),
        ),
    ),
    output=Rule.Output(
        summary="record was blocked",
    ),
)

try:
    created_rule = client.create_rule("Detect Blocked HTTP Activity", rule)
    print(f"Successfully created rule: {created_rule.metadata.name}")
except Exception as e:
    print(f"Error creating rule: {e}")

Requirements

  • Python 3.8+
  • Access to a Databricks workspace with DASL enabled
  • databricks-sdk>=0.41.0
  • pydantic>=2

Documentation

For complete DASL Client documentation, examples, and API reference:

Support

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

dasl_client-1.0.32.tar.gz (59.1 kB view details)

Uploaded Source

Built Distribution

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

dasl_client-1.0.32-py3-none-any.whl (67.5 kB view details)

Uploaded Python 3

File details

Details for the file dasl_client-1.0.32.tar.gz.

File metadata

  • Download URL: dasl_client-1.0.32.tar.gz
  • Upload date:
  • Size: 59.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dasl_client-1.0.32.tar.gz
Algorithm Hash digest
SHA256 9e57dc02b25fdf9332b7e51ad81ab343a36e29c2c27248eecc35f4caf0dce00f
MD5 41c7535db6112e834f89d9aebc8d02a7
BLAKE2b-256 6a9b45e38fc7e8fd4c34d746c1d0c6658bb5f82dea4522d1e355b93da7df6448

See more details on using hashes here.

File details

Details for the file dasl_client-1.0.32-py3-none-any.whl.

File metadata

  • Download URL: dasl_client-1.0.32-py3-none-any.whl
  • Upload date:
  • Size: 67.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dasl_client-1.0.32-py3-none-any.whl
Algorithm Hash digest
SHA256 a644f6b06236e4535d9c6036bc9885abefe31b539c1e1e8c2f3d6599c2b0fa6f
MD5 1c3613563e2e6d2222191f85d34b8e36
BLAKE2b-256 e9c243cb87a1b79f87ec46b66ebacc26fe9a978382888445bb8fad7ef0011ca3

See more details on using hashes here.

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