Streaming raw events into a cyber lakehouse and normalizing them to a standard schema is a common pattern for security analytics. This blog walks through an end-to-end architecture that uses Databricks Zerobus to push events into a bronze Delta table, Spark Declarative Pipelines (SDP) to process them through a medallion architecture, and the Open Cybersecurity Schema Framework (OCSF) for gold-layer analytics. OCSF gold tables unlock downstream cyber use cases by consolidating diverse raw logs into a common information model organized by OCSF cybersecurity category and event class. Instead of dozens of siloed tables per vendor or source, you get one table per class that unifies all relevant events, so analysts can run simple filters and find patterns and insights across sources. For a full look at how Databricks is bringing these capabilities together into an open, agentic SIEM, see Databricks Lakewatch.
Zerobus Ingest is Databricks' managed high-throughput ingestion service for streaming records directly into Delta tables. A producer (e.g., a Python script) uses the Zerobus SDK to send batches of records to a workspace endpoint; Zerobus writes them into the target table without you running a separate Spark streaming job for the ingest. That makes it a good fit for API-driven sources (webhooks, REST APIs, event feeds) that require low-latency, push-based writes to the lakehouse. Tables must live in a Unity Catalog location with a managed storage path; the producer authenticates via a service principal and sends records that match the table's schema (including standard metadata columns such as event time and source) with support for the variant data type.
Spark Declarative Pipelines define streaming ETL as Python functions decorated with SDP annotations or as SQL queries. You declare sources (e.g., views or streaming tables), transformations, and sinks; the Lakeflow Spark Declarative Pipelines runtime compiles them into a single pipeline DAG and runs them as jobs. SDP supports streaming tables, append flows into Delta sinks (other sink types are supported as well), and clustering and table properties, so you can implement a medallion (bronze → silver → gold) pattern entirely in code. Point the pipeline at a folder of Python or SQL modules and start it; all layers stay in sync incrementally.
A common challenge in data engineering for cybersecurity is the sheer diversity of raw security logs: different formats and schemas for the same data, many vendors (e.g., AWS, Microsoft Defender, Okta, Palo Alto Networks), and a mix of categories (application, system, IAM, network) and event classes (API, file, auth, DNS, and more). A reusable blueprint that normalizes this variety into a single standard can scale across sources, cut pipeline development time, automate OCSF mapping, and speed delivery to customers while keeping a consistent, resilient data architecture.
The Open Cybersecurity Schema Framework is a vendor-neutral schema for security and observability events. OCSF defines categories (e.g., System Activity, Findings, Identity & Access Management, Network Activity, Application Activity) and event classes (e.g., Process Activity, Detection Finding, HTTP Activity) with standard field names, types, and semantics. Normalizing raw logs into OCSF makes it easier to run cross-source analytics, build reusable dashboards, and plug into SIEMs, SOARs, and SOC workflows that consume OCSF. In this example, we map public GitHub events into three OCSF v1.7.0 classes: API Activity (6003), Entity Management (3004), and File System Activity (1001).
For demo simplicity, this example streams public GitHub events, which require no authentication. In practice, this same pattern applies to any device or cyber event API — most production sources will require an authentication access token or an OAuth setup in the producer.
The flow is: GitHub Events API → Zerobus Ingest → Bronze Delta table → SDP Silver (flattened) → SDP Gold (three OCSF Delta sinks).
Prerequisites:
The SDP pipeline source is the folder containing the pipeline Python modules; it reads from the bronze table (exposed as a view), builds a silver streaming table, and then appends to the three gold sinks. Below are focused code snippets for each layer.
The producer (e.g., push_zerobus.py) authenticates via a service principal, initializes the Zerobus SDK with the target table and record type, and creates a stream.
|
From there, it fetches events, builds one record per event, and sends batches via stream.ingest_records_nowait() and stream.flush(). Each record includes the raw payload plus standard metadata fields that match the bronze table: event_time, event_date, source, source_type, source_path, and processed_time.
The producer sends event_time and event_date as epoch values (micros and days); the target table defines them as TIMESTAMP and DATE, and Zerobus Ingest (or the ingest path) handles the conversion. The bronze table DDL includes a VARIANT column for the raw payload and the same metadata columns so that downstream pipelines and OCSF metadata can use them consistently:
|
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.