Cypher-to-KQL translator for Microsoft Sentinel, enabling graph query capabilities for security analysts.
Yellowstone translates graph queries (Cypher and Gremlin) into KQL (Kusto Query Language) for Microsoft Sentinel. Security analysts can use familiar graph query syntax to investigate relationships between entities like users, devices, and security events.
Supported Languages: Cypher, Gremlin Status: Core translation functional for both languages.
- Python 3.11 or higher
- Microsoft Sentinel workspace access (optional, for execution)
- Claude API key (optional, for AI-enhanced translation)
git clone https://github.com/rysweet/Yellowstone.git
cd Yellowstone
pip install -e .from yellowstone.models import CypherQuery, TranslationContext
from yellowstone.main_translator import CypherTranslator
# Works with both Cypher and Gremlin
cypher_query = "MATCH (u:User) WHERE u.age > 25 RETURN u.name"
gremlin_query = "g.V().hasLabel('User').has('age',gt(25)).values('name')"
translator = CypherTranslator()
context = TranslationContext(user_id="analyst", tenant_id="org", permissions=[])
# Translate Cypher
result = translator.translate(CypherQuery(query=cypher_query), context)
print(result.query)
# Translate Gremlin (automatically detected)
result = translator.translate(CypherQuery(query=gremlin_query), context)
print(result.query)Output:
IdentityInfo
| make-graph AccountObjectId with_node_id=AccountObjectId
| graph-match (u:User)-[:LOGGED_IN]->(d:Device)
| where u.age > 25
| project u.name- Cypher Parsing: Full MATCH, WHERE, RETURN clause support
- KQL Generation: Uses native
make-graphandgraph-matchoperators - Schema Mapping: Maps Cypher labels to Sentinel tables (IdentityInfo, DeviceInfo, SecurityEvent, etc.)
- Property Access: Node and relationship property filtering
- AI Enhancement: Optional Claude-powered translation for complex queries
- Variable-length paths (
-[*1..3]->) not fully validated - Multi-hop queries (>3 hops) have limited testing
- Schema mappings are generic and may need tuning for specific environments
flowchart TD
A[Cypher Query] --> B[Parser]
B --> C{Translation Routing}
C -->|85% Fast Path| D[Direct KQL Operators]
C -->|10% AI Path| E[Claude SDK]
C -->|5% Fallback| F[Join-based Translation]
D --> G[KQL Output]
E --> G
F --> G
G --> H[Microsoft Sentinel]
Key Components:
yellowstone.parser: Cypher parsing and AST generationyellowstone.translator: KQL generation and query assemblyyellowstone.schema: Sentinel table and relationship mappingsyellowstone.ai_translator: Claude SDK integration (optional)
For detailed architecture documentation, see docs/ARCHITECTURE.md.
Cypher:
MATCH (u:User) WHERE u.age > 30 RETURN u.name LIMIT 10Generated KQL:
IdentityInfo
| make-graph AccountObjectId with_node_id=AccountObjectId
| graph-match (u:User)
| where u.age > 30
| project u.name
| limit 10Cypher:
MATCH (u:User)-[:LOGGED_IN]->(d:Device)
WHERE d.os_type == "Windows"
RETURN u.name, d.device_idGenerated KQL:
IdentityInfo
| join kind=inner (DeviceInfo) on AccountName == DeviceName
| make-graph AccountObjectId with_node_id=AccountObjectId
| graph-match (u:User)-[:LOGGED_IN]->(d:Device)
| where d.os_type == "Windows"
| project u.name, d.device_idCypher:
MATCH (u:User)-[:ACCESSED]->(f:File)<-[:CREATED_BY]-(p:Process)
RETURN u.name, f.path, p.nameGenerated KQL:
IdentityInfo
| join kind=inner (FileInfo) on AccountObjectId == FileOwnerId
| join kind=inner (ProcessInfo) on FileId == ProcessCreatedFileId
| make-graph AccountObjectId with_node_id=AccountObjectId
| graph-match (u:User)-[:ACCESSED]->(f:File)<-[:CREATED_BY]-(p:Process)
| project u.name, f.path, p.name# Run all tests
pytest
# Run with coverage
pytest --cov=src/yellowstone --cov-report=html
# Run specific test suite
pytest tests/integration- ARCHITECTURE.md - Detailed system architecture and design
- TRANSLATION_GUIDE.md - Translation rules and patterns
- SCHEMA_GUIDE.md - Schema mapping configuration
- QUICK_REFERENCE.md - Command reference and examples
Research and planning documents are in the context/ directory.
# Clone repository
git clone https://github.com/rysweet/Yellowstone.git
cd Yellowstone
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/
ruff check src/src/yellowstone/
├── parser/ # Cypher parsing (ANTLR)
├── translator/ # KQL generation
├── schema/ # Sentinel schema mappings
├── ai_translator/ # Claude SDK integration
└── security/ # Input validation
tests/
├── integration/ # End-to-end tests
└── sentinel_integration/ # Azure validation tests
docs/ # Detailed documentation
context/ # Research and planning
This is currently a development project. Contribution guidelines will be published upon initial release.
For questions or discussions, open an issue on GitHub.
MIT License - see LICENSE file for details.
Project Lead: Ryan Sweet (@rysweet)