Skip to content

Commit

Permalink
scoped analysis docs
Browse files Browse the repository at this point in the history
  • Loading branch information
achantavy committed Jul 17, 2023
1 parent 0c88ee8 commit 5875244
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions cartography/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ def run_analysis_job(
common_job_parameters: Dict,
package: str = 'cartography.data.jobs.analysis',
) -> None:
"""
Enriches existing graph data with analysis jobs. This is designed for use with the sync stage
cartography.intel.analysis.
Runs the queries in the given Python `package` directory (cartography.data.jobs.analysis by default) for the given
`filename`. All queries in this directory are intended to be run at the end of a full graph sync. As such, they are
not scoped to a single sub resource. That is they will apply to _all_ AWS accounts/_all_ GCP projects/_all_ Okta
organizations/etc.
"""
GraphJob.run_from_json(
neo4j_session,
read_text(
Expand All @@ -61,6 +69,11 @@ def run_scoped_analysis_job(
neo4j_session: neo4j.Session,
common_job_parameters: Dict,
) -> None:
"""
Enriches existing graph data scoped to a given sub resource - e.g. the current AWS account.
Runs the queries in the cartography.data.jobs.scoped_analysis directory for the given `filename`. View the queries
in cartography.data.jobs.scoped_analysis for specifics.
"""
GraphJob.run_from_json(
neo4j_session,
read_text('cartography.data.jobs.scoped_analysis', filename),
Expand Down
2 changes: 1 addition & 1 deletion docs/root/usage/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ If you want to learn more in depth about Neo4j and Cypher queries you can look a

.. _data-augmentation:

Cartography adds custom attributes to nodes and relationships to point out security-related items of interest. Unless mentioned otherwise these data augmentation jobs are stored in `cartography/data/jobs/analysis`. Here is a summary of all of Cartography's custom attributes.
Cartography adds custom attributes to nodes and relationships to point out security-related items of interest. Data augmentation jobs meant to apply to the whole graph and run at the end of a sync are stored in `cartography/data/jobs/analysis`. Jobs that are meant to apply to a subset of the graph - say, the current AWS account - are stored in `cartography/data/jobs/scoped_analysis`. Here is a summary of all of Cartography's custom attributes.

- `exposed_internet` indicates whether the asset is accessible to the public internet.

Expand Down

0 comments on commit 5875244

Please sign in to comment.