cartography 0.109.0rc1__py3-none-any.whl → 0.110.0__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 (78) hide show
  1. cartography/_version.py +2 -2
  2. cartography/cli.py +14 -0
  3. cartography/config.py +4 -0
  4. cartography/data/indexes.cypher +0 -15
  5. cartography/data/jobs/analysis/aws_ec2_keypair_analysis.json +2 -2
  6. cartography/intel/aws/cloudtrail_management_events.py +21 -0
  7. cartography/intel/aws/cognito.py +201 -0
  8. cartography/intel/aws/ecs.py +7 -1
  9. cartography/intel/aws/eventbridge.py +91 -0
  10. cartography/intel/aws/glue.py +181 -0
  11. cartography/intel/aws/identitycenter.py +71 -23
  12. cartography/intel/aws/kms.py +173 -201
  13. cartography/intel/aws/lambda_function.py +206 -190
  14. cartography/intel/aws/rds.py +335 -445
  15. cartography/intel/aws/resources.py +6 -0
  16. cartography/intel/aws/route53.py +336 -332
  17. cartography/intel/aws/s3.py +104 -0
  18. cartography/intel/github/__init__.py +21 -25
  19. cartography/intel/github/repos.py +4 -36
  20. cartography/intel/kubernetes/__init__.py +4 -0
  21. cartography/intel/kubernetes/rbac.py +464 -0
  22. cartography/intel/kubernetes/util.py +17 -0
  23. cartography/intel/trivy/__init__.py +73 -13
  24. cartography/intel/trivy/scanner.py +115 -92
  25. cartography/models/aws/cognito/__init__.py +0 -0
  26. cartography/models/aws/cognito/identity_pool.py +70 -0
  27. cartography/models/aws/cognito/user_pool.py +47 -0
  28. cartography/models/aws/ec2/security_groups.py +1 -1
  29. cartography/models/aws/ecs/services.py +17 -0
  30. cartography/models/aws/ecs/tasks.py +1 -0
  31. cartography/models/aws/eventbridge/__init__.py +0 -0
  32. cartography/models/aws/eventbridge/rule.py +77 -0
  33. cartography/models/aws/glue/__init__.py +0 -0
  34. cartography/models/aws/glue/connection.py +51 -0
  35. cartography/models/aws/glue/job.py +69 -0
  36. cartography/models/aws/identitycenter/awspermissionset.py +44 -0
  37. cartography/models/aws/kms/__init__.py +0 -0
  38. cartography/models/aws/kms/aliases.py +86 -0
  39. cartography/models/aws/kms/grants.py +65 -0
  40. cartography/models/aws/kms/keys.py +88 -0
  41. cartography/models/aws/lambda_function/__init__.py +0 -0
  42. cartography/models/aws/lambda_function/alias.py +74 -0
  43. cartography/models/aws/lambda_function/event_source_mapping.py +88 -0
  44. cartography/models/aws/lambda_function/lambda_function.py +89 -0
  45. cartography/models/aws/lambda_function/layer.py +72 -0
  46. cartography/models/aws/rds/__init__.py +0 -0
  47. cartography/models/aws/rds/cluster.py +89 -0
  48. cartography/models/aws/rds/event_subscription.py +146 -0
  49. cartography/models/aws/rds/instance.py +154 -0
  50. cartography/models/aws/rds/snapshot.py +108 -0
  51. cartography/models/aws/rds/subnet_group.py +101 -0
  52. cartography/models/aws/route53/__init__.py +0 -0
  53. cartography/models/aws/route53/dnsrecord.py +235 -0
  54. cartography/models/aws/route53/nameserver.py +63 -0
  55. cartography/models/aws/route53/subzone.py +40 -0
  56. cartography/models/aws/route53/zone.py +47 -0
  57. cartography/models/github/dependencies.py +1 -2
  58. cartography/models/kubernetes/clusterrolebindings.py +98 -0
  59. cartography/models/kubernetes/clusterroles.py +52 -0
  60. cartography/models/kubernetes/rolebindings.py +119 -0
  61. cartography/models/kubernetes/roles.py +76 -0
  62. cartography/models/kubernetes/serviceaccounts.py +77 -0
  63. cartography/models/snipeit/asset.py +1 -0
  64. cartography/util.py +8 -1
  65. {cartography-0.109.0rc1.dist-info → cartography-0.110.0.dist-info}/METADATA +3 -3
  66. {cartography-0.109.0rc1.dist-info → cartography-0.110.0.dist-info}/RECORD +71 -41
  67. cartography/data/jobs/cleanup/aws_dns_cleanup.json +0 -65
  68. cartography/data/jobs/cleanup/aws_import_identity_center_cleanup.json +0 -16
  69. cartography/data/jobs/cleanup/aws_import_lambda_cleanup.json +0 -50
  70. cartography/data/jobs/cleanup/aws_import_rds_clusters_cleanup.json +0 -23
  71. cartography/data/jobs/cleanup/aws_import_rds_instances_cleanup.json +0 -47
  72. cartography/data/jobs/cleanup/aws_import_rds_snapshots_cleanup.json +0 -23
  73. cartography/data/jobs/cleanup/aws_kms_details.json +0 -10
  74. /cartography/data/jobs/{analysis → scoped_analysis}/aws_s3acl_analysis.json +0 -0
  75. {cartography-0.109.0rc1.dist-info → cartography-0.110.0.dist-info}/WHEEL +0 -0
  76. {cartography-0.109.0rc1.dist-info → cartography-0.110.0.dist-info}/entry_points.txt +0 -0
  77. {cartography-0.109.0rc1.dist-info → cartography-0.110.0.dist-info}/licenses/LICENSE +0 -0
  78. {cartography-0.109.0rc1.dist-info → cartography-0.110.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,146 @@
1
+ from dataclasses import dataclass
2
+
3
+ from cartography.models.core.common import PropertyRef
4
+ from cartography.models.core.nodes import CartographyNodeProperties
5
+ from cartography.models.core.nodes import CartographyNodeSchema
6
+ from cartography.models.core.relationships import CartographyRelProperties
7
+ from cartography.models.core.relationships import CartographyRelSchema
8
+ from cartography.models.core.relationships import LinkDirection
9
+ from cartography.models.core.relationships import make_target_node_matcher
10
+ from cartography.models.core.relationships import OtherRelationships
11
+ from cartography.models.core.relationships import TargetNodeMatcher
12
+
13
+
14
+ @dataclass(frozen=True)
15
+ class RDSEventSubscriptionNodeProperties(CartographyNodeProperties):
16
+ id: PropertyRef = PropertyRef("CustSubscriptionId")
17
+ arn: PropertyRef = PropertyRef("EventSubscriptionArn", extra_index=True)
18
+ customer_aws_id: PropertyRef = PropertyRef("CustomerAwsId")
19
+ sns_topic_arn: PropertyRef = PropertyRef("SnsTopicArn")
20
+ source_type: PropertyRef = PropertyRef("SourceType")
21
+ status: PropertyRef = PropertyRef("Status")
22
+ enabled: PropertyRef = PropertyRef("Enabled")
23
+ subscription_creation_time: PropertyRef = PropertyRef("SubscriptionCreationTime")
24
+ event_categories: PropertyRef = PropertyRef("event_categories", one_to_many=True)
25
+ source_ids: PropertyRef = PropertyRef("source_ids", one_to_many=True)
26
+ region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
27
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
28
+
29
+
30
+ @dataclass(frozen=True)
31
+ class RDSEventSubscriptionToAWSAccountRelProperties(CartographyRelProperties):
32
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
33
+
34
+
35
+ @dataclass(frozen=True)
36
+ class RDSEventSubscriptionToAWSAccountRel(CartographyRelSchema):
37
+ target_node_label: str = "AWSAccount"
38
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
39
+ {
40
+ "id": PropertyRef("AWS_ID", set_in_kwargs=True),
41
+ }
42
+ )
43
+ direction: LinkDirection = LinkDirection.INWARD
44
+ rel_label: str = "RESOURCE"
45
+ properties: RDSEventSubscriptionToAWSAccountRelProperties = (
46
+ RDSEventSubscriptionToAWSAccountRelProperties()
47
+ )
48
+
49
+
50
+ @dataclass(frozen=True)
51
+ class RDSEventSubscriptionToSNSTopicRelProperties(CartographyRelProperties):
52
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
53
+
54
+
55
+ @dataclass(frozen=True)
56
+ class RDSEventSubscriptionToSNSTopicRel(CartographyRelSchema):
57
+ target_node_label: str = "SNSTopic"
58
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
59
+ {
60
+ "arn": PropertyRef("SnsTopicArn"),
61
+ }
62
+ )
63
+ direction: LinkDirection = LinkDirection.OUTWARD
64
+ rel_label: str = "NOTIFIES"
65
+ properties: RDSEventSubscriptionToSNSTopicRelProperties = (
66
+ RDSEventSubscriptionToSNSTopicRelProperties()
67
+ )
68
+
69
+
70
+ @dataclass(frozen=True)
71
+ class RDSEventSubscriptionToRDSInstanceRelProperties(CartographyRelProperties):
72
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
73
+
74
+
75
+ @dataclass(frozen=True)
76
+ class RDSEventSubscriptionToRDSInstanceRel(CartographyRelSchema):
77
+ target_node_label: str = "RDSInstance"
78
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
79
+ {
80
+ "db_instance_identifier": PropertyRef("source_ids", one_to_many=True),
81
+ }
82
+ )
83
+ direction: LinkDirection = LinkDirection.OUTWARD
84
+ rel_label: str = "MONITORS"
85
+ properties: RDSEventSubscriptionToRDSInstanceRelProperties = (
86
+ RDSEventSubscriptionToRDSInstanceRelProperties()
87
+ )
88
+
89
+
90
+ @dataclass(frozen=True)
91
+ class RDSEventSubscriptionToRDSClusterRelProperties(CartographyRelProperties):
92
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
93
+
94
+
95
+ @dataclass(frozen=True)
96
+ class RDSEventSubscriptionToRDSClusterRel(CartographyRelSchema):
97
+ target_node_label: str = "RDSCluster"
98
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
99
+ {
100
+ "db_cluster_identifier": PropertyRef("source_ids", one_to_many=True),
101
+ }
102
+ )
103
+ direction: LinkDirection = LinkDirection.OUTWARD
104
+ rel_label: str = "MONITORS"
105
+ properties: RDSEventSubscriptionToRDSClusterRelProperties = (
106
+ RDSEventSubscriptionToRDSClusterRelProperties()
107
+ )
108
+
109
+
110
+ @dataclass(frozen=True)
111
+ class RDSEventSubscriptionToRDSSnapshotRelProperties(CartographyRelProperties):
112
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
113
+
114
+
115
+ @dataclass(frozen=True)
116
+ class RDSEventSubscriptionToRDSSnapshotRel(CartographyRelSchema):
117
+ target_node_label: str = "RDSSnapshot"
118
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
119
+ {
120
+ "db_snapshot_identifier": PropertyRef("source_ids", one_to_many=True),
121
+ }
122
+ )
123
+ direction: LinkDirection = LinkDirection.OUTWARD
124
+ rel_label: str = "MONITORS"
125
+ properties: RDSEventSubscriptionToRDSSnapshotRelProperties = (
126
+ RDSEventSubscriptionToRDSSnapshotRelProperties()
127
+ )
128
+
129
+
130
+ @dataclass(frozen=True)
131
+ class RDSEventSubscriptionSchema(CartographyNodeSchema):
132
+ label: str = "RDSEventSubscription"
133
+ properties: RDSEventSubscriptionNodeProperties = (
134
+ RDSEventSubscriptionNodeProperties()
135
+ )
136
+ sub_resource_relationship: RDSEventSubscriptionToAWSAccountRel = (
137
+ RDSEventSubscriptionToAWSAccountRel()
138
+ )
139
+ other_relationships: OtherRelationships = OtherRelationships(
140
+ [
141
+ RDSEventSubscriptionToSNSTopicRel(),
142
+ RDSEventSubscriptionToRDSInstanceRel(),
143
+ RDSEventSubscriptionToRDSClusterRel(),
144
+ RDSEventSubscriptionToRDSSnapshotRel(),
145
+ ]
146
+ )
@@ -0,0 +1,154 @@
1
+ from dataclasses import dataclass
2
+
3
+ from cartography.models.core.common import PropertyRef
4
+ from cartography.models.core.nodes import CartographyNodeProperties
5
+ from cartography.models.core.nodes import CartographyNodeSchema
6
+ from cartography.models.core.relationships import CartographyRelProperties
7
+ from cartography.models.core.relationships import CartographyRelSchema
8
+ from cartography.models.core.relationships import LinkDirection
9
+ from cartography.models.core.relationships import make_target_node_matcher
10
+ from cartography.models.core.relationships import OtherRelationships
11
+ from cartography.models.core.relationships import TargetNodeMatcher
12
+
13
+
14
+ @dataclass(frozen=True)
15
+ class RDSInstanceNodeProperties(CartographyNodeProperties):
16
+ id: PropertyRef = PropertyRef("DBInstanceArn")
17
+ arn: PropertyRef = PropertyRef("DBInstanceArn", extra_index=True)
18
+ db_instance_identifier: PropertyRef = PropertyRef(
19
+ "DBInstanceIdentifier", extra_index=True
20
+ )
21
+ db_instance_class: PropertyRef = PropertyRef("DBInstanceClass")
22
+ engine: PropertyRef = PropertyRef("Engine")
23
+ master_username: PropertyRef = PropertyRef("MasterUsername")
24
+ db_name: PropertyRef = PropertyRef("DBName")
25
+ instance_create_time: PropertyRef = PropertyRef("InstanceCreateTime")
26
+ availability_zone: PropertyRef = PropertyRef("AvailabilityZone")
27
+ multi_az: PropertyRef = PropertyRef("MultiAZ")
28
+ engine_version: PropertyRef = PropertyRef("EngineVersion")
29
+ publicly_accessible: PropertyRef = PropertyRef("PubliclyAccessible")
30
+ db_cluster_identifier: PropertyRef = PropertyRef("DBClusterIdentifier")
31
+ storage_encrypted: PropertyRef = PropertyRef("StorageEncrypted")
32
+ kms_key_id: PropertyRef = PropertyRef("KmsKeyId")
33
+ dbi_resource_id: PropertyRef = PropertyRef("DbiResourceId")
34
+ ca_certificate_identifier: PropertyRef = PropertyRef("CACertificateIdentifier")
35
+ enhanced_monitoring_resource_arn: PropertyRef = PropertyRef(
36
+ "EnhancedMonitoringResourceArn"
37
+ )
38
+ monitoring_role_arn: PropertyRef = PropertyRef("MonitoringRoleArn")
39
+ performance_insights_enabled: PropertyRef = PropertyRef(
40
+ "PerformanceInsightsEnabled"
41
+ )
42
+ performance_insights_kms_key_id: PropertyRef = PropertyRef(
43
+ "PerformanceInsightsKMSKeyId"
44
+ )
45
+ region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
46
+ deletion_protection: PropertyRef = PropertyRef("DeletionProtection")
47
+ preferred_backup_window: PropertyRef = PropertyRef("PreferredBackupWindow")
48
+ latest_restorable_time: PropertyRef = PropertyRef("LatestRestorableTime")
49
+ preferred_maintenance_window: PropertyRef = PropertyRef(
50
+ "PreferredMaintenanceWindow"
51
+ )
52
+ backup_retention_period: PropertyRef = PropertyRef("BackupRetentionPeriod")
53
+ endpoint_address: PropertyRef = PropertyRef("EndpointAddress")
54
+ endpoint_hostedzoneid: PropertyRef = PropertyRef("EndpointHostedZoneId")
55
+ endpoint_port: PropertyRef = PropertyRef("EndpointPort")
56
+ iam_database_authentication_enabled: PropertyRef = PropertyRef(
57
+ "IAMDatabaseAuthenticationEnabled"
58
+ )
59
+ auto_minor_version_upgrade: PropertyRef = PropertyRef("AutoMinorVersionUpgrade")
60
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
61
+
62
+
63
+ @dataclass(frozen=True)
64
+ class RDSInstanceToAWSAccountRelProperties(CartographyRelProperties):
65
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
66
+
67
+
68
+ @dataclass(frozen=True)
69
+ class RDSInstanceToAWSAccountRel(CartographyRelSchema):
70
+ target_node_label: str = "AWSAccount"
71
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
72
+ {
73
+ "id": PropertyRef("AWS_ID", set_in_kwargs=True),
74
+ }
75
+ )
76
+ direction: LinkDirection = LinkDirection.INWARD
77
+ rel_label: str = "RESOURCE"
78
+ properties: RDSInstanceToAWSAccountRelProperties = (
79
+ RDSInstanceToAWSAccountRelProperties()
80
+ )
81
+
82
+
83
+ @dataclass(frozen=True)
84
+ class RDSInstanceToEC2SecurityGroupRelProperties(CartographyRelProperties):
85
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
86
+
87
+
88
+ @dataclass(frozen=True)
89
+ class RDSInstanceToEC2SecurityGroupRel(CartographyRelSchema):
90
+ target_node_label: str = "EC2SecurityGroup"
91
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
92
+ {
93
+ "id": PropertyRef("security_group_ids", one_to_many=True),
94
+ }
95
+ )
96
+ direction: LinkDirection = LinkDirection.OUTWARD
97
+ rel_label: str = "MEMBER_OF_EC2_SECURITY_GROUP"
98
+ properties: RDSInstanceToEC2SecurityGroupRelProperties = (
99
+ RDSInstanceToEC2SecurityGroupRelProperties()
100
+ )
101
+
102
+
103
+ @dataclass(frozen=True)
104
+ class RDSInstanceToRDSInstanceRelProperties(CartographyRelProperties):
105
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
106
+
107
+
108
+ @dataclass(frozen=True)
109
+ class RDSInstanceToRDSInstanceRel(CartographyRelSchema):
110
+ target_node_label: str = "RDSInstance"
111
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
112
+ {
113
+ "db_instance_identifier": PropertyRef("read_replica_source_identifier"),
114
+ }
115
+ )
116
+ direction: LinkDirection = LinkDirection.OUTWARD
117
+ rel_label: str = "IS_READ_REPLICA_OF"
118
+ properties: RDSInstanceToRDSInstanceRelProperties = (
119
+ RDSInstanceToRDSInstanceRelProperties()
120
+ )
121
+
122
+
123
+ @dataclass(frozen=True)
124
+ class RDSInstanceToRDSClusterRelProperties(CartographyRelProperties):
125
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
126
+
127
+
128
+ @dataclass(frozen=True)
129
+ class RDSInstanceToRDSClusterRel(CartographyRelSchema):
130
+ target_node_label: str = "RDSCluster"
131
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
132
+ {
133
+ "db_cluster_identifier": PropertyRef("db_cluster_identifier"),
134
+ }
135
+ )
136
+ direction: LinkDirection = LinkDirection.OUTWARD
137
+ rel_label: str = "IS_CLUSTER_MEMBER_OF"
138
+ properties: RDSInstanceToRDSClusterRelProperties = (
139
+ RDSInstanceToRDSClusterRelProperties()
140
+ )
141
+
142
+
143
+ @dataclass(frozen=True)
144
+ class RDSInstanceSchema(CartographyNodeSchema):
145
+ label: str = "RDSInstance"
146
+ properties: RDSInstanceNodeProperties = RDSInstanceNodeProperties()
147
+ sub_resource_relationship: RDSInstanceToAWSAccountRel = RDSInstanceToAWSAccountRel()
148
+ other_relationships: OtherRelationships = OtherRelationships(
149
+ [
150
+ RDSInstanceToEC2SecurityGroupRel(),
151
+ RDSInstanceToRDSInstanceRel(),
152
+ RDSInstanceToRDSClusterRel(),
153
+ ]
154
+ )
@@ -0,0 +1,108 @@
1
+ from dataclasses import dataclass
2
+
3
+ from cartography.models.core.common import PropertyRef
4
+ from cartography.models.core.nodes import CartographyNodeProperties
5
+ from cartography.models.core.nodes import CartographyNodeSchema
6
+ from cartography.models.core.relationships import CartographyRelProperties
7
+ from cartography.models.core.relationships import CartographyRelSchema
8
+ from cartography.models.core.relationships import LinkDirection
9
+ from cartography.models.core.relationships import make_target_node_matcher
10
+ from cartography.models.core.relationships import OtherRelationships
11
+ from cartography.models.core.relationships import TargetNodeMatcher
12
+
13
+
14
+ @dataclass(frozen=True)
15
+ class RDSSnapshotNodeProperties(CartographyNodeProperties):
16
+ id: PropertyRef = PropertyRef("DBSnapshotArn")
17
+ arn: PropertyRef = PropertyRef("DBSnapshotArn", extra_index=True)
18
+ db_snapshot_identifier: PropertyRef = PropertyRef(
19
+ "DBSnapshotIdentifier", extra_index=True
20
+ )
21
+ db_instance_identifier: PropertyRef = PropertyRef("DBInstanceIdentifier")
22
+ snapshot_create_time: PropertyRef = PropertyRef("SnapshotCreateTime")
23
+ engine: PropertyRef = PropertyRef("Engine")
24
+ engine_version: PropertyRef = PropertyRef("EngineVersion")
25
+ allocated_storage: PropertyRef = PropertyRef("AllocatedStorage")
26
+ status: PropertyRef = PropertyRef("Status")
27
+ port: PropertyRef = PropertyRef("Port")
28
+ availability_zone: PropertyRef = PropertyRef("AvailabilityZone")
29
+ vpc_id: PropertyRef = PropertyRef("VpcId")
30
+ instance_create_time: PropertyRef = PropertyRef("InstanceCreateTime")
31
+ master_username: PropertyRef = PropertyRef("MasterUsername")
32
+ license_model: PropertyRef = PropertyRef("LicenseModel")
33
+ snapshot_type: PropertyRef = PropertyRef("SnapshotType")
34
+ iops: PropertyRef = PropertyRef("Iops")
35
+ option_group_name: PropertyRef = PropertyRef("OptionGroupName")
36
+ percent_progress: PropertyRef = PropertyRef("PercentProgress")
37
+ source_region: PropertyRef = PropertyRef("SourceRegion")
38
+ source_db_snapshot_identifier: PropertyRef = PropertyRef(
39
+ "SourceDBSnapshotIdentifier"
40
+ )
41
+ storage_type: PropertyRef = PropertyRef("StorageType")
42
+ tde_credential_arn: PropertyRef = PropertyRef("TdeCredentialArn")
43
+ encrypted: PropertyRef = PropertyRef("Encrypted")
44
+ kms_key_id: PropertyRef = PropertyRef("KmsKeyId")
45
+ timezone: PropertyRef = PropertyRef("Timezone")
46
+ iam_database_authentication_enabled: PropertyRef = PropertyRef(
47
+ "IAMDatabaseAuthenticationEnabled"
48
+ )
49
+ processor_features: PropertyRef = PropertyRef("ProcessorFeatures")
50
+ dbi_resource_id: PropertyRef = PropertyRef("DbiResourceId")
51
+ original_snapshot_create_time: PropertyRef = PropertyRef(
52
+ "OriginalSnapshotCreateTime"
53
+ )
54
+ snapshot_database_time: PropertyRef = PropertyRef("SnapshotDatabaseTime")
55
+ snapshot_target: PropertyRef = PropertyRef("SnapshotTarget")
56
+ storage_throughput: PropertyRef = PropertyRef("StorageThroughput")
57
+ region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
58
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
59
+
60
+
61
+ @dataclass(frozen=True)
62
+ class RDSSnapshotToAWSAccountRelProperties(CartographyRelProperties):
63
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
64
+
65
+
66
+ @dataclass(frozen=True)
67
+ class RDSSnapshotToAWSAccountRel(CartographyRelSchema):
68
+ target_node_label: str = "AWSAccount"
69
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
70
+ {"id": PropertyRef("AWS_ID", set_in_kwargs=True)}
71
+ )
72
+ direction: LinkDirection = LinkDirection.INWARD
73
+ rel_label: str = "RESOURCE"
74
+ properties: RDSSnapshotToAWSAccountRelProperties = (
75
+ RDSSnapshotToAWSAccountRelProperties()
76
+ )
77
+
78
+
79
+ @dataclass(frozen=True)
80
+ class RDSSnapshotToRDSInstanceRelProperties(CartographyRelProperties):
81
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
82
+
83
+
84
+ @dataclass(frozen=True)
85
+ class RDSSnapshotToRDSInstanceRel(CartographyRelSchema):
86
+ target_node_label: str = "RDSInstance"
87
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
88
+ {
89
+ "db_instance_identifier": PropertyRef("DBInstanceIdentifier"),
90
+ }
91
+ )
92
+ direction: LinkDirection = LinkDirection.OUTWARD
93
+ rel_label: str = "IS_SNAPSHOT_SOURCE"
94
+ properties: RDSSnapshotToRDSInstanceRelProperties = (
95
+ RDSSnapshotToRDSInstanceRelProperties()
96
+ )
97
+
98
+
99
+ @dataclass(frozen=True)
100
+ class RDSSnapshotSchema(CartographyNodeSchema):
101
+ label: str = "RDSSnapshot"
102
+ properties: RDSSnapshotNodeProperties = RDSSnapshotNodeProperties()
103
+ sub_resource_relationship: RDSSnapshotToAWSAccountRel = RDSSnapshotToAWSAccountRel()
104
+ other_relationships: OtherRelationships = OtherRelationships(
105
+ [
106
+ RDSSnapshotToRDSInstanceRel(),
107
+ ]
108
+ )
@@ -0,0 +1,101 @@
1
+ from dataclasses import dataclass
2
+
3
+ from cartography.models.core.common import PropertyRef
4
+ from cartography.models.core.nodes import CartographyNodeProperties
5
+ from cartography.models.core.nodes import CartographyNodeSchema
6
+ from cartography.models.core.relationships import CartographyRelProperties
7
+ from cartography.models.core.relationships import CartographyRelSchema
8
+ from cartography.models.core.relationships import LinkDirection
9
+ from cartography.models.core.relationships import make_target_node_matcher
10
+ from cartography.models.core.relationships import OtherRelationships
11
+ from cartography.models.core.relationships import TargetNodeMatcher
12
+
13
+
14
+ @dataclass(frozen=True)
15
+ class DBSubnetGroupNodeProperties(CartographyNodeProperties):
16
+ id: PropertyRef = PropertyRef("id")
17
+ name: PropertyRef = PropertyRef("name")
18
+ vpc_id: PropertyRef = PropertyRef("vpc_id")
19
+ description: PropertyRef = PropertyRef("description")
20
+ status: PropertyRef = PropertyRef("status")
21
+ region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
22
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
23
+
24
+
25
+ @dataclass(frozen=True)
26
+ class DBSubnetGroupToAWSAccountRelProperties(CartographyRelProperties):
27
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
28
+
29
+
30
+ @dataclass(frozen=True)
31
+ class DBSubnetGroupToAWSAccountRel(CartographyRelSchema):
32
+ target_node_label: str = "AWSAccount"
33
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
34
+ {"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
35
+ )
36
+ direction: LinkDirection = LinkDirection.INWARD
37
+ rel_label: str = "RESOURCE"
38
+ properties: DBSubnetGroupToAWSAccountRelProperties = (
39
+ DBSubnetGroupToAWSAccountRelProperties()
40
+ )
41
+
42
+
43
+ @dataclass(frozen=True)
44
+ class DBSubnetGroupToRDSInstanceRelProperties(CartographyRelProperties):
45
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
46
+
47
+
48
+ @dataclass(frozen=True)
49
+ class DBSubnetGroupToRDSInstanceRel(CartographyRelSchema):
50
+ target_node_label: str = "RDSInstance"
51
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
52
+ {
53
+ "db_instance_identifier": PropertyRef(
54
+ "db_instance_identifier", one_to_many=True
55
+ ),
56
+ }
57
+ )
58
+ direction: LinkDirection = LinkDirection.INWARD
59
+ rel_label: str = "MEMBER_OF_DB_SUBNET_GROUP"
60
+ properties: DBSubnetGroupToRDSInstanceRelProperties = (
61
+ DBSubnetGroupToRDSInstanceRelProperties()
62
+ )
63
+
64
+
65
+ @dataclass(frozen=True)
66
+ class DBSubnetGroupToEC2SubnetRelProperties(CartographyRelProperties):
67
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
68
+
69
+
70
+ @dataclass(frozen=True)
71
+ class DBSubnetGroupToEC2SubnetRel(CartographyRelSchema):
72
+ target_node_label: str = "EC2Subnet"
73
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
74
+ {
75
+ "subnetid": PropertyRef("subnet_ids", one_to_many=True),
76
+ }
77
+ )
78
+ direction: LinkDirection = LinkDirection.OUTWARD
79
+ rel_label: str = "RESOURCE"
80
+ properties: DBSubnetGroupToEC2SubnetRelProperties = (
81
+ DBSubnetGroupToEC2SubnetRelProperties()
82
+ )
83
+
84
+
85
+ @dataclass(frozen=True)
86
+ class DBSubnetGroupSchema(CartographyNodeSchema):
87
+ """
88
+ DB Subnet Group schema
89
+ """
90
+
91
+ label: str = "DBSubnetGroup"
92
+ properties: DBSubnetGroupNodeProperties = DBSubnetGroupNodeProperties()
93
+ sub_resource_relationship: DBSubnetGroupToAWSAccountRel = (
94
+ DBSubnetGroupToAWSAccountRel()
95
+ )
96
+ other_relationships: OtherRelationships = OtherRelationships(
97
+ [
98
+ DBSubnetGroupToRDSInstanceRel(),
99
+ DBSubnetGroupToEC2SubnetRel(),
100
+ ]
101
+ )
File without changes