HomeCase studiesStreaming AI Cybersecurity Monitoring and SOC Log...

Case study · Tel Aviv, Israel

Streaming AI Cybersecurity Monitoring and SOC Log Intelligence Platform

SOC Threat Detection & Log Intelligence

Security operations teams drown in fragmented firewall, identity, and endpoint telemetry when static correlation rules fire thousands of disconnected alerts per shift. We engineered an AI-assisted cybersecurity monitoring platform combining high-throughput Elasticsearch log pipelines with a Python and FastAPI detection and investigation backend. The architecture normalizes heterogeneous event streams into a unified security schema, pairs deterministic behavioral signatures with unsupervised anomaly scoring, and compresses noisy alert storms into contextual attack timelines.

Industry
SOC Threat Detection & Log Intelligence
Solution
A distributed security analytics and SOC triage platform built with Python, FastAPI, and Elasticsearch for real-time log enrichment, anomaly detection, and incident correlation.
Platforms
Web & API
Stack
Python · FastAPI · Elasticsearch · Apache Kafka · PyTorch · PostgreSQL
Location
Tel Aviv, Israel · delivered remotely
Role
Engineering, with the team behind for mobile and QA

Delivered remotely for a business based in Tel Aviv, Israel. Names withheld by agreement.

Project Overview

Modern enterprise networks emit continuous streams of authentication assertions, DNS lookups, endpoint process trees, and cloud control-plane logs across hybrid environments. Traditional SIEM deployments frequently collapse under two compounding pressures: rigid threshold rules either miss slow-moving lateral movement or flood analysts with context-free notifications, while raw log stores lag behind real-time triage when storage indexes bloat.

We designed and built an AI cybersecurity monitoring platform centered on Python, FastAPI, and Elasticsearch. The system ingests heterogeneous security telemetry through durable streaming queues, normalizes events into a consistent entity model, evaluates both signature rules and statistical behavioral models, and surfaces correlated incident narratives through an API-first investigation engine.

SOC Ingestion & Triage Bottlenecks

Before this platform was built, security teams operated across disconnected log silos that created severe operational friction during active investigations:

  • Schema fragmentation across vendors: Firewalls, identity providers, and endpoint agents logged timestamps, user principals, and source addresses under incompatible field names, forcing analysts to rewrite ad-hoc queries for each data source.
  • Disconnected alert storms: A single phishing compromise routinely generated dozens of isolated low-level alerts across DNS, proxy, and IAM logs without linking them to the originating session.
  • Model opacity during incident response: Black-box anomaly scores without supporting feature attributions left responders unable to distinguish benign administrative scripts from genuine privilege escalation.
  • Query contention under load: Heavy threat-hunting aggregations over multi-terabyte indices competed directly with real-time rule evaluation, stalling ingestion during high-volume security events.

Architectural Strategy

We anchored the platform around a two-stage detection and correlation architecture built over a canonical event schema. Every incoming log payload is parsed once in Python into Elastic Common Schema fields, enriched inline with asset criticality and threat indicators cached in Redis, and written to time-partitioned Elasticsearch data streams.

Rather than running heavyweight deep-learning inference on every raw packet record, Python workers maintain compact behavioral feature vectors per user, host, and service account. Lightweight statistical checks and PyTorch sequence models score rare process chains, off-hours authentication hops, and atypical data egress only on enriched session summaries—preserving deterministic latency while giving analysts transparent feature explanations alongside every elevated risk score.

Core Capabilities

  • Unified Telemetry Normalization: Python stream consumers parse syslog, JSON, CEF, and cloud audit trails into typed entity records linking users, hosts, processes, and network sockets.
  • Hybrid Rule & AI Detection: Executes deterministic behavioral detections in tandem with PyTorch anomaly scoring trained on historical tenant baselines for impossible travel, token replay, and anomalous child processes.
  • Entity-Centric Incident Correlation: Groups related detections across time windows into coherent attack stories annotated with MITRE ATT&CK tactics, affected assets, and supporting raw log pointers.
  • FastAPI Investigation & SOAR API: Exposes paginated threat-hunting search, timeline reconstruction, indicator pivots, and signed webhook triggers for automated host isolation or credential revocation.
  • Dynamic IOC & Asset Enrichment: Joins live events against STIX/TAXII threat feeds and internal CMDB ownership tables via Redis without adding cross-service lookup stalls.

Technical Architecture

Telemetry forwarders push encrypted event batches into Apache Kafka topics partitioned by tenant and source category. Stateless Python normalization workers consume those partitions, apply schema validation, enrich IP addresses and principals via Redis lookup tables, and bulk-index documents into Elasticsearch hot nodes. Concurrently, sliding-window aggregators update entity behavioral profiles and emit scored detection candidates. FastAPI serves the web analyst console and external automation clients, reading case state from PostgreSQL and pivoting into Elasticsearch for sub-second timeline queries.

Flow: Telemetry Collectors → Apache Kafka Topics → Python Normalization & Redis Enrichment → Elasticsearch Data Streams + PyTorch Anomaly Scorers → Correlation Engine → FastAPI Investigation & SOAR API

Separating stateless Kafka consumers from the FastAPI query tier lets engineering teams scale ingestion throughput independently from analyst search concurrency and scheduled threat-hunting jobs.

Technology Stack

Category Technology detail
Ingestion Bus Apache Kafka buffering high-burst firewall, EDR, and cloud audit event streams
Stream Normalization Python workers parsing raw syslog, JSON, and CEF into Elastic Common Schema
Search & Log Store Elasticsearch hot-warm-cold index lifecycle storing searchable security telemetry
Detection & Scoring PyTorch sequence and isolation models scoring lateral movement and credential anomalies
API & Orchestration FastAPI serving investigation queries, rule management, and SOAR playbook webhooks
Relational Metadata PostgreSQL persisting case histories, analyst assignments, and detection rule versions
Entity & Window Cache Redis holding rolling host baselines, IOC bloom lookups, and alert deduplication keys
Threat Intel Feeds STIX/TAXII polling jobs enriching IP, domain, and file-hash indicators in flight
Observability Structured pipeline lag metrics tracking ingestion delay and model inference health

Engineering Trade-offs & Solutions

Engineering Challenge Solution & Trade-off
Controlling Elasticsearch cluster costs under multi-month log retention Implemented hot-warm-cold Index Lifecycle Management with rollup summaries for long-term baselines; accepts slightly slower cold-tier restores in exchange for predictable hot-node memory footprints.
Explaining ML-flagged anomalies to skeptical SOC responders Paired PyTorch anomaly scores with SHAP-style top contributing feature tags and direct links to baseline peer behavior; increases per-alert metadata size while eliminating opaque risk scores.
Preventing duplicate alerts from flooding incident queues Used Redis-backed sliding-window deduplication keyed on (tenant, rule_id, entity_id) to append evidence onto open cases; trades immediate standalone alert fan-out for cleaner analyst triage queues.
Avoiding query timeouts during broad regex hunts Enforced FastAPI query guardrails using async search cursors, bounded time ranges, and keyword-indexed subfields instead of wildcard scans on raw message bodies.

Security & Reliability

A monitoring platform guarding sensitive security logs is itself a high-value target. All collector transport terminates over mutual TLS, and tenant isolation is enforced across Kafka topic routing, Elasticsearch index aliases, and PostgreSQL row-level access controls checked on every FastAPI request. Analysts interact strictly through role-scoped OAuth/OIDC tokens with field-level masking for sensitive payload attributes such as session cookies or PII embedded in URLs.

To guarantee forensic integrity, raw ingested events write into append-only Elasticsearch data streams protected from manual edits, while analyst case notes, rule edits, and suppression actions record into an immutable PostgreSQL audit ledger. If downstream Elasticsearch nodes experience transient saturation or rolling upgrades, Kafka retention buffers incoming telemetry safely on replicated storage so zero security events are discarded.

Performance & Scale

Log ingestion and search workloads vary dramatically between quiet overnight baselines and active incident bursts. Python ingestion services batch documents dynamically by byte size and flush interval, compressing bulk payloads before hitting Elasticsearch ingest nodes. Hot indices reside on NVMe-backed nodes tuned with pre-mapped keyword and IP field types, avoiding costly runtime dynamic mapping updates.

In the query layer, FastAPI uses asynchronous Elasticsearch clients and short-lived Redis caches for repetitive dashboard widgets, IOC reputation lookups, and MITRE tactic breakdowns. Feature vectors for AI scoring update incrementally in streaming windows rather than re-scanning historical indices, keeping inference overhead flat even as total archived log volume grows steadily over time.

Operational Outcomes

Consolidating disparate telemetry pipelines into an AI-assisted FastAPI and Elasticsearch platform reshaped daily SOC execution:

  • Coherent incident timelines: Correlating network, identity, and endpoint signals around shared entities allows analysts to inspect complete attack progressions rather than triaging isolated log lines.
  • Explainable behavioral detections: Pairing statistical anomaly models with concrete baseline deviations equips Tier-1 and Tier-2 responders to validate suspicious automation or credential misuse quickly.
  • Resilient burst handling: Kafka buffering and tiered Elasticsearch storage maintain uninterrupted ingestion and responsive search behavior during noisy DDoS events or credential-stuffing waves.
  • Programmable containment: Clean FastAPI endpoints and signed SOAR webhooks bridge detection directly into identity revocation and endpoint quarantine workflows without manual copy-paste.

01 — Questions

asked about this kind of project

Why pair deterministic detection rules with ML anomaly models instead of relying on AI scoring alone?

Pure anomaly models struggle to explain why a deviation is malicious and can be tuned slowly against known attack techniques. Combining deterministic Sigma-compatible rules with Python behavioral models preserves crisp auditability for known tactics while catching novel credential abuse and beaconing patterns.

How does Elasticsearch stay responsive when SOC analysts query months of logs during active investigations?

Telemetry routes through hot-warm-cold Index Lifecycle Management tiers using time-based data streams, frozen searchable snapshots for cold retention, and pre-aggregated entity summary indexes that resolve timeline queries without scanning raw log lines.

How do you prevent alert fatigue when a single compromised host triggers hundreds of cascading detections?

FastAPI coordinates an entity-centric correlation stage backed by Redis sliding windows. Alerts sharing common source identities, host assets, or kill-chain phases collapse into a single prioritized incident graph mapped to MITRE ATT&CK stages.

How are bursty log spikes handled without dropping forensic evidence?

Apache Kafka decouples log collectors from downstream Python parsers and Elasticsearch bulk indexers. During incident surges or firewall storms, Kafka absorbs backpressure on disk so ingestion pipelines catch up cleanly once indexing capacity scales.

How do you defend the AI monitoring pipeline against adversarial log poisoning or noisy baselines?

Baseline training windows exclude unverified alert periods and require multi-source corroboration across identity, network, and endpoint telemetry before shifting entity risk scores, while keeping raw immutable logs isolated in append-only indices.

How does the FastAPI layer support external SOAR playbooks without slowing down interactive analyst consoles?

Interactive search endpoints run under dedicated worker pools with strict Elasticsearch query timeouts and pagination cursors, while automated containment webhooks and enrichment jobs execute asynchronously over separate task queues.

03 — Similar project?

describe what is different about yours

Build yours.

Tell me what exists, what you need and the deadline. Fixed price for a defined scope, or $55/day (8–9 hours work) with a written plan first.

Solitaire Corporate Park, Makarba, Ahmedabad, Gujarat 380015, India · IST (UTC+5:30) · --:-- IST · Mon–Fri 09:00–18:00 IST · US & EU overlap daily

No newsletter, no CRM. Just a reply.