cartography

repository·master·Indexed 26 days ago

https://github.com/cartography-cncf/cartography

A Python tool that extracts infrastructure assets and their relationships from over 30 cloud and SaaS providers—including AWS, GCP, Azure, Kubernetes, GitHub, and Okta—into a Neo4j graph database. It enables users to answer complex security and visibility questions regarding identity access, network paths, and vulnerability exposure using Cypher queries and built-in security rules.

Tokens
284K
Snippets
431
Records
1.2K
Agent score
87%

What's inside cartography

  1. Overview of the Microsoft module

    master

    The microsoft module is the top-level umbrella for Microsoft tenant, SaaS, and security control plane data ingested via Microsoft Graph. It contains two primary sub-modules:

    • entra: Contains Entra ID identity objects such as users, groups, OUs, applications, service principals, and app role assignments.
    • intune: Contains Intune managed devices, detected apps, and compliance policies.

    Note: microsoft is the canonical top-level module name. While entra is still accepted as a backward-compatible alias for module selection and ontology source configuration, it is recommended to use microsoft.

  2. Overview of the AIBOM module

    master

    The AIBOM module maps AI agent inventory from raw Cisco AIBOM 1.0.0rc4 reports onto production container images already present in Cartography.

    Key graph entities include:

    • AIBOMSource: The primary scanned-target node.
    • AIBOMComponent: Represents source-scoped components detected within a scanned image. Each component maintains a stable logical_id to allow correlation of the same conceptual component across multiple scanned sources while preserving per-source identity.
  3. Overview of Cartography

    master

    Cartography is a Python-based tool designed to consolidate infrastructure assets and their relationships into an intuitive graph view. It uses a Neo4j database to power this graph, allowing users to visualize dependencies between service assets.

    Key use cases include:

    • Asset Reporting: Generating reports for service owners.
    • Attack Path Discovery: Helping Red Teamers identify potential vulnerabilities.
    • Security Improvement: Enabling Blue Teamers to identify areas for security hardening.
    • Automation: Using APIs for automated security analysis and exploration.
  4. SnipeIT Graph Schema Overview

    master

    The SnipeIT integration in Cartography maps tenants, users, and assets into a Neo4j graph. The schema uses specific relationships to link these entities, allowing for cross-platform security analysis.

    Graph Structure:

    • SnipeitTenant is the root resource.
    • SnipeitTenant --RESOURCE--> SnipeitUser
    • SnipeitTenant --RESOURCE--> SnipeitAsset
    • SnipeitUser --HAS_CHECKED_OUT--> SnipeitAsset
  5. Sync Workday employee and organization data

    master

    Cartography can sync employee and organization data from Workday's HR system into Neo4j. This creates a graph representing organizational structures, reporting hierarchies, and job information.

    Key features include:

    • Employee data: Job information, location, and organizational structure.
    • Manager hierarchies: Established via REPORTS_TO relationships.
    • Organization nodes: Representing departments and teams.
    • Human label integration: WorkdayHuman nodes use the Human label, allowing for identity correlation with other modules like Duo, Okta, and GitHub.
  6. Understand the Databricks Schema and Ontology Mapping

    master

    The Databricks schema in Cartography maps workspace and account-level resources to a shared ontology. This allows for cross-platform security queries.

    Key mappings include:

    • Account-level nodes (DatabricksAccountUser, DatabricksAccountServicePrincipal, DatabricksAccountGroup) map to UserAccount, ServiceAccount, and UserGroup respectively.
    • DatabricksAccount carries the Tenant label.
    • Unity Catalog nodes (catalogs, schemas, tables) map to Database.
    • External locations/volumes map to ObjectStorage.
    • IP access lists map to NetworkAccessControl.

    Permission Labels:

    • DatabricksAclObject: Applied to workspace objects like DatabricksCluster, DatabricksJob, DatabricksSqlWarehouse, etc., to track principal permissions via the HAS_PERMISSION relationship.
    • DatabricksSecurable: Applied to Unity Catalog nodes (e.g., DatabricksCatalog, DatabricksTable) to track grants via the HAS_PERMISSION relationship.
  7. Understand the GitHub Schema Graph

    master
    The GitHub schema in Cartography maps relationships between organizations, repositories, teams, users, and security assets like personal access tokens and branch protection rules. This graph allows for complex security queries, such as identifying which users have access to specific repositories through various mechanisms (direct collaboration, team membership, or outside collaboration).
  8. Understand the Google Workspace Schema

    master
    The Google Workspace schema in Cartography maps tenants, users, groups, devices, and OAuth applications. It uses specific ontology mappings (extra labels) to allow for cross-platform queries. For example, a GoogleWorkspaceUser also carries the UserAccount label, allowing you to query for users across different systems like GitHub or Slack using a single label.