How cartography-cncf/cartography works
Cartography collects infrastructure and identity assets from many platforms, turns them into related graph records, and writes them to Neo4j. The main user workflow is to run the CLI with selected modules and credentials, sync the chosen sources, then query the graph or run security rules. The repository also contains analysis and drift-detection capabilities. Provider coverage is much broader than the sampled source; those branches are represented at subsystem level, and the documented workflow and source-index references support the connections shown.
Main entry points: intel Transform and Load · nodes.py Graph Schemas · rules/cli.py Rules CLI · driftdetect/cli.py Drift CLI
Components 19
Collection and Sync
- Cartography CLI
cartography/cli.py - Sync Orchestrator
cartography/sync.py - Provider Modules
cartography/intel - Provider APIs
- Transform and Load
cartography/intel
Graph Storage
- Neo4j Transactions
cartography/client/core/tx.py - Graph Jobs
cartography/graph/job.py - Graph Schemas
cartography/models/core/nodes.py - Relationship Schemas
cartography/models/core/relationships.py - Ontology Mapping
cartography/models/ontology/labels.py - Neo4j
Analysis and Security
- Graph Analysis
cartography/analysis - Rules CLI
cartography/rules/cli.py - Security Rules
cartography/rules/data/rules - Rule Specification
cartography/rules/spec/model.py
Drift Detection
- Drift CLI
cartography/driftdetect/cli.py - State Collection
cartography/driftdetect/get_states.py - Drift Storage
cartography/driftdetect/storage.py
Other components
- Operator
Connections 20
- Operator → Cartography CLI: runs sync
README.md - Cartography CLI → Sync Orchestrator: starts sync
- Sync Orchestrator → Provider Modules: selects modules
- Provider Modules → Provider APIs: fetches assets
- Provider Modules → Transform and Load: transforms assets
cartography/intel/azure/storage.py - Transform and Load → Graph Jobs: runs graph jobs
cartography/intel/gcp/storage.py - Transform and Load → Graph Schemas: loads schemas
cartography/intel/azure/storage.py - Transform and Load → Neo4j Transactions: writes records
cartography/intel/gcp/storage.py - Graph Jobs → Neo4j: executes queries
- Neo4j Transactions → Neo4j: writes graph
- Graph Schemas → Relationship Schemas: defines links
cartography/models/kubernetes/storage.py - Graph Schemas → Ontology Mapping: adds labels
cartography/models/supabase/storagebucket.py - Operator → Rules CLI: runs rules
README.md - Rules CLI → Security Rules: selects rules
- Security Rules → Rule Specification: uses definitions
cartography/rules/data/rules/object_storage_public.py - Rules CLI → Neo4j: queries graph
README.md - Operator → Graph Analysis: invokes analysis
- Operator → Drift CLI: runs drift checks
- Drift CLI → State Collection: collects states
- Drift CLI → Drift Storage: stores states