MCPcopy Index your code

hub / github.com/cartography-cncf/cartography / functions

Functions7,408 in github.com/cartography-cncf/cartography

↓ 5,156 callersMethodget
Make a GET request to the Airbyte API. This method handles authentication and pagination. Args: uri (str): The URI to make
cartography/intel/airbyte/util.py:25
↓ 1,548 callersFunctionmake_target_node_matcher
Create a TargetNodeMatcher with dynamically generated attributes. This function creates a specialized TargetNodeMatcher dataclass with attri
cartography/models/core/relationships.py:132
↓ 1,301 callersFunctioncheck_rels
Helper function to test a given relationship between node 1 and node 2. Returns the result of a neo4j match query as a set of tuples when giv
tests/integration/util.py:34
↓ 1,205 callersMethodrun
Run cartography sync to pull infrastructure data into Neo4j. This command pulls configuration data from multiple sources, lo
cartography/cli.py:321
↓ 947 callersFunctioncheck_nodes
Helper function for checking nodes in cartography integration tests. Returns the result of a neo4j match query on the given node label and th
tests/integration/util.py:11
↓ 733 callersFunctionload
Load node data to the graph with automatic indexing. This is the main entry point for intel modules to write node data to the graph. It
cartography/client/core/tx.py:784
↓ 705 callersMethodrun
Execute the job by running all statements sequentially. This method executes each statement in the job in order. If any statement
cartography/graph/job.py:217
↓ 618 callersMethodfrom_node_schema
Create a cleanup job from a CartographyNodeSchema. This class method generates a cleanup job that removes stale nodes and re
cartography/graph/job.py:329
↓ 145 callersFunctioncreate_boto3_client
( session: Any, service_name: str, *args: Any, config: botocore.config.Config | None = None,
cartography/intel/aws/util/botocore_config.py:151
↓ 140 callersMethodget
(self, url, timeout)
tests/integration/cartography/intel/aws/test_ecr_layers.py:55
↓ 132 callersFunctioncreate_test_account
(neo4j_session, test_account_id, test_update_tag)
tests/integration/cartography/intel/aws/common.py:1
↓ 131 callersFunctioniso27001_annex_a
(requirement: str, control_title: str | None = None)
cartography/rules/data/frameworks/iso27001.py:43
↓ 114 callersMethodpaginate
(self, **kwargs)
tests/unit/cartography/intel/aws/test_organizations.py:150
↓ 113 callersMethodget_paginator
(self, name)
tests/unit/cartography/intel/aws/test_organizations.py:154
↓ 98 callersMethodlist
(self, parent: str)
tests/integration/cartography/intel/gcp/test_kms.py:43
↓ 91 callersMethodraise_for_status
(self)
tests/integration/cartography/intel/aws/test_ecr_layers.py:38
↓ 88 callersMethodjson
(self)
tests/integration/cartography/intel/aws/test_ecr_layers.py:41
↓ 77 callersMethodas_dict
Convert the job to a dictionary representation. This method serializes the job to a dictionary format suitable for JSON seri
cartography/graph/job.py:256
↓ 76 callersFunctionmake_source_node_matcher
Create a SourceNodeMatcher with dynamically generated attributes. This function creates a specialized SourceNodeMatcher dataclass with attri
cartography/models/core/relationships.py:207
↓ 69 callersFunctionget_botocore_config
( *, read_timeout: int | None = None, max_attempts: int | None = None, retry_mode: str | None
cartography/intel/aws/util/botocore_config.py:83
↓ 66 callersFunctionload_matchlinks
Create relationships between existing nodes in the graph. This is the main entry point for intel modules to write relationships between
cartography/client/core/tx.py:853
↓ 61 callersFunction_as_str
(value: Any)
cartography/intel/aibom/transform.py:38
↓ 58 callersMethodfrom_matchlink
Create a cleanup job for matchlink relationships. This class method generates a cleanup job specifically for cleaning up stale
cartography/graph/job.py:401
↓ 54 callersMethodload
Loads a JSON object (dict) from a file. :type file_path: string. :param file_path: Filepath for the file. :return: Di
cartography/driftdetect/storage.py:7
↓ 51 callersFunctionclassify_gcp_http_error
Classify a GCP HttpError into a canonical category string. Reuses existing helpers (is_api_disabled_error, get_error_reason, etc.) so lo
cartography/intel/gcp/util.py:457
↓ 51 callersFunctiongcp_api_execute_with_retry
Execute a GCP API request with retry on transient errors. This function provides two layers of retry: 1. Network-level errors (connectio
cartography/intel/gcp/util.py:221
↓ 46 callersFunctionresolve_access
Resolve effective access from grants. For each grant, determine which users, groups, and devices can access which devices and services based
cartography/intel/tailscale/grants.py:240
↓ 45 callersMethodlist_next
( self, previous_request: _KeyRingListRequest, previous_response: dict, )
tests/integration/cartography/intel/gcp/test_kms.py:46
↓ 44 callersMethodget
(self, url, headers=None, timeout=None)
tests/unit/cartography/intel/gcp/test_artifact_registry_supply_chain.py:1265
↓ 42 callersFunctionrun_analysis_job
Execute an analysis job to enrich existing graph data. This function is designed for use with the cartography.intel.analysis sync stage.
cartography/util.py:76
↓ 40 callersMethodprojects
(self)
tests/integration/cartography/intel/gcp/test_kms.py:34
↓ 37 callersFunctionget_stats_client
Get a scoped StatsD client with the specified prefix. This function returns a ScopedStatsClient instance that automatically prefixes all
cartography/stats.py:255
↓ 35 callersFunctionrun_write_query
Execute a write query inside a managed transaction with retry logic. This function now includes retry logic for: - Network errors (Conne
cartography/client/core/tx.py:338
↓ 33 callersFunctionremove_leading_whitespace_and_empty_lines
Helper function for tests. On the given text string, remove all leading whitespace on each line and remove blank lines, :param text: Text
tests/unit/cartography/graph/helpers.py:4
↓ 31 callersFunctionrun_scoped_analysis_job
Execute a scoped analysis job on a specific sub-resource. This function runs analysis queries that are scoped to a particular sub-resource
cartography/util.py:209
↓ 29 callersFunctionmerge_module_sync_metadata
Create or update ModuleSyncMetadata nodes to track sync operations. This function creates ModuleSyncMetadata nodes that record when specific
cartography/util.py:331
↓ 29 callersFunctionsummarize_gcp_http_error
Return a concise, single-line summary for a GCP HttpError.
cartography/intel/gcp/util.py:138
↓ 27 callersFunctionparse_ci_config
Parse a GitLab CI YAML document. Returns an empty `ParsedCIConfig` on YAML parse error rather than raising — caller can treat absence of jobs
cartography/intel/gitlab/ci_config_parser.py:333
↓ 26 callersFunctioncis_gcp
(requirement: str, control_title: str | None = None)
cartography/rules/data/frameworks/cis.py:141
↓ 24 callersMethodincr
Increment a StatsD counter metric. This method increments a counter metric using the underlying StatsD client. The metric na
cartography/stats.py:105
↓ 24 callersMethodmain
Main entrypoint for the command line interface. This method parses command line arguments, configures logging and various se
cartography/cli.py:248
↓ 23 callersFunctionbuild_ingestion_query
Generate a Neo4j query from a CartographyNodeSchema to ingest nodes and relationships. This function creates an optimized Neo4j query that c
cartography/graph/querybuilder.py:1072
↓ 23 callersFunctioncis_aws
(requirement: str, control_title: str | None = None)
cartography/rules/data/frameworks/cis.py:129
↓ 23 callersFunctioncis_kubernetes
(requirement: str, control_title: str | None = None)
cartography/rules/data/frameworks/cis.py:153
↓ 23 callersMethodget_grants
Get all grants from the ACL/policy file. Tailscale grants define access rules with sources, destinations, and capabilities (
cartography/intel/tailscale/utils.py:129
↓ 21 callersFunction_make_http_error
Helper: build an HttpError with the given HTTP status and optional JSON body.
tests/unit/cartography/intel/gcp/test_util.py:600
↓ 21 callersFunctionnormalize_architecture
(raw: str | None)
cartography/intel/container_arch.py:45
↓ 20 callersFunctionclean_query_list
Helper function to remove leading whitespace and blank lines for all strings in the input list. :param queries: The list of strings to clean
tests/unit/cartography/graph/helpers.py:18
↓ 20 callersFunctionget_epoch
(date: datetime | None)
cartography/intel/kubernetes/util.py:218
↓ 20 callersFunctionmake_normalized_package_id
Create a normalized package ID for cross-tool matching. The ID format is: {type}|{namespace/}{normalized_name}|{version} The namespace
cartography/intel/trivy/util.py:63
↓ 20 callersMethodmatches
Check if this framework matches the given filter criteria. Args: short_name: Filter by short name (case-insensitive).
cartography/rules/spec/model.py:209
↓ 19 callersFunctionload_namespaces
( session: neo4j.Session, namespaces: list[dict[str, Any]], update_tag: int, cluster_name: str
cartography/intel/kubernetes/namespaces.py:39
↓ 19 callersMethodlocations
(self)
tests/integration/cartography/intel/gcp/test_kms.py:37
↓ 19 callersFunctionpaginated_get
Fetch all pages from a paginated Vercel API endpoint. :param api_session: Authenticated requests session :param url: Full URL of the API
cartography/intel/vercel/util.py:14
↓ 18 callersFunction_ensure_local_neo4j_has_test_teams
(neo4j_session)
tests/integration/cartography/intel/vercel/test_teams.py:14
↓ 18 callersFunction_get
Read a field that the Azure SDK may emit either at the top level of the dict or nested under "properties".
cartography/intel/azure/application_gateways.py:32
↓ 18 callersFunction_make_docker_image
( repository_id: str, index: int, media_type: str = TEST_SINGLE_IMAGE_MEDIA_TYPE, )
tests/integration/cartography/intel/gcp/test_artifact_registry.py:131
↓ 18 callersFunctionbuild_client
( service: str, version: str = "v1", credentials: GoogleCredentials | None = None, quota_proje
cartography/intel/gcp/clients.py:57
↓ 18 callersFunctiondict_date_to_epoch
Convert a dictionary date value to Unix epoch timestamp. .. deprecated:: This method is deprecated. Neo4j can handle datetime ingest
cartography/util.py:824
↓ 18 callersFunctionfetch_all_rest_api_pages
Fetch all pages from a GitHub REST API endpoint using Link header pagination. :param token: The GitHub API token as string. :param base_
cartography/intel/github/util.py:451
↓ 18 callersFunctionparse_image_uri
Return ``(image_uri, image_digest)`` extracted from a raw image reference. Handles the common forms produced by the different container/function
cartography/intel/container_image.py:6
↓ 18 callersFunctionparse_report_source
(raw_source: str)
cartography/intel/common/report_source.py:108
↓ 18 callersFunctiontransform_tags
Transforms tags from a list of Azure resources into a standardized list of tag dictionaries. Args: resource_list: List of Azure reso
cartography/intel/azure/util/tag.py:6
↓ 17 callersFunctionload_graph_data
Load data to the graph using batched operations. This function processes large datasets by splitting them into manageable batches and ex
cartography/client/core/tx.py:638
↓ 16 callersFunction_build_response
( *, status_code: int = 200, json_data: list[dict] | None = None, content: bytes = b"", he
tests/unit/cartography/intel/gitlab/test_dependencies.py:37
↓ 16 callersFunction_get_module_from_schema
Extract the module name from a Cartography schema object. This function extracts and formats the module name from a CartographyNodeSchema
cartography/graph/querybuilder.py:1942
↓ 16 callersFunction_make_cloudsql_flag_fact
( fact_id: str, name: str, description: str, db_version_filter: str, violation_predicate:
cartography/rules/data/rules/cis_4_0_gcp.py:1150
↓ 16 callersFunction_make_cloudsql_flag_rule
( rule_id: str, name: str, description: str, requirement: str, fact: Fact, )
cartography/rules/data/rules/cis_4_0_gcp.py:1191
↓ 16 callersFunctionis_api_disabled_error
Check if an HttpError indicates that a GCP API is not enabled on the project. This utility helps modules gracefully skip syncing when an API
cartography/intel/gcp/util.py:411
↓ 16 callersFunctionload_kubernetes_cluster
( neo4j_session: neo4j.Session, cluster_data: list[dict[str, Any]], update_tag: int, )
cartography/intel/kubernetes/clusters.py:56
↓ 16 callersFunctionnormalize_command
Normalize a Docker command for comparison. Handles Dockerfile instruction prefixes, shell prefixes, BuildKit prefixes, whitespace normal
cartography/intel/supply_chain.py:161
↓ 16 callersFunctionparse
Parse Dockerfile content and return a structured representation. :param content: Raw Dockerfile content as string :return: ParsedDockerf
cartography/intel/supply_chain.py:127
↓ 15 callersFunction_clear_gar_project
(neo4j_session, project_id: str)
tests/integration/cartography/intel/gcp/test_artifact_registry.py:96
↓ 15 callersFunction_make_dep
Build a transformed-dependency dict for the lockfile/reconcile tests.
tests/unit/cartography/intel/github/test_repos.py:31
↓ 15 callersFunction_run_with_retry
Execute the supplied callable with retry logic for transient network errors, EntityNotFound ClientErrors, and BufferErrors.
cartography/client/core/tx.py:165
↓ 15 callersFunctioncall_with_retries
Call an async function with retries on transient transport exceptions. Uses exponential backoff (1s, 2s, 4s, ...) between retries. Non-m
cartography/intel/microsoft/entra/utils.py:21
↓ 15 callersFunctionget_paginated
Fetch paginated results from a REST API endpoint. This function handles pagination by making multiple requests to the API until all pages of
cartography/intel/keycloak/util.py:10
↓ 15 callersMethodhas_framework
Check if this rule has a framework matching the given criteria. Args: short_name: Filter by framework short name (case-i
cartography/rules/spec/model.py:352
↓ 14 callersFunction_create_client_error
Helper to create a ClientError with a specific code.
tests/unit/cartography/client/core/test_tx.py:50
↓ 14 callersMethodclose
(self)
cartography/intel/common/object_store.py:85
↓ 14 callersFunctioncreate_test_user
()
tests/data/okta/users.py:7
↓ 14 callersFunctionfetch_all
Fetch and return all data items of the given `resource_type` and `field_name` from Github's paginated GraphQL API as a list, along with infor
cartography/intel/github/util.py:204
↓ 14 callersFunctionget_cartography_version
Return the current cartography release version.
cartography/version.py:10
↓ 14 callersFunctionis_retryable_gcp_http_error
Check if the exception is a retryable GCP API error. Per Google Cloud documentation (https://cloud.google.com/storage/docs/retry-strategy),
cartography/intel/gcp/util.py:70
↓ 14 callersFunctionload_docker_images
Loads GCPArtifactRegistryRepositoryImage and GCPArtifactRegistryImage nodes and their relationships.
cartography/intel/gcp/artifact_registry/artifact.py:685
↓ 14 callersFunctionparse_action_reference
Parse a GitHub Action 'uses' reference. Examples: - actions/checkout@v4 - actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
cartography/intel/github/workflow_parser.py:63
↓ 13 callersFunction_create_test_project
Helper to create a GCPProject node for testing.
tests/integration/cartography/intel/gcp/test_compute.py:33
↓ 13 callersFunction_resolve_credentials
( credentials: GoogleCredentials | None = None, quota_project_id: str | None = None, )
cartography/intel/gcp/clients.py:41
↓ 13 callersFunction_transform_rulesets
Transforms GitHub repository ruleset data from API format to Cartography format.
cartography/intel/github/repos.py:1825
↓ 13 callersFunctionbuild_report_reader_for_source
( source: ReportSource, *, config: "Config | None" = None, azure_blob_credential: Any | None =
cartography/intel/common/report_reader_builder.py:51
↓ 13 callersFunctionget_application_id
Generate a normalized unique identifier for an application. :param name: Application name :param vendor: Application vendor/publisher
cartography/intel/sentinelone/utils.py:4
↓ 13 callersFunctionget_client
Getting the Azure SQL client
cartography/intel/azure/sql.py:55
↓ 13 callersFunctionget_paginated
Fetch all pages from a GitLab API endpoint. Handles pagination, rate limiting, and retries automatically. This is the primary utility fo
cartography/intel/gitlab/util.py:367
↓ 13 callersFunctionload_services
( neo4j_session: neo4j.Session, data: list[dict[str, Any]], org: str, update_tag: int, )
cartography/intel/tailscale/services.py:103
↓ 13 callersFunctionmake_request_with_retry
Make an HTTP request with retry logic and rate limit handling. Implements exponential backoff for retries and handles GitLab rate limit resp
cartography/intel/gitlab/util.py:169
↓ 13 callersFunctionscaleway_obj_to_dict
Transform a Scaleway object (dataclass, dict, or list) into a dictionary.
cartography/intel/scaleway/utils.py:9
↓ 13 callersFunctiontransform_cves
Transform NVD CVE data, filtering to only CVEs present in the graph. Returns a dict keyed by CVE ID for easy merging.
cartography/intel/cve_metadata/nvd.py:180
↓ 12 callersFunction_build_policy_bindings
( permissions: list[str], scope: str, )
tests/unit/cartography/intel/gcp/test_permission_relationships.py:20
↓ 12 callersFunction_fake_token_manager
()
tests/unit/cartography/intel/gcp/test_artifact_registry_supply_chain.py:1287
↓ 12 callersFunction_get_rest_api_base_url
Convert a GitHub GraphQL API URL to a REST API base URL. For github.com: https://api.github.com/graphql -> https://api.github.com For Gi
cartography/intel/github/util.py:367
next →1–100 of 7,408, ranked by callers