AlloyDB Detection Reports Grounding & Multi-Modal Similarity Engine#
1. Chronicle Investigation Harvesting#
Telemetry Harvesting: Harvested all 258 available Chronicle SIEM security investigations from the SecOps-Lab tenant (
secops-demo-env, requesting up to 500), outputting 258 fully adjudicated investigation reports (132FALSE_POSITIVE, 126TRUE_POSITIVE) intoinvestigations/.Metadata Extraction: Extracted and normalized investigation summaries, alert contexts, MITRE ATT&CK tactics/techniques, entity instances, and triage steps into structured Markdown files conforming to Open Knowledge Format (OKF).
2. AlloyDB & pgvector Database Architecture#
Schema Design & Provisioning: Created PostgreSQL/AlloyDB relational schema in installation_scripts/manage_alloydb.py with the
pgvectorextension enabled:detection_reports: Core investigation records, verdicts, confidences, steps, summaries, and dense vectors (vector(768)).detection_alerts: Associated Chronicle alerts, MITRE tactics/techniques, and rule descriptions.detection_entities: Extracted entities (hosts, IPs, hashes, users, files) with investigation-specific context.
Data Ingestion: Ingested 258 detection reports, 258 linked alerts, and 1,183 entity records (spanning 38 distinct entity values).
Sample Table Inspections#
Table 1: detection_reports (Total Rows: 258, Vector Embeddings: 258/258, Showing 3)
+--------------------------------------+--------------------------------+----------------+-----------------+---------------------+
| id | display_name | verdict | confidence | publish_time |
+--------------------------------------+--------------------------------+----------------+-----------------+---------------------+
| 03b9b188-6625-4fc1-a8dc-6644eb9856f6 | SCC: Exfiltration with Context | TRUE_POSITIVE | HIGH_CONFIDENCE | 2026-06-16 00:27:47 |
| 03cbf404-5858-450f-9f1e-f350ef9c2d1b | MSBuildShell Utility Abuse | FALSE_POSITIVE | LOW_CONFIDENCE | 2026-06-16 06:40:14 |
| 051efbd4-7407-4f81-a6ce-54e4c27a29e4 | Volume Shadow Copy Creation | FALSE_POSITIVE | HIGH_CONFIDENCE | 2026-06-07 05:07:01 |
+--------------------------------------+--------------------------------+----------------+-----------------+---------------------+
Table 2: detection_alerts (Total Rows: 258, Showing 3)
+-------------------+--------------------------------------+--------------------------------+----------+---------------+-------------------+
| alert_id | investigation_id | display_name | severity | mitre_tactics | mitre_techniques |
+-------------------+--------------------------------------+--------------------------------+----------+---------------+-------------------+
| de_36833728-1f... | 12791450-ae06-44ce-8d2b-63a233b8a1c9 | ATI Active Breach Rule Match | CRITICAL | [] | [] |
| de_fc1b447b-f9... | 10fbb728-6739-420f-91a3-4f5fcdad1cbc | Encoded Powershell Network Con | MEDIUM | ["TA0002"] | ["T1059.001"] |
| de_5118d87c-03... | 504b5a06-7c01-4475-8178-0cf752fc996d | MimiKatz Command Arguments | HIGH | ["TA0006"] | ["T1003"] |
+-------------------+--------------------------------------+--------------------------------+----------+---------------+-------------------+
Table 3: detection_entities (Total Rows: 1,183, Showing 3)
+------+--------------------------------------+-------------+--------------+------------------------------------+
| id | investigation_id | entity_type | entity_value | context |
+------+--------------------------------------+-------------+--------------+------------------------------------+
| 1184 | 00351f48-2646-4450-ae2d-6fefeae32f2d | HOST | wins-d19 | Host active in SIEM logs... |
| 1185 | 00351f48-2646-4450-ae2d-6fefeae32f2d | USER | lisawalker | No enrichment data available... |
| 1186 | 00351f48-2646-4450-ae2d-6fefeae32f2d | FILE | cmd.exe | No enrichment data available... |
+------+--------------------------------------+-------------+--------------+------------------------------------+
3. Vertex AI 768-Dimensional Vector Embeddings#
Dense Text Embeddings: Integrated Google Vertex AI
TextEmbeddingModel(text-embedding-004) to generate 768-dimensional embeddings for 100% of detection reports (258/258).HNSW Indexing: Created an approximate nearest-neighbor index (
idx_detection_reports_embedding_hnsw) using Hierarchical Navigable Small World graphs (USING hnsw (embedding vector_cosine_ops)) for sub-millisecond similarity scans.
4. Multi-Modal Composite Similarity Engine#
Developed a 2-stage retrieval and scoring algorithm in AlloyDBManager.find_similar evaluating five orthogonal security dimensions:
Semantic Vector Cosine (\(S_{\text{sem}}\)): Vector similarity across attack descriptions via pgvector cosine distance.
Weighted Entity Overlap (\(S_{\text{ent}}\)): Inverse Document Frequency (IDF) weighted Jaccard index prioritizing rare indicators over ubiquitous binaries.
Behavioral MITRE TTPs (\(S_{\text{ttp}}\)): Hierarchical overlap across tactics (30%) and specific sub-techniques (70%).
Investigation Flow Steps (\(S_{\text{flow}}\)): Step-by-step structural overlap across analytical action fingerprints.
Temporal Campaign Decay (\(S_{\text{time}}\)): Exponential recency scoring with a 14-day half-life (\(\tau = 14\text{ days}\)).
5. Parameterized Similarity Profiles#
Implemented five operational scoring profiles in SIMILARITY_PROFILES:
balanced(Default: 35% Sem, 30% Ent, 20% TTP, 10% Flow, 5% Time): General triage and precedent matching.threat-hunt(45% TTP, 35% Sem, 10% Flow, 5% Time, 5% Ent): Cross-host threat actor and tradecraft campaign tracking.compromise-pivot(45% Ent, 30% Time, 15% Sem, 5% Flow, 5% TTP): Host compromise blast radius and lateral movement tracing.false-positive(40% Ent, 25% TTP, 20% Sem, 10% Flow, 5% Time): Recurring benign administrative pattern deduplication.semantic(60% Sem, 15% Flow, 15% TTP, 5% Ent, 5% Time): Exploratory behavioral and conceptual attack discovery.
6. Hybrid Similarity Reporting with Vertex AI Gemini Synthesis#
Deterministic Framework: Programmatically constructs OKF-compliant Markdown reports featuring exact sub-score tables, shared indicator matrices, and direct links to historical investigation documents.
AI Narrative Synthesis: Calls Vertex AI Gemini 2.5 Flash via
AlloyDBManager.generate_similarity_reportto produce executive campaign correlation narratives, cross-host infrastructure overlap analyses, verdict discrepancy evaluations (e.g. contrastingFALSE_POSITIVEvsTRUE_POSITIVE), and actionable SOC triage recommendations.
7. Interface & Tooling Integrations#
CLI Commands (manage.py):
python manage.py alloydb ingest/embed/info/profilespython manage.py alloydb search "MSBuildShell" [--semantic]python manage.py alloydb find-similar <INV_ID> --profile threat-hunt --explainpython manage.py alloydb report <INV_ID> --profile threat-hunt --ai
Developer Workflows (justfile):
just alloydb-find-similar <INV_ID> 5 threat-huntjust alloydb-report <INV_ID> 5 threat-huntjust alloydb-profiles
Autonomous SOC Agent (agent_soc_manager/agent.py):
Registered
find_similar_alloydb_investigationsinto the Orchestrator and Tier 1 Analyst toolsets with profile parametrization support.