cartography 0.108.0rc1__py3-none-any.whl → 0.108.0rc2__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/intel/aws/cloudtrail.py +17 -4
- cartography/intel/aws/cloudtrail_management_events.py +560 -16
- cartography/intel/aws/cloudwatch.py +73 -4
- cartography/intel/aws/ec2/subnets.py +37 -63
- cartography/intel/aws/elasticache.py +102 -79
- 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/elasticache/__init__.py +0 -0
- cartography/models/aws/elasticache/cluster.py +65 -0
- cartography/models/aws/elasticache/topic.py +67 -0
- {cartography-0.108.0rc1.dist-info → cartography-0.108.0rc2.dist-info}/METADATA +1 -1
- {cartography-0.108.0rc1.dist-info → cartography-0.108.0rc2.dist-info}/RECORD +19 -14
- {cartography-0.108.0rc1.dist-info → cartography-0.108.0rc2.dist-info}/WHEEL +0 -0
- {cartography-0.108.0rc1.dist-info → cartography-0.108.0rc2.dist-info}/entry_points.txt +0 -0
- {cartography-0.108.0rc1.dist-info → cartography-0.108.0rc2.dist-info}/licenses/LICENSE +0 -0
- {cartography-0.108.0rc1.dist-info → cartography-0.108.0rc2.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.108.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 108, 0, '
|
|
20
|
+
__version__ = version = '0.108.0rc2'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 108, 0, 'rc2')
|
|
@@ -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,
|