cartography 0.108.0rc1__py3-none-any.whl → 0.109.0rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cartography might be problematic. Click here for more details.
- cartography/_version.py +2 -2
- cartography/data/indexes.cypher +0 -2
- cartography/data/jobs/cleanup/gcp_compute_vpc_cleanup.json +0 -12
- cartography/intel/aws/cloudtrail.py +17 -4
- cartography/intel/aws/cloudtrail_management_events.py +593 -16
- cartography/intel/aws/cloudwatch.py +73 -4
- cartography/intel/aws/ec2/subnets.py +37 -63
- cartography/intel/aws/ecr.py +55 -80
- cartography/intel/aws/elasticache.py +102 -79
- cartography/intel/aws/resourcegroupstaggingapi.py +77 -18
- cartography/intel/aws/secretsmanager.py +62 -44
- cartography/intel/entra/groups.py +29 -1
- cartography/intel/gcp/__init__.py +10 -0
- cartography/intel/gcp/compute.py +19 -42
- cartography/models/aws/cloudtrail/management_events.py +95 -6
- cartography/models/aws/cloudtrail/trail.py +21 -0
- cartography/models/aws/cloudwatch/metric_alarm.py +53 -0
- cartography/models/aws/ec2/subnets.py +65 -0
- cartography/models/aws/ecr/__init__.py +0 -0
- cartography/models/aws/ecr/image.py +41 -0
- cartography/models/aws/ecr/repository.py +72 -0
- cartography/models/aws/ecr/repository_image.py +95 -0
- cartography/models/aws/elasticache/__init__.py +0 -0
- cartography/models/aws/elasticache/cluster.py +65 -0
- cartography/models/aws/elasticache/topic.py +67 -0
- cartography/models/aws/secretsmanager/secret.py +106 -0
- cartography/models/entra/group.py +26 -0
- cartography/models/entra/user.py +6 -0
- cartography/models/gcp/compute/__init__.py +0 -0
- cartography/models/gcp/compute/vpc.py +50 -0
- {cartography-0.108.0rc1.dist-info → cartography-0.109.0rc1.dist-info}/METADATA +1 -1
- {cartography-0.108.0rc1.dist-info → cartography-0.109.0rc1.dist-info}/RECORD +36 -25
- cartography/data/jobs/cleanup/aws_import_secrets_cleanup.json +0 -8
- {cartography-0.108.0rc1.dist-info → cartography-0.109.0rc1.dist-info}/WHEEL +0 -0
- {cartography-0.108.0rc1.dist-info → cartography-0.109.0rc1.dist-info}/entry_points.txt +0 -0
- {cartography-0.108.0rc1.dist-info → cartography-0.109.0rc1.dist-info}/licenses/LICENSE +0 -0
- {cartography-0.108.0rc1.dist-info → cartography-0.109.0rc1.dist-info}/top_level.txt +0 -0
cartography/_version.py
CHANGED
|
@@ -17,5 +17,5 @@ __version__: str
|
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
|
18
18
|
version_tuple: VERSION_TUPLE
|
|
19
19
|
|
|
20
|
-
__version__ = version = '0.
|
|
21
|
-
__version_tuple__ = version_tuple = (0,
|
|
20
|
+
__version__ = version = '0.109.0rc1'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 109, 0, 'rc1')
|
cartography/data/indexes.cypher
CHANGED
|
@@ -259,8 +259,6 @@ CREATE INDEX IF NOT EXISTS FOR (n:S3Bucket) ON (n.id);
|
|
|
259
259
|
CREATE INDEX IF NOT EXISTS FOR (n:S3Bucket) ON (n.name);
|
|
260
260
|
CREATE INDEX IF NOT EXISTS FOR (n:S3Bucket) ON (n.arn);
|
|
261
261
|
CREATE INDEX IF NOT EXISTS FOR (n:S3Bucket) ON (n.lastupdated);
|
|
262
|
-
CREATE INDEX IF NOT EXISTS FOR (n:SecretsManagerSecret) ON (n.id);
|
|
263
|
-
CREATE INDEX IF NOT EXISTS FOR (n:SecretsManagerSecret) ON (n.lastupdated);
|
|
264
262
|
CREATE INDEX IF NOT EXISTS FOR (n:SecurityHub) ON (n.id);
|
|
265
263
|
CREATE INDEX IF NOT EXISTS FOR (n:SecurityHub) ON (n.lastupdated);
|
|
266
264
|
CREATE INDEX IF NOT EXISTS FOR (n:SpotlightVulnerability) ON (n.id);
|
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"statements": [
|
|
3
|
-
{
|
|
4
|
-
"query": "MATCH (n:GCPVpc) WHERE n.lastupdated <> $UPDATE_TAG WITH n LIMIT $LIMIT_SIZE DETACH DELETE (n)",
|
|
5
|
-
"iterative": true,
|
|
6
|
-
"iterationsize": 100,
|
|
7
|
-
"__comment__": "Delete GCP VPCs that no longer exist and detach them from all previously connected nodes."
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"query": "MATCH (:GCPVpc)<-[r:RESOURCE]-(:GCPProject) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
|
|
11
|
-
"iterative": true,
|
|
12
|
-
"iterationsize": 100,
|
|
13
|
-
"__comment__": "Remove GCP VPC-to-Project relationships that are out of date."
|
|
14
|
-
},
|
|
15
3
|
{
|
|
16
4
|
"query": "MATCH (:GCPInstance)-[r:MEMBER_OF_GCP_VPC]->(:GCPVpc) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
|
|
17
5
|
"iterative": true,
|
|
@@ -26,13 +26,25 @@ def get_cloudtrail_trails(
|
|
|
26
26
|
)
|
|
27
27
|
|
|
28
28
|
trails = client.describe_trails()["trailList"]
|
|
29
|
-
|
|
30
|
-
# CloudTrail multi-region trails are shown in list_trails,
|
|
31
|
-
# but the get_trail call only works in the home region
|
|
32
29
|
trails_filtered = [trail for trail in trails if trail.get("HomeRegion") == region]
|
|
30
|
+
|
|
33
31
|
return trails_filtered
|
|
34
32
|
|
|
35
33
|
|
|
34
|
+
def transform_cloudtrail_trails(
|
|
35
|
+
trails: List[Dict[str, Any]], region: str
|
|
36
|
+
) -> List[Dict[str, Any]]:
|
|
37
|
+
"""
|
|
38
|
+
Transform CloudTrail trail data for ingestion
|
|
39
|
+
"""
|
|
40
|
+
for trail in trails:
|
|
41
|
+
arn = trail.get("CloudWatchLogsLogGroupArn")
|
|
42
|
+
if arn:
|
|
43
|
+
trail["CloudWatchLogsLogGroupArn"] = arn.split(":*")[0]
|
|
44
|
+
|
|
45
|
+
return trails
|
|
46
|
+
|
|
47
|
+
|
|
36
48
|
@timeit
|
|
37
49
|
def load_cloudtrail_trails(
|
|
38
50
|
neo4j_session: neo4j.Session,
|
|
@@ -79,7 +91,8 @@ def sync(
|
|
|
79
91
|
logger.info(
|
|
80
92
|
f"Syncing CloudTrail for region '{region}' in account '{current_aws_account_id}'.",
|
|
81
93
|
)
|
|
82
|
-
|
|
94
|
+
trails_filtered = get_cloudtrail_trails(boto3_session, region)
|
|
95
|
+
trails = transform_cloudtrail_trails(trails_filtered, region)
|
|
83
96
|
|
|
84
97
|
load_cloudtrail_trails(
|
|
85
98
|
neo4j_session,
|