cartography 0.108.0rc2__py3-none-any.whl → 0.109.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.

Files changed (63) hide show
  1. cartography/_version.py +2 -2
  2. cartography/data/indexes.cypher +0 -17
  3. cartography/data/jobs/cleanup/gcp_compute_vpc_cleanup.json +0 -12
  4. cartography/intel/aws/cloudtrail_management_events.py +36 -3
  5. cartography/intel/aws/ecr.py +55 -80
  6. cartography/intel/aws/glue.py +117 -0
  7. cartography/intel/aws/identitycenter.py +71 -23
  8. cartography/intel/aws/kms.py +160 -200
  9. cartography/intel/aws/lambda_function.py +206 -190
  10. cartography/intel/aws/rds.py +243 -458
  11. cartography/intel/aws/resourcegroupstaggingapi.py +77 -18
  12. cartography/intel/aws/resources.py +2 -0
  13. cartography/intel/aws/route53.py +334 -332
  14. cartography/intel/aws/secretsmanager.py +62 -44
  15. cartography/intel/entra/groups.py +29 -1
  16. cartography/intel/gcp/__init__.py +10 -0
  17. cartography/intel/gcp/compute.py +19 -42
  18. cartography/models/aws/ecr/__init__.py +0 -0
  19. cartography/models/aws/ecr/image.py +41 -0
  20. cartography/models/aws/ecr/repository.py +72 -0
  21. cartography/models/aws/ecr/repository_image.py +95 -0
  22. cartography/models/aws/glue/__init__.py +0 -0
  23. cartography/models/aws/glue/connection.py +51 -0
  24. cartography/models/aws/identitycenter/awspermissionset.py +44 -0
  25. cartography/models/aws/kms/__init__.py +0 -0
  26. cartography/models/aws/kms/aliases.py +86 -0
  27. cartography/models/aws/kms/grants.py +65 -0
  28. cartography/models/aws/kms/keys.py +88 -0
  29. cartography/models/aws/lambda_function/__init__.py +0 -0
  30. cartography/models/aws/lambda_function/alias.py +74 -0
  31. cartography/models/aws/lambda_function/event_source_mapping.py +88 -0
  32. cartography/models/aws/lambda_function/lambda_function.py +89 -0
  33. cartography/models/aws/lambda_function/layer.py +72 -0
  34. cartography/models/aws/rds/__init__.py +0 -0
  35. cartography/models/aws/rds/cluster.py +89 -0
  36. cartography/models/aws/rds/instance.py +154 -0
  37. cartography/models/aws/rds/snapshot.py +108 -0
  38. cartography/models/aws/rds/subnet_group.py +101 -0
  39. cartography/models/aws/route53/__init__.py +0 -0
  40. cartography/models/aws/route53/dnsrecord.py +214 -0
  41. cartography/models/aws/route53/nameserver.py +63 -0
  42. cartography/models/aws/route53/subzone.py +40 -0
  43. cartography/models/aws/route53/zone.py +47 -0
  44. cartography/models/aws/secretsmanager/secret.py +106 -0
  45. cartography/models/entra/group.py +26 -0
  46. cartography/models/entra/user.py +6 -0
  47. cartography/models/gcp/compute/__init__.py +0 -0
  48. cartography/models/gcp/compute/vpc.py +50 -0
  49. cartography/util.py +8 -1
  50. {cartography-0.108.0rc2.dist-info → cartography-0.109.0rc2.dist-info}/METADATA +2 -2
  51. {cartography-0.108.0rc2.dist-info → cartography-0.109.0rc2.dist-info}/RECORD +55 -34
  52. cartography/data/jobs/cleanup/aws_dns_cleanup.json +0 -65
  53. cartography/data/jobs/cleanup/aws_import_identity_center_cleanup.json +0 -16
  54. cartography/data/jobs/cleanup/aws_import_lambda_cleanup.json +0 -50
  55. cartography/data/jobs/cleanup/aws_import_rds_clusters_cleanup.json +0 -23
  56. cartography/data/jobs/cleanup/aws_import_rds_instances_cleanup.json +0 -47
  57. cartography/data/jobs/cleanup/aws_import_rds_snapshots_cleanup.json +0 -23
  58. cartography/data/jobs/cleanup/aws_import_secrets_cleanup.json +0 -8
  59. cartography/data/jobs/cleanup/aws_kms_details.json +0 -10
  60. {cartography-0.108.0rc2.dist-info → cartography-0.109.0rc2.dist-info}/WHEEL +0 -0
  61. {cartography-0.108.0rc2.dist-info → cartography-0.109.0rc2.dist-info}/entry_points.txt +0 -0
  62. {cartography-0.108.0rc2.dist-info → cartography-0.109.0rc2.dist-info}/licenses/LICENSE +0 -0
  63. {cartography-0.108.0rc2.dist-info → cartography-0.109.0rc2.dist-info}/top_level.txt +0 -0
@@ -1,65 +0,0 @@
1
- {
2
- "statements": [
3
- {
4
- "query": "MATCH (n:AWSDNSRecord)-[:MEMBER_OF_DNS_ZONE]->(:AWSDNSZone)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE n.lastupdated <> $UPDATE_TAG WITH n LIMIT $LIMIT_SIZE DETACH DELETE (n)",
5
- "iterative": true,
6
- "iterationsize": 100,
7
- "__comment__": "cleanup AWS DNS Records linked to current account"
8
- },
9
- {
10
- "query": "MATCH (n:AWSDNSZone)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE n.lastupdated <> $UPDATE_TAG WITH n LIMIT $LIMIT_SIZE DETACH DELETE (n)",
11
- "iterative": true,
12
- "iterationsize": 100
13
- },
14
- {
15
- "query": "MATCH (n:NameServer)-[:NAMESERVER]->(:DNSZone)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE n.lastupdated <> $UPDATE_TAG WITH n LIMIT $LIMIT_SIZE DETACH DELETE (n)",
16
- "iterative": true,
17
- "iterationsize": 100
18
- },
19
- {
20
- "query": "MATCH (:AWSDNSRecord)<-[r:DNS_POINTS_TO]-(:AWSDNSRecord)-[:MEMBER_OF_DNS_ZONE]->(:AWSDNSZone)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
21
- "iterative": true,
22
- "iterationsize": 100,
23
- "__comment__": "Clean up AWSDNSRecords pointing to other AWSDNSRecords within the current AWS account"
24
- },
25
- {
26
- "query": "MATCH (:LoadBalancer)<-[r:DNS_POINTS_TO]-(:AWSDNSRecord)-[:MEMBER_OF_DNS_ZONE]->(:AWSDNSZone)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
27
- "iterative": true,
28
- "iterationsize": 100,
29
- "__comment__": "Clean up AWSDNSRecords pointing to LoadBalancers within the current AWS account"
30
- },
31
- {
32
- "query": "MATCH (:EC2Instance)<-[r:DNS_POINTS_TO]-(:AWSDNSRecord)-[:MEMBER_OF_DNS_ZONE]->(:AWSDNSZone)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
33
- "iterative": true,
34
- "iterationsize": 100,
35
- "__comment__": "Clean up AWSDNSRecords pointing to EC2 Instances within the current AWS account"
36
- },
37
- {
38
- "query": "MATCH (:NameServer)<-[r:DNS_POINTS_TO]-(:AWSDNSRecord)-[:MEMBER_OF_DNS_ZONE]->(:AWSDNSZone)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
39
- "iterative": true,
40
- "iterationsize": 100,
41
- "__comment__": "Clean up AWSDNSRecords pointing to NameServers within the current AWS account"
42
- },
43
- {
44
- "query": "MATCH (:AWSDNSZone)-[r:NAMESERVER]->(:NameServer)-[:NAMESERVER]->(:DNSZone)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
45
- "iterative": true,
46
- "iterationsize": 100
47
- },
48
- {
49
- "query": "MATCH (:AWSDNSZone)<-[r:SUBZONE]-(:AWSDNSZone)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
50
- "iterative": true,
51
- "iterationsize": 100
52
- },
53
- {
54
- "query": "MATCH (:ESDomain)<-[r:DNS_POINTS_TO]-(:DNSRecord)-[:MEMBER_OF_DNS_ZONE]->(:AWSDNSZone)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
55
- "iterative": true,
56
- "iterationsize": 100
57
- },
58
- {
59
- "query": "MATCH (:Ip)<-[r:DNS_POINTS_TO]-(:AWSDNSRecord)-[:MEMBER_OF_DNS_ZONE]->(:AWSDNSZone)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
60
- "iterative": true,
61
- "iterationsize": 100
62
- }
63
- ],
64
- "name": "cleanup AWS DNS"
65
- }
@@ -1,16 +0,0 @@
1
- {
2
- "statements": [
3
-
4
- {
5
- "query": "MATCH (:AWSAccount{id: $AWS_ID})-[:RESOURCE]->(:AWSSSOUser)<-[r:CAN_ASSUME_IDENTITY]-(:OktaUser) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r) RETURN COUNT(*) as TotalDeleted",
6
- "iterative": true,
7
- "iterationsize": 100
8
- },
9
- {
10
- "query": "MATCH (:AWSAccount{id: $AWS_ID})-[:RESOURCE]->(:AWSRole)-[r:ALLOWED_BY]->(:AWSSSOUser) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r) RETURN COUNT(*) as TotalDeleted",
11
- "iterative": true,
12
- "iterationsize": 100
13
- }
14
- ],
15
- "name": "cleanup AWS Identity Center Instances and Related Data"
16
- }
@@ -1,50 +0,0 @@
1
- {
2
- "statements": [
3
- {
4
- "query": "MATCH (n:AWSLambdaFunctionAlias)<-[:KNOWN_AS]-(:AWSLambda)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE n.lastupdated <> $UPDATE_TAG WITH n LIMIT $LIMIT_SIZE DETACH DELETE (n)",
5
- "iterative": true,
6
- "iterationsize": 100
7
- },
8
- {
9
- "query": "MATCH (:AWSLambdaFunctionAlias)<-[r:KNOWN_AS]-(:AWSLambda)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
10
- "iterative": true,
11
- "iterationsize": 100
12
- },
13
- {
14
- "query": "MATCH (n:AWSLambdaEventSourceMapping)<-[:RESOURCE]-(:AWSLambda)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE n.lastupdated <> $UPDATE_TAG WITH n LIMIT $LIMIT_SIZE DETACH DELETE (n)",
15
- "iterative": true,
16
- "iterationsize": 100
17
- },
18
- {
19
- "query": "MATCH (:AWSLambdaEventSourceMapping)<-[r:RESOURCE]-(:AWSLambda)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
20
- "iterative": true,
21
- "iterationsize": 100
22
- },
23
- {
24
- "query": "MATCH (n:AWSLambdaLayer)<-[:HAS]-(:AWSLambda)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE n.lastupdated <> $UPDATE_TAG WITH n LIMIT $LIMIT_SIZE DETACH DELETE (n)",
25
- "iterative": true,
26
- "iterationsize": 100
27
- },
28
- {
29
- "query": "MATCH (:AWSLambdaLayer)<-[r:HAS]-(:AWSLambda)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
30
- "iterative": true,
31
- "iterationsize": 100
32
- },
33
- {
34
- "query": "MATCH (:AWSAccount{id: $AWS_ID})-[:RESOURCE]->(:AWSLambda)-[r:STS_ASSUMEROLE_ALLOW]->(:AWSPrincipal) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE r",
35
- "iterative": true,
36
- "iterationsize": 100
37
- },
38
- {
39
- "query": "MATCH (:AWSAccount{id: $AWS_ID})-[:RESOURCE]->(n:AWSLambda) WHERE n.lastupdated <> $UPDATE_TAG WITH n LIMIT $LIMIT_SIZE DETACH DELETE (n)",
40
- "iterative": true,
41
- "iterationsize": 100
42
- },
43
- {
44
- "query": "MATCH (:AWSAccount{id: $AWS_ID})-[r:RESOURCE]->(:AWSLambda) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
45
- "iterative": true,
46
- "iterationsize": 100
47
- }
48
- ],
49
- "name": "cleanup AWSLambda"
50
- }
@@ -1,23 +0,0 @@
1
- {
2
- "statements": [
3
- {
4
- "query": "MATCH (n:RDSCluster)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE n.lastupdated <> $UPDATE_TAG WITH n LIMIT $LIMIT_SIZE DETACH DELETE (n)",
5
- "iterative": true,
6
- "iterationsize": 100,
7
- "__comment__": "Delete RDS clusters that no longer exist and DETACH them from all nodes they were previously connected to."
8
- },
9
- {
10
- "query": "MATCH (:RDSCluster)<-[r:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
11
- "iterative": true,
12
- "iterationsize": 100,
13
- "__comment__": "If an RDS cluster still exists but is no longer associated with its old AWS Account, delete the relationship between them."
14
- },
15
- {
16
- "query": "MATCH (:RDSCluster)<-[r:IS_CLUSTER_MEMBER_OF]-(:RDSInstance)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
17
- "iterative": true,
18
- "iterationsize": 100,
19
- "__comment__": "If an RDS instance still exists and is no longer a member of an RDS cluster, delete the relationship between them."
20
- }
21
- ],
22
- "name": "cleanup RDSCluster"
23
- }
@@ -1,47 +0,0 @@
1
- {
2
- "statements": [
3
- {
4
- "query": "MATCH (sng:DBSubnetGroup)<-[:MEMBER_OF_DB_SUBNET_GROUP]-(:RDSInstance)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE sng.lastupdated <> $UPDATE_TAG WITH sng LIMIT $LIMIT_SIZE DETACH DELETE (sng)",
5
- "iterative": true,
6
- "iterationsize": 100,
7
- "__comment__": "Delete DBSubnetGroups that no longer exist and DETACH them from their RDS instances."
8
- },
9
- {
10
- "query": "MATCH (:DBSubnetGroup)<-[r:MEMBER_OF_DB_SUBNET_GROUP]-(:RDSInstance)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
11
- "iterative": true,
12
- "iterationsize": 100,
13
- "__comment__": "Delete the link between orphaned DB Subnet Groups and their RDS Instances."
14
- },
15
- {
16
- "query": "MATCH (:EC2Subnet)<-[r:RESOURCE]-(:DBSubnetGroup)<-[:MEMBER_OF_DB_SUBNET_GROUP]-(:RDSInstance)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
17
- "iterative": true,
18
- "iterationsize": 100,
19
- "__comment__": "Delete the link between orphaned DB Subnet Groups and their EC2 Subnets."
20
- },
21
- {
22
- "query": "MATCH (n:RDSInstance)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE n.lastupdated <> $UPDATE_TAG WITH n LIMIT $LIMIT_SIZE DETACH DELETE (n)",
23
- "iterative": true,
24
- "iterationsize": 100,
25
- "__comment__": "Delete RDS instances that no longer exist and DETACH them from all nodes they were previously connected to."
26
- },
27
- {
28
- "query": "MATCH (:RDSInstance)<-[r:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
29
- "iterative": true,
30
- "iterationsize": 100,
31
- "__comment__": "If an RDS instance still exists but is no longer associated with its old AWS Account, delete the relationship between them."
32
- },
33
- {
34
- "query": "MATCH (:EC2SecurityGroup)<-[r:MEMBER_OF_EC2_SECURITY_GROUP]-(:RDSInstance)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
35
- "iterative": true,
36
- "iterationsize": 100,
37
- "__comment__": "If an RDS instance still exists and is no longer a part of its old EC2SecurityGroup, delete the relationship between them."
38
- },
39
- {
40
- "query": "MATCH (:RDSInstance)<-[r:IS_READ_REPLICA_OF]-(:RDSInstance)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
41
- "iterative": true,
42
- "iterationsize": 100,
43
- "__comment__": "If an RDS instance still exists and is no longer a read replica of another RDS instance, delete the relationship between them."
44
- }
45
- ],
46
- "name": "cleanup RDSInstance"
47
- }
@@ -1,23 +0,0 @@
1
- {
2
- "statements": [
3
- {
4
- "query": "MATCH (n:RDSSnapshot)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE n.lastupdated <> $UPDATE_TAG WITH n LIMIT $LIMIT_SIZE DETACH DELETE (n)",
5
- "iterative": true,
6
- "iterationsize": 100,
7
- "__comment__": "Delete RDS snapshots that no longer exist and DETACH them from all nodes they were previously connected to."
8
- },
9
- {
10
- "query": "MATCH (:RDSSnapshot)<-[r:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
11
- "iterative": true,
12
- "iterationsize": 100,
13
- "__comment__": "If an RDS snapshot still exists but is no longer associated with its old AWS Account, delete the relationship between them."
14
- },
15
- {
16
- "query": "MATCH (:RDSInstance)<-[r:IS_SNAPSHOT_SOURCE]-(:RDSSnapshot)<-[:RESOURCE]-(:AWSAccount{id: $AWS_ID}) WHERE r.lastupdated <> $UPDATE_TAG WITH r LIMIT $LIMIT_SIZE DELETE (r)",
17
- "iterative": true,
18
- "iterationsize": 100,
19
- "__comment__": "If an RDS snapshot still exists and is no longer a member of an RDS instance, delete the relationship between them."
20
- }
21
- ],
22
- "name": "cleanup RDSSnapshot"
23
- }
@@ -1,8 +0,0 @@
1
- {
2
- "statements": [{
3
- "query": "MATCH (:AWSAccount{id: $AWS_ID})-[:RESOURCE]->(s:SecretsManagerSecret) WHERE s.lastupdated <> $UPDATE_TAG WITH s LIMIT $LIMIT_SIZE DETACH DELETE (s)",
4
- "iterative": true,
5
- "iterationsize": 100
6
- }],
7
- "name": "cleanup SecretsManagerSecret"
8
- }
@@ -1,10 +0,0 @@
1
- {
2
- "statements": [
3
- {
4
- "query": "MATCH (:AWSAccount{id: $AWS_ID})-[:RESOURCE]->(s:KMSKey) WHERE s.anonymous_access IS NOT NULL\n WITH s LIMIT $LIMIT_SIZE\nREMOVE s.anonymous_access, s.anonymous_actions",
5
- "iterative": true,
6
- "iterationsize": 100
7
- }
8
- ],
9
- "name": "AWS KMS Key Exposure Details"
10
- }