cartography 0.102.0rc2__py3-none-any.whl → 0.103.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/__main__.py +1 -2
- cartography/_version.py +2 -2
- cartography/cli.py +302 -253
- cartography/client/core/tx.py +39 -18
- cartography/config.py +4 -0
- cartography/driftdetect/__main__.py +1 -2
- cartography/driftdetect/add_shortcut.py +10 -2
- cartography/driftdetect/cli.py +71 -75
- cartography/driftdetect/detect_deviations.py +7 -3
- cartography/driftdetect/get_states.py +20 -8
- cartography/driftdetect/model.py +5 -5
- cartography/driftdetect/serializers.py +8 -6
- cartography/driftdetect/storage.py +2 -2
- cartography/graph/cleanupbuilder.py +35 -15
- cartography/graph/job.py +46 -17
- cartography/graph/querybuilder.py +165 -80
- cartography/graph/statement.py +35 -26
- cartography/intel/analysis.py +4 -1
- cartography/intel/aws/__init__.py +114 -55
- cartography/intel/aws/apigateway.py +134 -63
- cartography/intel/aws/cloudtrail.py +127 -0
- cartography/intel/aws/config.py +56 -20
- cartography/intel/aws/dynamodb.py +108 -40
- cartography/intel/aws/ec2/__init__.py +2 -2
- cartography/intel/aws/ec2/auto_scaling_groups.py +181 -78
- cartography/intel/aws/ec2/elastic_ip_addresses.py +41 -13
- cartography/intel/aws/ec2/images.py +49 -20
- cartography/intel/aws/ec2/instances.py +234 -136
- cartography/intel/aws/ec2/internet_gateways.py +40 -11
- cartography/intel/aws/ec2/key_pairs.py +44 -20
- cartography/intel/aws/ec2/launch_templates.py +101 -59
- cartography/intel/aws/ec2/load_balancer_v2s.py +104 -39
- cartography/intel/aws/ec2/load_balancers.py +82 -42
- cartography/intel/aws/ec2/network_acls.py +89 -65
- cartography/intel/aws/ec2/network_interfaces.py +146 -87
- cartography/intel/aws/ec2/reserved_instances.py +45 -16
- cartography/intel/aws/ec2/route_tables.py +138 -98
- cartography/intel/aws/ec2/security_groups.py +71 -21
- cartography/intel/aws/ec2/snapshots.py +61 -22
- cartography/intel/aws/ec2/subnets.py +54 -18
- cartography/intel/aws/ec2/tgw.py +100 -34
- cartography/intel/aws/ec2/util.py +1 -1
- cartography/intel/aws/ec2/volumes.py +69 -41
- cartography/intel/aws/ec2/vpc.py +37 -12
- cartography/intel/aws/ec2/vpc_peerings.py +83 -24
- cartography/intel/aws/ecr.py +88 -32
- cartography/intel/aws/ecs.py +83 -47
- cartography/intel/aws/eks.py +55 -29
- cartography/intel/aws/elasticache.py +42 -18
- cartography/intel/aws/elasticsearch.py +57 -20
- cartography/intel/aws/emr.py +61 -23
- cartography/intel/aws/iam.py +401 -145
- cartography/intel/aws/iam_instance_profiles.py +22 -22
- cartography/intel/aws/identitycenter.py +71 -37
- cartography/intel/aws/inspector.py +159 -89
- cartography/intel/aws/kms.py +92 -38
- cartography/intel/aws/lambda_function.py +103 -34
- cartography/intel/aws/organizations.py +30 -10
- cartography/intel/aws/permission_relationships.py +133 -51
- cartography/intel/aws/rds.py +249 -85
- cartography/intel/aws/redshift.py +107 -46
- cartography/intel/aws/resourcegroupstaggingapi.py +120 -66
- cartography/intel/aws/resources.py +53 -46
- cartography/intel/aws/route53.py +108 -61
- cartography/intel/aws/s3.py +168 -83
- cartography/intel/aws/s3accountpublicaccessblock.py +157 -0
- cartography/intel/aws/secretsmanager.py +24 -12
- cartography/intel/aws/securityhub.py +20 -9
- cartography/intel/aws/sns.py +166 -0
- cartography/intel/aws/sqs.py +60 -28
- cartography/intel/aws/ssm.py +70 -30
- cartography/intel/aws/util/arns.py +7 -7
- cartography/intel/aws/util/common.py +31 -4
- cartography/intel/azure/__init__.py +78 -19
- cartography/intel/azure/compute.py +101 -27
- cartography/intel/azure/cosmosdb.py +496 -170
- cartography/intel/azure/sql.py +296 -105
- cartography/intel/azure/storage.py +322 -113
- cartography/intel/azure/subscription.py +39 -23
- cartography/intel/azure/tenant.py +13 -4
- cartography/intel/azure/util/credentials.py +95 -55
- cartography/intel/bigfix/__init__.py +2 -2
- cartography/intel/bigfix/computers.py +93 -65
- cartography/intel/create_indexes.py +3 -2
- cartography/intel/crowdstrike/__init__.py +11 -9
- cartography/intel/crowdstrike/endpoints.py +5 -1
- cartography/intel/crowdstrike/spotlight.py +8 -3
- cartography/intel/cve/__init__.py +46 -13
- cartography/intel/cve/feed.py +48 -12
- cartography/intel/digitalocean/__init__.py +22 -13
- cartography/intel/digitalocean/compute.py +75 -108
- cartography/intel/digitalocean/management.py +44 -80
- cartography/intel/digitalocean/platform.py +48 -43
- cartography/intel/dns.py +36 -10
- cartography/intel/duo/__init__.py +21 -16
- cartography/intel/duo/api_host.py +14 -9
- cartography/intel/duo/endpoints.py +50 -45
- cartography/intel/duo/groups.py +18 -14
- cartography/intel/duo/phones.py +37 -34
- cartography/intel/duo/tokens.py +26 -23
- cartography/intel/duo/users.py +54 -50
- cartography/intel/duo/web_authn_credentials.py +30 -25
- cartography/intel/entra/__init__.py +25 -7
- cartography/intel/entra/ou.py +112 -0
- cartography/intel/entra/users.py +69 -63
- cartography/intel/gcp/__init__.py +185 -49
- cartography/intel/gcp/compute.py +418 -231
- cartography/intel/gcp/crm.py +96 -43
- cartography/intel/gcp/dns.py +60 -19
- cartography/intel/gcp/gke.py +72 -38
- cartography/intel/gcp/iam.py +61 -41
- cartography/intel/gcp/storage.py +84 -55
- cartography/intel/github/__init__.py +13 -11
- cartography/intel/github/repos.py +270 -137
- cartography/intel/github/teams.py +170 -88
- cartography/intel/github/users.py +70 -39
- cartography/intel/github/util.py +36 -34
- cartography/intel/gsuite/__init__.py +47 -26
- cartography/intel/gsuite/api.py +73 -30
- cartography/intel/jamf/__init__.py +19 -1
- cartography/intel/jamf/computers.py +30 -7
- cartography/intel/jamf/util.py +7 -2
- cartography/intel/kandji/__init__.py +6 -3
- cartography/intel/kandji/devices.py +14 -8
- cartography/intel/kubernetes/namespaces.py +7 -4
- cartography/intel/kubernetes/pods.py +7 -4
- cartography/intel/kubernetes/services.py +8 -4
- cartography/intel/lastpass/__init__.py +2 -2
- cartography/intel/lastpass/users.py +23 -12
- cartography/intel/oci/__init__.py +44 -11
- cartography/intel/oci/iam.py +134 -38
- cartography/intel/oci/organizations.py +13 -6
- cartography/intel/oci/utils.py +43 -20
- cartography/intel/okta/__init__.py +66 -15
- cartography/intel/okta/applications.py +42 -20
- cartography/intel/okta/awssaml.py +93 -33
- cartography/intel/okta/factors.py +16 -4
- cartography/intel/okta/groups.py +56 -29
- cartography/intel/okta/organization.py +5 -1
- cartography/intel/okta/origins.py +6 -2
- cartography/intel/okta/roles.py +15 -5
- cartography/intel/okta/users.py +20 -8
- cartography/intel/okta/utils.py +6 -4
- cartography/intel/pagerduty/__init__.py +8 -7
- cartography/intel/pagerduty/escalation_policies.py +18 -6
- cartography/intel/pagerduty/schedules.py +12 -4
- cartography/intel/pagerduty/services.py +11 -4
- cartography/intel/pagerduty/teams.py +8 -3
- cartography/intel/pagerduty/users.py +3 -1
- cartography/intel/pagerduty/vendors.py +3 -1
- cartography/intel/semgrep/__init__.py +24 -6
- cartography/intel/semgrep/dependencies.py +50 -28
- cartography/intel/semgrep/deployment.py +3 -1
- cartography/intel/semgrep/findings.py +42 -18
- cartography/intel/snipeit/__init__.py +17 -3
- cartography/intel/snipeit/asset.py +12 -6
- cartography/intel/snipeit/user.py +8 -5
- cartography/intel/snipeit/util.py +9 -4
- cartography/models/aws/apigateway.py +21 -17
- cartography/models/aws/apigatewaycertificate.py +28 -22
- cartography/models/aws/apigatewayresource.py +28 -20
- cartography/models/aws/apigatewaystage.py +33 -25
- cartography/models/aws/cloudtrail/__init__.py +0 -0
- cartography/models/aws/cloudtrail/trail.py +61 -0
- cartography/models/aws/dynamodb/gsi.py +30 -22
- cartography/models/aws/dynamodb/tables.py +25 -17
- cartography/models/aws/ec2/auto_scaling_groups.py +102 -82
- cartography/models/aws/ec2/images.py +36 -34
- cartography/models/aws/ec2/instances.py +51 -45
- cartography/models/aws/ec2/keypair.py +21 -16
- cartography/models/aws/ec2/keypair_instance.py +28 -21
- cartography/models/aws/ec2/launch_configurations.py +30 -26
- cartography/models/aws/ec2/launch_template_versions.py +48 -38
- cartography/models/aws/ec2/launch_templates.py +21 -17
- cartography/models/aws/ec2/load_balancer_listeners.py +27 -23
- cartography/models/aws/ec2/load_balancers.py +47 -37
- cartography/models/aws/ec2/network_acl_rules.py +38 -30
- cartography/models/aws/ec2/network_acls.py +38 -29
- cartography/models/aws/ec2/networkinterface_instance.py +52 -39
- cartography/models/aws/ec2/networkinterfaces.py +53 -37
- cartography/models/aws/ec2/privateip_networkinterface.py +32 -22
- cartography/models/aws/ec2/reservations.py +18 -14
- cartography/models/aws/ec2/route_table_associations.py +44 -34
- cartography/models/aws/ec2/route_tables.py +50 -43
- cartography/models/aws/ec2/routes.py +45 -37
- cartography/models/aws/ec2/securitygroup_instance.py +29 -20
- cartography/models/aws/ec2/securitygroup_networkinterface.py +24 -15
- cartography/models/aws/ec2/subnet_instance.py +24 -19
- cartography/models/aws/ec2/subnet_networkinterface.py +40 -31
- cartography/models/aws/ec2/volumes.py +47 -40
- cartography/models/aws/eks/clusters.py +23 -21
- cartography/models/aws/emr.py +32 -30
- cartography/models/aws/iam/instanceprofile.py +33 -24
- cartography/models/aws/identitycenter/awsidentitycenter.py +18 -14
- cartography/models/aws/identitycenter/awspermissionset.py +37 -29
- cartography/models/aws/identitycenter/awsssouser.py +23 -21
- cartography/models/aws/inspector/findings.py +77 -65
- cartography/models/aws/inspector/packages.py +35 -29
- cartography/models/aws/s3/__init__.py +0 -0
- cartography/models/aws/s3/account_public_access_block.py +51 -0
- cartography/models/aws/sns/__init__.py +0 -0
- cartography/models/aws/sns/topic.py +50 -0
- cartography/models/aws/ssm/instance_information.py +51 -39
- cartography/models/aws/ssm/instance_patch.py +32 -26
- cartography/models/bigfix/bigfix_computer.py +42 -38
- cartography/models/bigfix/bigfix_root.py +3 -3
- cartography/models/core/common.py +12 -10
- cartography/models/core/nodes.py +5 -2
- cartography/models/core/relationships.py +14 -6
- cartography/models/crowdstrike/hosts.py +37 -35
- cartography/models/cve/cve.py +34 -32
- cartography/models/cve/cve_feed.py +6 -6
- cartography/models/digitalocean/__init__.py +0 -0
- cartography/models/digitalocean/account.py +21 -0
- cartography/models/digitalocean/droplet.py +56 -0
- cartography/models/digitalocean/project.py +48 -0
- cartography/models/duo/api_host.py +3 -3
- cartography/models/duo/endpoint.py +43 -41
- cartography/models/duo/group.py +14 -14
- cartography/models/duo/phone.py +27 -27
- cartography/models/duo/token.py +16 -16
- cartography/models/duo/user.py +46 -44
- cartography/models/duo/web_authn_credential.py +27 -19
- cartography/models/entra/ou.py +48 -0
- cartography/models/entra/tenant.py +24 -18
- cartography/models/entra/user.py +64 -48
- cartography/models/gcp/iam.py +23 -23
- cartography/models/github/orgs.py +5 -4
- cartography/models/github/teams.py +37 -31
- cartography/models/github/users.py +34 -23
- cartography/models/kandji/device.py +22 -16
- cartography/models/kandji/tenant.py +6 -4
- cartography/models/lastpass/tenant.py +3 -3
- cartography/models/lastpass/user.py +32 -28
- cartography/models/semgrep/dependencies.py +36 -24
- cartography/models/semgrep/deployment.py +5 -5
- cartography/models/semgrep/findings.py +58 -42
- cartography/models/semgrep/locations.py +27 -21
- cartography/models/snipeit/asset.py +30 -21
- cartography/models/snipeit/tenant.py +6 -4
- cartography/models/snipeit/user.py +19 -12
- cartography/stats.py +3 -3
- cartography/sync.py +107 -31
- cartography/util.py +84 -62
- {cartography-0.102.0rc2.dist-info → cartography-0.103.0rc1.dist-info}/METADATA +3 -14
- cartography-0.103.0rc1.dist-info/RECORD +396 -0
- {cartography-0.102.0rc2.dist-info → cartography-0.103.0rc1.dist-info}/WHEEL +1 -1
- cartography-0.102.0rc2.dist-info/RECORD +0 -381
- {cartography-0.102.0rc2.dist-info → cartography-0.103.0rc1.dist-info}/entry_points.txt +0 -0
- {cartography-0.102.0rc2.dist-info → cartography-0.103.0rc1.dist-info}/licenses/LICENSE +0 -0
- {cartography-0.102.0rc2.dist-info → cartography-0.103.0rc1.dist-info}/top_level.txt +0 -0
|
@@ -14,87 +14,93 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
14
14
|
@dataclass(frozen=True)
|
|
15
15
|
class EC2InstanceNodeProperties(CartographyNodeProperties):
|
|
16
16
|
# TODO arn: PropertyRef = PropertyRef('Arn', extra_index=True)
|
|
17
|
-
id: PropertyRef = PropertyRef(
|
|
18
|
-
instanceid: PropertyRef = PropertyRef(
|
|
19
|
-
publicdnsname: PropertyRef = PropertyRef(
|
|
20
|
-
privateipaddress: PropertyRef = PropertyRef(
|
|
21
|
-
publicipaddress: PropertyRef = PropertyRef(
|
|
22
|
-
imageid: PropertyRef = PropertyRef(
|
|
23
|
-
instancetype: PropertyRef = PropertyRef(
|
|
24
|
-
monitoringstate: PropertyRef = PropertyRef(
|
|
25
|
-
state: PropertyRef = PropertyRef(
|
|
26
|
-
launchtime: PropertyRef = PropertyRef(
|
|
27
|
-
launchtimeunix: PropertyRef = PropertyRef(
|
|
28
|
-
region: PropertyRef = PropertyRef(
|
|
29
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
30
|
-
iaminstanceprofile: PropertyRef = PropertyRef(
|
|
31
|
-
availabilityzone: PropertyRef = PropertyRef(
|
|
32
|
-
tenancy: PropertyRef = PropertyRef(
|
|
33
|
-
hostresourcegrouparn: PropertyRef = PropertyRef(
|
|
34
|
-
platform: PropertyRef = PropertyRef(
|
|
35
|
-
architecture: PropertyRef = PropertyRef(
|
|
36
|
-
ebsoptimized: PropertyRef = PropertyRef(
|
|
37
|
-
bootmode: PropertyRef = PropertyRef(
|
|
38
|
-
instancelifecycle: PropertyRef = PropertyRef(
|
|
39
|
-
hibernationoptions: PropertyRef = PropertyRef(
|
|
17
|
+
id: PropertyRef = PropertyRef("InstanceId")
|
|
18
|
+
instanceid: PropertyRef = PropertyRef("InstanceId", extra_index=True)
|
|
19
|
+
publicdnsname: PropertyRef = PropertyRef("PublicDnsName", extra_index=True)
|
|
20
|
+
privateipaddress: PropertyRef = PropertyRef("PrivateIpAddress")
|
|
21
|
+
publicipaddress: PropertyRef = PropertyRef("PublicIpAddress")
|
|
22
|
+
imageid: PropertyRef = PropertyRef("ImageId")
|
|
23
|
+
instancetype: PropertyRef = PropertyRef("InstanceType")
|
|
24
|
+
monitoringstate: PropertyRef = PropertyRef("MonitoringState")
|
|
25
|
+
state: PropertyRef = PropertyRef("State")
|
|
26
|
+
launchtime: PropertyRef = PropertyRef("LaunchTime")
|
|
27
|
+
launchtimeunix: PropertyRef = PropertyRef("LaunchTimeUnix")
|
|
28
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
29
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
30
|
+
iaminstanceprofile: PropertyRef = PropertyRef("IamInstanceProfile")
|
|
31
|
+
availabilityzone: PropertyRef = PropertyRef("AvailabilityZone")
|
|
32
|
+
tenancy: PropertyRef = PropertyRef("Tenancy")
|
|
33
|
+
hostresourcegrouparn: PropertyRef = PropertyRef("HostResourceGroupArn")
|
|
34
|
+
platform: PropertyRef = PropertyRef("Platform")
|
|
35
|
+
architecture: PropertyRef = PropertyRef("Architecture")
|
|
36
|
+
ebsoptimized: PropertyRef = PropertyRef("EbsOptimized")
|
|
37
|
+
bootmode: PropertyRef = PropertyRef("BootMode")
|
|
38
|
+
instancelifecycle: PropertyRef = PropertyRef("InstanceLifecycle")
|
|
39
|
+
hibernationoptions: PropertyRef = PropertyRef("HibernationOption")
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
@dataclass(frozen=True)
|
|
43
|
-
class
|
|
44
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
43
|
+
class EC2InstanceToAWSAccountRelRelProperties(CartographyRelProperties):
|
|
44
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
@dataclass(frozen=True)
|
|
48
|
-
class
|
|
49
|
-
target_node_label: str =
|
|
48
|
+
class EC2InstanceToAWSAccountRel(CartographyRelSchema):
|
|
49
|
+
target_node_label: str = "AWSAccount"
|
|
50
50
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
51
|
-
{
|
|
51
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
52
52
|
)
|
|
53
53
|
direction: LinkDirection = LinkDirection.INWARD
|
|
54
54
|
rel_label: str = "RESOURCE"
|
|
55
|
-
properties:
|
|
55
|
+
properties: EC2InstanceToAWSAccountRelRelProperties = (
|
|
56
|
+
EC2InstanceToAWSAccountRelRelProperties()
|
|
57
|
+
)
|
|
56
58
|
|
|
57
59
|
|
|
58
60
|
@dataclass(frozen=True)
|
|
59
|
-
class
|
|
60
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
61
|
+
class EC2InstanceToEC2ReservationRelRelProperties(CartographyRelProperties):
|
|
62
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
61
63
|
|
|
62
64
|
|
|
63
65
|
@dataclass(frozen=True)
|
|
64
|
-
class
|
|
65
|
-
target_node_label: str =
|
|
66
|
+
class EC2InstanceToEC2ReservationRel(CartographyRelSchema):
|
|
67
|
+
target_node_label: str = "EC2Reservation"
|
|
66
68
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
67
|
-
{
|
|
69
|
+
{"reservationid": PropertyRef("ReservationId")},
|
|
68
70
|
)
|
|
69
71
|
direction: LinkDirection = LinkDirection.OUTWARD
|
|
70
72
|
rel_label: str = "MEMBER_OF_EC2_RESERVATION"
|
|
71
|
-
properties:
|
|
73
|
+
properties: EC2InstanceToEC2ReservationRelRelProperties = (
|
|
74
|
+
EC2InstanceToEC2ReservationRelRelProperties()
|
|
75
|
+
)
|
|
72
76
|
|
|
73
77
|
|
|
74
78
|
@dataclass(frozen=True)
|
|
75
|
-
class
|
|
76
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
79
|
+
class EC2InstanceToInstanceProfileRelRelProperties(CartographyRelProperties):
|
|
80
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
77
81
|
|
|
78
82
|
|
|
79
83
|
@dataclass(frozen=True)
|
|
80
|
-
class
|
|
81
|
-
target_node_label: str =
|
|
84
|
+
class EC2InstanceToInstanceProfileRel(CartographyRelSchema):
|
|
85
|
+
target_node_label: str = "AWSInstanceProfile"
|
|
82
86
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
83
|
-
{
|
|
87
|
+
{"arn": PropertyRef("IamInstanceProfile")},
|
|
84
88
|
)
|
|
85
89
|
direction: LinkDirection = LinkDirection.OUTWARD
|
|
86
90
|
rel_label: str = "INSTANCE_PROFILE"
|
|
87
|
-
properties:
|
|
91
|
+
properties: EC2InstanceToInstanceProfileRelRelProperties = (
|
|
92
|
+
EC2InstanceToInstanceProfileRelRelProperties()
|
|
93
|
+
)
|
|
88
94
|
|
|
89
95
|
|
|
90
96
|
@dataclass(frozen=True)
|
|
91
97
|
class EC2InstanceSchema(CartographyNodeSchema):
|
|
92
|
-
label: str =
|
|
98
|
+
label: str = "EC2Instance"
|
|
93
99
|
properties: EC2InstanceNodeProperties = EC2InstanceNodeProperties()
|
|
94
|
-
sub_resource_relationship:
|
|
100
|
+
sub_resource_relationship: EC2InstanceToAWSAccountRel = EC2InstanceToAWSAccountRel()
|
|
95
101
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
96
102
|
[
|
|
97
|
-
|
|
98
|
-
|
|
103
|
+
EC2InstanceToEC2ReservationRel(),
|
|
104
|
+
EC2InstanceToInstanceProfileRel(), # Add the new relationship
|
|
99
105
|
],
|
|
100
106
|
)
|
|
@@ -16,31 +16,35 @@ class EC2KeyPairNodeProperties(CartographyNodeProperties):
|
|
|
16
16
|
"""
|
|
17
17
|
Properties for EC2 keypairs from describe-key-pairs
|
|
18
18
|
"""
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
|
|
20
|
+
id: PropertyRef = PropertyRef("KeyPairArn")
|
|
21
|
+
arn: PropertyRef = PropertyRef("KeyPairArn", extra_index=True)
|
|
22
|
+
keyname: PropertyRef = PropertyRef("KeyName")
|
|
23
|
+
keyfingerprint: PropertyRef = PropertyRef("KeyFingerprint")
|
|
24
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
25
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
@dataclass(frozen=True)
|
|
28
|
-
class
|
|
29
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
29
|
+
class EC2KeyPairToAWSAccountRelRelProperties(CartographyRelProperties):
|
|
30
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
@dataclass(frozen=True)
|
|
33
|
-
class
|
|
34
|
+
class EC2KeyPairToAWSAccountRel(CartographyRelSchema):
|
|
34
35
|
"""
|
|
35
36
|
Relationship schema for EC2 keypairs to AWS Accounts
|
|
36
37
|
"""
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
target_node_label: str = "AWSAccount"
|
|
38
40
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
39
|
-
{
|
|
41
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
40
42
|
)
|
|
41
43
|
direction: LinkDirection = LinkDirection.INWARD
|
|
42
|
-
rel_label: str =
|
|
43
|
-
properties:
|
|
44
|
+
rel_label: str = "RESOURCE"
|
|
45
|
+
properties: EC2KeyPairToAWSAccountRelRelProperties = (
|
|
46
|
+
EC2KeyPairToAWSAccountRelRelProperties()
|
|
47
|
+
)
|
|
44
48
|
|
|
45
49
|
|
|
46
50
|
@dataclass(frozen=True)
|
|
@@ -48,7 +52,8 @@ class EC2KeyPairSchema(CartographyNodeSchema):
|
|
|
48
52
|
"""
|
|
49
53
|
Schema for EC2 keypairs from describe-key-pairs
|
|
50
54
|
"""
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
|
|
56
|
+
label: str = "EC2KeyPair"
|
|
57
|
+
extra_node_labels: ExtraNodeLabels = ExtraNodeLabels(["KeyPair"])
|
|
53
58
|
properties: EC2KeyPairNodeProperties = EC2KeyPairNodeProperties()
|
|
54
|
-
sub_resource_relationship:
|
|
59
|
+
sub_resource_relationship: EC2KeyPairToAWSAccountRel = EC2KeyPairToAWSAccountRel()
|
|
@@ -14,43 +14,47 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
14
14
|
|
|
15
15
|
@dataclass(frozen=True)
|
|
16
16
|
class EC2KeyPairInstanceNodeProperties(CartographyNodeProperties):
|
|
17
|
-
id: PropertyRef = PropertyRef(
|
|
18
|
-
arn: PropertyRef = PropertyRef(
|
|
19
|
-
keyname: PropertyRef = PropertyRef(
|
|
20
|
-
region: PropertyRef = PropertyRef(
|
|
21
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
17
|
+
id: PropertyRef = PropertyRef("KeyPairArn")
|
|
18
|
+
arn: PropertyRef = PropertyRef("KeyPairArn", extra_index=True)
|
|
19
|
+
keyname: PropertyRef = PropertyRef("KeyName")
|
|
20
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
21
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
@dataclass(frozen=True)
|
|
25
|
-
class
|
|
26
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
25
|
+
class EC2KeyPairInstanceToAWSAccountRelRelProperties(CartographyRelProperties):
|
|
26
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
@dataclass(frozen=True)
|
|
30
|
-
class
|
|
31
|
-
target_node_label: str =
|
|
30
|
+
class EC2KeyPairInstanceToAWSAccountRel(CartographyRelSchema):
|
|
31
|
+
target_node_label: str = "AWSAccount"
|
|
32
32
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
33
|
-
{
|
|
33
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
34
34
|
)
|
|
35
35
|
direction: LinkDirection = LinkDirection.INWARD
|
|
36
36
|
rel_label: str = "RESOURCE"
|
|
37
|
-
properties:
|
|
37
|
+
properties: EC2KeyPairInstanceToAWSAccountRelRelProperties = (
|
|
38
|
+
EC2KeyPairInstanceToAWSAccountRelRelProperties()
|
|
39
|
+
)
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
@dataclass(frozen=True)
|
|
41
|
-
class
|
|
42
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
43
|
+
class EC2KeyPairInstanceToEC2InstanceRelRelProperties(CartographyRelProperties):
|
|
44
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
43
45
|
|
|
44
46
|
|
|
45
47
|
@dataclass(frozen=True)
|
|
46
|
-
class
|
|
47
|
-
target_node_label: str =
|
|
48
|
+
class EC2KeyPairInstanceToEC2InstanceRel(CartographyRelSchema):
|
|
49
|
+
target_node_label: str = "EC2Instance"
|
|
48
50
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
49
|
-
{
|
|
51
|
+
{"id": PropertyRef("InstanceId")},
|
|
50
52
|
)
|
|
51
53
|
direction: LinkDirection = LinkDirection.OUTWARD
|
|
52
54
|
rel_label: str = "SSH_LOGIN_TO"
|
|
53
|
-
properties:
|
|
55
|
+
properties: EC2KeyPairInstanceToEC2InstanceRelRelProperties = (
|
|
56
|
+
EC2KeyPairInstanceToEC2InstanceRelRelProperties()
|
|
57
|
+
)
|
|
54
58
|
|
|
55
59
|
|
|
56
60
|
@dataclass(frozen=True)
|
|
@@ -58,12 +62,15 @@ class EC2KeyPairInstanceSchema(CartographyNodeSchema):
|
|
|
58
62
|
"""
|
|
59
63
|
EC2 keypairs as known by describe-instances.
|
|
60
64
|
"""
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
|
|
66
|
+
label: str = "EC2KeyPair"
|
|
67
|
+
extra_node_labels: ExtraNodeLabels = ExtraNodeLabels(["KeyPair"])
|
|
63
68
|
properties: EC2KeyPairInstanceNodeProperties = EC2KeyPairInstanceNodeProperties()
|
|
64
|
-
sub_resource_relationship:
|
|
69
|
+
sub_resource_relationship: EC2KeyPairInstanceToAWSAccountRel = (
|
|
70
|
+
EC2KeyPairInstanceToAWSAccountRel()
|
|
71
|
+
)
|
|
65
72
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
66
73
|
[
|
|
67
|
-
|
|
74
|
+
EC2KeyPairInstanceToEC2InstanceRel(),
|
|
68
75
|
],
|
|
69
76
|
)
|
|
@@ -12,44 +12,48 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
12
12
|
|
|
13
13
|
@dataclass(frozen=True)
|
|
14
14
|
class LaunchConfigurationNodeProperties(CartographyNodeProperties):
|
|
15
|
-
id: PropertyRef = PropertyRef(
|
|
16
|
-
arn: PropertyRef = PropertyRef(
|
|
17
|
-
created_time = PropertyRef(
|
|
18
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
19
|
-
image_id: PropertyRef = PropertyRef(
|
|
20
|
-
key_name: PropertyRef = PropertyRef(
|
|
21
|
-
name: PropertyRef = PropertyRef(
|
|
22
|
-
security_groups: PropertyRef = PropertyRef(
|
|
23
|
-
instance_type: PropertyRef = PropertyRef(
|
|
24
|
-
kernel_id: PropertyRef = PropertyRef(
|
|
25
|
-
ramdisk_id: PropertyRef = PropertyRef(
|
|
26
|
-
instance_monitoring_enabled: PropertyRef = PropertyRef(
|
|
27
|
-
spot_price: PropertyRef = PropertyRef(
|
|
28
|
-
iam_instance_profile: PropertyRef = PropertyRef(
|
|
29
|
-
ebs_optimized: PropertyRef = PropertyRef(
|
|
30
|
-
associate_public_ip_address: PropertyRef = PropertyRef(
|
|
31
|
-
placement_tenancy: PropertyRef = PropertyRef(
|
|
32
|
-
region: PropertyRef = PropertyRef(
|
|
15
|
+
id: PropertyRef = PropertyRef("LaunchConfigurationARN")
|
|
16
|
+
arn: PropertyRef = PropertyRef("LaunchConfigurationARN")
|
|
17
|
+
created_time = PropertyRef("CreatedTime")
|
|
18
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
19
|
+
image_id: PropertyRef = PropertyRef("ImageId")
|
|
20
|
+
key_name: PropertyRef = PropertyRef("KeyName")
|
|
21
|
+
name: PropertyRef = PropertyRef("LaunchConfigurationName")
|
|
22
|
+
security_groups: PropertyRef = PropertyRef("SecurityGroups")
|
|
23
|
+
instance_type: PropertyRef = PropertyRef("InstanceType")
|
|
24
|
+
kernel_id: PropertyRef = PropertyRef("KernelId")
|
|
25
|
+
ramdisk_id: PropertyRef = PropertyRef("RamdiskId")
|
|
26
|
+
instance_monitoring_enabled: PropertyRef = PropertyRef("InstanceMonitoringEnabled")
|
|
27
|
+
spot_price: PropertyRef = PropertyRef("SpotPrice")
|
|
28
|
+
iam_instance_profile: PropertyRef = PropertyRef("IamInstanceProfile")
|
|
29
|
+
ebs_optimized: PropertyRef = PropertyRef("EbsOptimized")
|
|
30
|
+
associate_public_ip_address: PropertyRef = PropertyRef("AssociatePublicIpAddress")
|
|
31
|
+
placement_tenancy: PropertyRef = PropertyRef("PlacementTenancy")
|
|
32
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
@dataclass(frozen=True)
|
|
36
|
-
class
|
|
37
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
36
|
+
class LaunchConfigurationToAwsAccountRelRelProperties(CartographyRelProperties):
|
|
37
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
@dataclass(frozen=True)
|
|
41
|
-
class
|
|
42
|
-
target_node_label: str =
|
|
41
|
+
class LaunchConfigurationToAwsAccountRel(CartographyRelSchema):
|
|
42
|
+
target_node_label: str = "AWSAccount"
|
|
43
43
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
44
|
-
{
|
|
44
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
45
45
|
)
|
|
46
46
|
direction: LinkDirection = LinkDirection.INWARD
|
|
47
47
|
rel_label: str = "RESOURCE"
|
|
48
|
-
properties:
|
|
48
|
+
properties: LaunchConfigurationToAwsAccountRelRelProperties = (
|
|
49
|
+
LaunchConfigurationToAwsAccountRelRelProperties()
|
|
50
|
+
)
|
|
49
51
|
|
|
50
52
|
|
|
51
53
|
@dataclass(frozen=True)
|
|
52
54
|
class LaunchConfigurationSchema(CartographyNodeSchema):
|
|
53
|
-
label: str =
|
|
55
|
+
label: str = "LaunchConfiguration"
|
|
54
56
|
properties: LaunchConfigurationNodeProperties = LaunchConfigurationNodeProperties()
|
|
55
|
-
sub_resource_relationship:
|
|
57
|
+
sub_resource_relationship: LaunchConfigurationToAwsAccountRel = (
|
|
58
|
+
LaunchConfigurationToAwsAccountRel()
|
|
59
|
+
)
|
|
@@ -13,69 +13,79 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
13
13
|
|
|
14
14
|
@dataclass(frozen=True)
|
|
15
15
|
class LaunchTemplateVersionNodeProperties(CartographyNodeProperties):
|
|
16
|
-
id: PropertyRef = PropertyRef(
|
|
17
|
-
name: PropertyRef = PropertyRef(
|
|
18
|
-
create_time: PropertyRef = PropertyRef(
|
|
19
|
-
created_by: PropertyRef = PropertyRef(
|
|
20
|
-
default_version: PropertyRef = PropertyRef(
|
|
21
|
-
version_number: PropertyRef = PropertyRef(
|
|
22
|
-
version_description: PropertyRef = PropertyRef(
|
|
23
|
-
kernel_id: PropertyRef = PropertyRef(
|
|
24
|
-
ebs_optimized: PropertyRef = PropertyRef(
|
|
25
|
-
iam_instance_profile_arn: PropertyRef = PropertyRef(
|
|
26
|
-
iam_instance_profile_name: PropertyRef = PropertyRef(
|
|
27
|
-
image_id: PropertyRef = PropertyRef(
|
|
28
|
-
instance_type: PropertyRef = PropertyRef(
|
|
29
|
-
key_name: PropertyRef = PropertyRef(
|
|
30
|
-
monitoring_enabled: PropertyRef = PropertyRef(
|
|
31
|
-
ramdisk_id: PropertyRef = PropertyRef(
|
|
32
|
-
disable_api_termination: PropertyRef = PropertyRef(
|
|
33
|
-
instance_initiated_shutdown_behavior: PropertyRef = PropertyRef(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
16
|
+
id: PropertyRef = PropertyRef("Id")
|
|
17
|
+
name: PropertyRef = PropertyRef("LaunchTemplateName")
|
|
18
|
+
create_time: PropertyRef = PropertyRef("CreateTime")
|
|
19
|
+
created_by: PropertyRef = PropertyRef("CreatedBy")
|
|
20
|
+
default_version: PropertyRef = PropertyRef("DefaultVersion")
|
|
21
|
+
version_number: PropertyRef = PropertyRef("VersionNumber")
|
|
22
|
+
version_description: PropertyRef = PropertyRef("VersionDescription")
|
|
23
|
+
kernel_id: PropertyRef = PropertyRef("KernelId")
|
|
24
|
+
ebs_optimized: PropertyRef = PropertyRef("EbsOptimized")
|
|
25
|
+
iam_instance_profile_arn: PropertyRef = PropertyRef("IamInstanceProfileArn")
|
|
26
|
+
iam_instance_profile_name: PropertyRef = PropertyRef("IamInstanceProfileName")
|
|
27
|
+
image_id: PropertyRef = PropertyRef("ImageId")
|
|
28
|
+
instance_type: PropertyRef = PropertyRef("InstanceType")
|
|
29
|
+
key_name: PropertyRef = PropertyRef("KeyName")
|
|
30
|
+
monitoring_enabled: PropertyRef = PropertyRef("MonitoringEnabled")
|
|
31
|
+
ramdisk_id: PropertyRef = PropertyRef("RamdiskId")
|
|
32
|
+
disable_api_termination: PropertyRef = PropertyRef("DisableApiTermination")
|
|
33
|
+
instance_initiated_shutdown_behavior: PropertyRef = PropertyRef(
|
|
34
|
+
"InstanceInitiatedShutdownBehavior",
|
|
35
|
+
)
|
|
36
|
+
security_group_ids: PropertyRef = PropertyRef("SecurityGroupIds")
|
|
37
|
+
security_groups: PropertyRef = PropertyRef("SecurityGroups")
|
|
38
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
39
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
@dataclass(frozen=True)
|
|
41
|
-
class
|
|
42
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
43
|
+
class LaunchTemplateVersionToAWSAccountRelRelProperties(CartographyRelProperties):
|
|
44
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
43
45
|
|
|
44
46
|
|
|
45
47
|
@dataclass(frozen=True)
|
|
46
|
-
class
|
|
47
|
-
target_node_label: str =
|
|
48
|
+
class LaunchTemplateVersionToAWSAccountRel(CartographyRelSchema):
|
|
49
|
+
target_node_label: str = "AWSAccount"
|
|
48
50
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
49
|
-
{
|
|
51
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
50
52
|
)
|
|
51
53
|
direction: LinkDirection = LinkDirection.INWARD
|
|
52
54
|
rel_label: str = "RESOURCE"
|
|
53
|
-
properties:
|
|
55
|
+
properties: LaunchTemplateVersionToAWSAccountRelRelProperties = (
|
|
56
|
+
LaunchTemplateVersionToAWSAccountRelRelProperties()
|
|
57
|
+
)
|
|
54
58
|
|
|
55
59
|
|
|
56
60
|
@dataclass(frozen=True)
|
|
57
|
-
class
|
|
58
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
61
|
+
class LaunchTemplateVersionToLTRelRelProperties(CartographyRelProperties):
|
|
62
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
59
63
|
|
|
60
64
|
|
|
61
65
|
@dataclass(frozen=True)
|
|
62
|
-
class
|
|
63
|
-
target_node_label: str =
|
|
66
|
+
class LaunchTemplateVersionToLTRel(CartographyRelSchema):
|
|
67
|
+
target_node_label: str = "LaunchTemplate"
|
|
64
68
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
65
|
-
{
|
|
69
|
+
{"id": PropertyRef("LaunchTemplateId")},
|
|
66
70
|
)
|
|
67
71
|
direction: LinkDirection = LinkDirection.INWARD
|
|
68
72
|
rel_label: str = "VERSION"
|
|
69
|
-
properties:
|
|
73
|
+
properties: LaunchTemplateVersionToLTRelRelProperties = (
|
|
74
|
+
LaunchTemplateVersionToLTRelRelProperties()
|
|
75
|
+
)
|
|
70
76
|
|
|
71
77
|
|
|
72
78
|
@dataclass(frozen=True)
|
|
73
79
|
class LaunchTemplateVersionSchema(CartographyNodeSchema):
|
|
74
|
-
label: str =
|
|
75
|
-
properties: LaunchTemplateVersionNodeProperties =
|
|
76
|
-
|
|
80
|
+
label: str = "LaunchTemplateVersion"
|
|
81
|
+
properties: LaunchTemplateVersionNodeProperties = (
|
|
82
|
+
LaunchTemplateVersionNodeProperties()
|
|
83
|
+
)
|
|
84
|
+
sub_resource_relationship: LaunchTemplateVersionToAWSAccountRel = (
|
|
85
|
+
LaunchTemplateVersionToAWSAccountRel()
|
|
86
|
+
)
|
|
77
87
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
78
88
|
[
|
|
79
|
-
|
|
89
|
+
LaunchTemplateVersionToLTRel(),
|
|
80
90
|
],
|
|
81
91
|
)
|
|
@@ -12,35 +12,39 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
12
12
|
|
|
13
13
|
@dataclass(frozen=True)
|
|
14
14
|
class LaunchTemplateNodeProperties(CartographyNodeProperties):
|
|
15
|
-
id: PropertyRef = PropertyRef(
|
|
16
|
-
launch_template_id: PropertyRef = PropertyRef(
|
|
17
|
-
name: PropertyRef = PropertyRef(
|
|
18
|
-
create_time: PropertyRef = PropertyRef(
|
|
19
|
-
created_by: PropertyRef = PropertyRef(
|
|
20
|
-
default_version_number: PropertyRef = PropertyRef(
|
|
21
|
-
latest_version_number: PropertyRef = PropertyRef(
|
|
22
|
-
region: PropertyRef = PropertyRef(
|
|
23
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
15
|
+
id: PropertyRef = PropertyRef("LaunchTemplateId")
|
|
16
|
+
launch_template_id: PropertyRef = PropertyRef("LaunchTemplateId")
|
|
17
|
+
name: PropertyRef = PropertyRef("LaunchTemplateName")
|
|
18
|
+
create_time: PropertyRef = PropertyRef("CreateTime")
|
|
19
|
+
created_by: PropertyRef = PropertyRef("CreatedBy")
|
|
20
|
+
default_version_number: PropertyRef = PropertyRef("DefaultVersionNumber")
|
|
21
|
+
latest_version_number: PropertyRef = PropertyRef("LatestVersionNumber")
|
|
22
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
23
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
@dataclass(frozen=True)
|
|
27
|
-
class
|
|
28
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
27
|
+
class LaunchTemplateToAWSAccountRelRelProperties(CartographyRelProperties):
|
|
28
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
@dataclass(frozen=True)
|
|
32
|
-
class
|
|
33
|
-
target_node_label: str =
|
|
32
|
+
class LaunchTemplateToAWSAccountRel(CartographyRelSchema):
|
|
33
|
+
target_node_label: str = "AWSAccount"
|
|
34
34
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
35
|
-
{
|
|
35
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
36
36
|
)
|
|
37
37
|
direction: LinkDirection = LinkDirection.INWARD
|
|
38
38
|
rel_label: str = "RESOURCE"
|
|
39
|
-
properties:
|
|
39
|
+
properties: LaunchTemplateToAWSAccountRelRelProperties = (
|
|
40
|
+
LaunchTemplateToAWSAccountRelRelProperties()
|
|
41
|
+
)
|
|
40
42
|
|
|
41
43
|
|
|
42
44
|
@dataclass(frozen=True)
|
|
43
45
|
class LaunchTemplateSchema(CartographyNodeSchema):
|
|
44
|
-
label: str =
|
|
46
|
+
label: str = "LaunchTemplate"
|
|
45
47
|
properties: LaunchTemplateNodeProperties = LaunchTemplateNodeProperties()
|
|
46
|
-
sub_resource_relationship:
|
|
48
|
+
sub_resource_relationship: LaunchTemplateToAWSAccountRel = (
|
|
49
|
+
LaunchTemplateToAWSAccountRel()
|
|
50
|
+
)
|
|
@@ -14,55 +14,59 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
14
14
|
|
|
15
15
|
@dataclass(frozen=True)
|
|
16
16
|
class ELBListenerNodeProperties(CartographyNodeProperties):
|
|
17
|
-
id: PropertyRef = PropertyRef(
|
|
18
|
-
port: PropertyRef = PropertyRef(
|
|
19
|
-
protocol: PropertyRef = PropertyRef(
|
|
20
|
-
instance_port: PropertyRef = PropertyRef(
|
|
21
|
-
instance_protocol: PropertyRef = PropertyRef(
|
|
22
|
-
policy_names: PropertyRef = PropertyRef(
|
|
23
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
17
|
+
id: PropertyRef = PropertyRef("id")
|
|
18
|
+
port: PropertyRef = PropertyRef("port")
|
|
19
|
+
protocol: PropertyRef = PropertyRef("protocol")
|
|
20
|
+
instance_port: PropertyRef = PropertyRef("instance_port")
|
|
21
|
+
instance_protocol: PropertyRef = PropertyRef("instance_protocol")
|
|
22
|
+
policy_names: PropertyRef = PropertyRef("policy_names")
|
|
23
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
@dataclass(frozen=True)
|
|
27
|
-
class
|
|
28
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
27
|
+
class ELBListenerToLoadBalancerRelRelProperties(CartographyRelProperties):
|
|
28
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
@dataclass(frozen=True)
|
|
32
|
-
class
|
|
33
|
-
target_node_label: str =
|
|
32
|
+
class ELBListenerToLoadBalancerRel(CartographyRelSchema):
|
|
33
|
+
target_node_label: str = "LoadBalancer"
|
|
34
34
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
35
|
-
{
|
|
35
|
+
{"id": PropertyRef("LoadBalancerId")},
|
|
36
36
|
)
|
|
37
37
|
direction: LinkDirection = LinkDirection.INWARD
|
|
38
38
|
rel_label: str = "ELB_LISTENER"
|
|
39
|
-
properties:
|
|
39
|
+
properties: ELBListenerToLoadBalancerRelRelProperties = (
|
|
40
|
+
ELBListenerToLoadBalancerRelRelProperties()
|
|
41
|
+
)
|
|
40
42
|
|
|
41
43
|
|
|
42
44
|
@dataclass(frozen=True)
|
|
43
|
-
class
|
|
44
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
45
|
+
class ELBListenerToAWSAccountRelRelProperties(CartographyRelProperties):
|
|
46
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
45
47
|
|
|
46
48
|
|
|
47
49
|
@dataclass(frozen=True)
|
|
48
|
-
class
|
|
49
|
-
target_node_label: str =
|
|
50
|
+
class ELBListenerToAWSAccountRel(CartographyRelSchema):
|
|
51
|
+
target_node_label: str = "AWSAccount"
|
|
50
52
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
51
|
-
{
|
|
53
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
52
54
|
)
|
|
53
55
|
direction: LinkDirection = LinkDirection.INWARD
|
|
54
56
|
rel_label: str = "RESOURCE"
|
|
55
|
-
properties:
|
|
57
|
+
properties: ELBListenerToAWSAccountRelRelProperties = (
|
|
58
|
+
ELBListenerToAWSAccountRelRelProperties()
|
|
59
|
+
)
|
|
56
60
|
|
|
57
61
|
|
|
58
62
|
@dataclass(frozen=True)
|
|
59
63
|
class ELBListenerSchema(CartographyNodeSchema):
|
|
60
|
-
label: str =
|
|
64
|
+
label: str = "ELBListener"
|
|
61
65
|
properties: ELBListenerNodeProperties = ELBListenerNodeProperties()
|
|
62
|
-
extra_node_labels: ExtraNodeLabels = ExtraNodeLabels([
|
|
63
|
-
sub_resource_relationship:
|
|
66
|
+
extra_node_labels: ExtraNodeLabels = ExtraNodeLabels(["Endpoint"])
|
|
67
|
+
sub_resource_relationship: ELBListenerToAWSAccountRel = ELBListenerToAWSAccountRel()
|
|
64
68
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
65
69
|
[
|
|
66
|
-
|
|
70
|
+
ELBListenerToLoadBalancerRel(),
|
|
67
71
|
],
|
|
68
72
|
)
|