cartography 0.102.0rc2__py3-none-any.whl → 0.103.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.
- cartography/__main__.py +1 -2
- cartography/_version.py +2 -2
- cartography/cli.py +376 -249
- cartography/client/core/tx.py +39 -18
- cartography/config.py +28 -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/cloudwatch.py +93 -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/efs.py +93 -0
- 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 +57 -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/cloudflare/__init__.py +74 -0
- cartography/intel/cloudflare/accounts.py +57 -0
- cartography/intel/cloudflare/dnsrecords.py +64 -0
- cartography/intel/cloudflare/members.py +75 -0
- cartography/intel/cloudflare/roles.py +65 -0
- cartography/intel/cloudflare/zones.py +64 -0
- 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/openai/__init__.py +86 -0
- cartography/intel/openai/adminapikeys.py +90 -0
- cartography/intel/openai/apikeys.py +96 -0
- cartography/intel/openai/projects.py +94 -0
- cartography/intel/openai/serviceaccounts.py +82 -0
- cartography/intel/openai/users.py +78 -0
- cartography/intel/openai/util.py +29 -0
- 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/intel/tailscale/__init__.py +77 -0
- cartography/intel/tailscale/acls.py +146 -0
- cartography/intel/tailscale/devices.py +127 -0
- cartography/intel/tailscale/postureintegrations.py +81 -0
- cartography/intel/tailscale/tailnets.py +76 -0
- cartography/intel/tailscale/users.py +80 -0
- cartography/intel/tailscale/utils.py +132 -0
- 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/cloudwatch/__init__.py +0 -0
- cartography/models/aws/cloudwatch/loggroup.py +52 -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/efs/__init__.py +0 -0
- cartography/models/aws/efs/mount_target.py +52 -0
- 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/cloudflare/__init__.py +0 -0
- cartography/models/cloudflare/account.py +25 -0
- cartography/models/cloudflare/dnsrecord.py +55 -0
- cartography/models/cloudflare/member.py +82 -0
- cartography/models/cloudflare/role.py +44 -0
- cartography/models/cloudflare/zone.py +59 -0
- 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/openai/__init__.py +0 -0
- cartography/models/openai/adminapikey.py +90 -0
- cartography/models/openai/apikey.py +84 -0
- cartography/models/openai/organization.py +17 -0
- cartography/models/openai/project.py +70 -0
- cartography/models/openai/serviceaccount.py +50 -0
- cartography/models/openai/user.py +49 -0
- 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/models/tailscale/__init__.py +0 -0
- cartography/models/tailscale/device.py +95 -0
- cartography/models/tailscale/group.py +86 -0
- cartography/models/tailscale/postureintegration.py +58 -0
- cartography/models/tailscale/tag.py +102 -0
- cartography/models/tailscale/tailnet.py +29 -0
- cartography/models/tailscale/user.py +52 -0
- cartography/stats.py +3 -3
- cartography/sync.py +113 -31
- cartography/util.py +84 -62
- {cartography-0.102.0rc2.dist-info → cartography-0.103.0.dist-info}/METADATA +8 -15
- cartography-0.103.0.dist-info/RECORD +442 -0
- {cartography-0.102.0rc2.dist-info → cartography-0.103.0.dist-info}/WHEEL +1 -1
- cartography-0.102.0rc2.dist-info/RECORD +0 -381
- {cartography-0.102.0rc2.dist-info → cartography-0.103.0.dist-info}/entry_points.txt +0 -0
- {cartography-0.102.0rc2.dist-info → cartography-0.103.0.dist-info}/licenses/LICENSE +0 -0
- {cartography-0.102.0rc2.dist-info → cartography-0.103.0.dist-info}/top_level.txt +0 -0
|
@@ -13,65 +13,73 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
13
13
|
|
|
14
14
|
@dataclass(frozen=True)
|
|
15
15
|
class RouteNodeProperties(CartographyNodeProperties):
|
|
16
|
-
id: PropertyRef = PropertyRef(
|
|
17
|
-
carrier_gateway_id: PropertyRef = PropertyRef(
|
|
18
|
-
core_network_arn: PropertyRef = PropertyRef(
|
|
19
|
-
destination_cidr_block: PropertyRef = PropertyRef(
|
|
20
|
-
destination_ipv6_cidr_block: PropertyRef = PropertyRef(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
16
|
+
id: PropertyRef = PropertyRef("id")
|
|
17
|
+
carrier_gateway_id: PropertyRef = PropertyRef("carrier_gateway_id")
|
|
18
|
+
core_network_arn: PropertyRef = PropertyRef("core_network_arn")
|
|
19
|
+
destination_cidr_block: PropertyRef = PropertyRef("destination_cidr_block")
|
|
20
|
+
destination_ipv6_cidr_block: PropertyRef = PropertyRef(
|
|
21
|
+
"destination_ipv6_cidr_block"
|
|
22
|
+
)
|
|
23
|
+
destination_prefix_list_id: PropertyRef = PropertyRef("destination_prefix_list_id")
|
|
24
|
+
egress_only_internet_gateway_id: PropertyRef = PropertyRef(
|
|
25
|
+
"egress_only_internet_gateway_id"
|
|
26
|
+
)
|
|
27
|
+
gateway_id: PropertyRef = PropertyRef("gateway_id")
|
|
28
|
+
instance_id: PropertyRef = PropertyRef("instance_id")
|
|
29
|
+
instance_owner_id: PropertyRef = PropertyRef("instance_owner_id")
|
|
30
|
+
local_gateway_id: PropertyRef = PropertyRef("local_gateway_id")
|
|
31
|
+
nat_gateway_id: PropertyRef = PropertyRef("nat_gateway_id")
|
|
32
|
+
network_interface_id: PropertyRef = PropertyRef("network_interface_id")
|
|
33
|
+
origin: PropertyRef = PropertyRef("origin")
|
|
34
|
+
state: PropertyRef = PropertyRef("state")
|
|
35
|
+
transit_gateway_id: PropertyRef = PropertyRef("transit_gateway_id")
|
|
36
|
+
vpc_peering_connection_id: PropertyRef = PropertyRef("vpc_peering_connection_id")
|
|
37
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
38
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
39
|
+
target: PropertyRef = PropertyRef("_target")
|
|
36
40
|
|
|
37
41
|
|
|
38
42
|
@dataclass(frozen=True)
|
|
39
|
-
class
|
|
40
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
43
|
+
class RouteToAWSAccountRelRelProperties(CartographyRelProperties):
|
|
44
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
41
45
|
|
|
42
46
|
|
|
43
47
|
@dataclass(frozen=True)
|
|
44
|
-
class
|
|
45
|
-
target_node_label: str =
|
|
48
|
+
class RouteToAWSAccountRel(CartographyRelSchema):
|
|
49
|
+
target_node_label: str = "AWSAccount"
|
|
46
50
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
47
|
-
{
|
|
51
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
48
52
|
)
|
|
49
53
|
direction: LinkDirection = LinkDirection.INWARD
|
|
50
54
|
rel_label: str = "RESOURCE"
|
|
51
|
-
properties:
|
|
55
|
+
properties: RouteToAWSAccountRelRelProperties = RouteToAWSAccountRelRelProperties()
|
|
52
56
|
|
|
53
57
|
|
|
54
58
|
@dataclass(frozen=True)
|
|
55
|
-
class
|
|
56
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
59
|
+
class RouteToInternetGatewayRelRelProperties(CartographyRelProperties):
|
|
60
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
57
61
|
|
|
58
62
|
|
|
59
63
|
@dataclass(frozen=True)
|
|
60
|
-
class
|
|
61
|
-
target_node_label: str =
|
|
64
|
+
class RouteToInternetGatewayRel(CartographyRelSchema):
|
|
65
|
+
target_node_label: str = "AWSInternetGateway"
|
|
62
66
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
63
|
-
{
|
|
67
|
+
{"id": PropertyRef("gateway_id")},
|
|
64
68
|
)
|
|
65
69
|
direction: LinkDirection = LinkDirection.OUTWARD
|
|
66
70
|
rel_label: str = "ROUTES_TO_GATEWAY"
|
|
67
|
-
properties:
|
|
71
|
+
properties: RouteToInternetGatewayRelRelProperties = (
|
|
72
|
+
RouteToInternetGatewayRelRelProperties()
|
|
73
|
+
)
|
|
68
74
|
|
|
69
75
|
|
|
70
76
|
@dataclass(frozen=True)
|
|
71
77
|
class RouteSchema(CartographyNodeSchema):
|
|
72
|
-
label: str =
|
|
78
|
+
label: str = "EC2Route"
|
|
73
79
|
properties: RouteNodeProperties = RouteNodeProperties()
|
|
74
|
-
sub_resource_relationship:
|
|
75
|
-
other_relationships: OtherRelationships = OtherRelationships(
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
sub_resource_relationship: RouteToAWSAccountRel = RouteToAWSAccountRel()
|
|
81
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
82
|
+
[
|
|
83
|
+
RouteToInternetGatewayRel(),
|
|
84
|
+
]
|
|
85
|
+
)
|
|
@@ -14,42 +14,46 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
14
14
|
@dataclass(frozen=True)
|
|
15
15
|
class EC2SecurityGroupInstanceNodeProperties(CartographyNodeProperties):
|
|
16
16
|
# arn: PropertyRef = PropertyRef('Arn', extra_index=True) # TODO use arn; #1024
|
|
17
|
-
id: PropertyRef = PropertyRef(
|
|
18
|
-
groupid: PropertyRef = PropertyRef(
|
|
19
|
-
region: PropertyRef = PropertyRef(
|
|
20
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
17
|
+
id: PropertyRef = PropertyRef("GroupId")
|
|
18
|
+
groupid: PropertyRef = PropertyRef("GroupId", extra_index=True)
|
|
19
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
20
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
@dataclass(frozen=True)
|
|
24
|
-
class
|
|
25
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
24
|
+
class EC2SecurityGroupToAWSAccountRelRelProperties(CartographyRelProperties):
|
|
25
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
@dataclass(frozen=True)
|
|
29
|
-
class
|
|
30
|
-
target_node_label: str =
|
|
29
|
+
class EC2SecurityGroupToAWSAccountRel(CartographyRelSchema):
|
|
30
|
+
target_node_label: str = "AWSAccount"
|
|
31
31
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
32
|
-
{
|
|
32
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
33
33
|
)
|
|
34
34
|
direction: LinkDirection = LinkDirection.INWARD
|
|
35
35
|
rel_label: str = "RESOURCE"
|
|
36
|
-
properties:
|
|
36
|
+
properties: EC2SecurityGroupToAWSAccountRelRelProperties = (
|
|
37
|
+
EC2SecurityGroupToAWSAccountRelRelProperties()
|
|
38
|
+
)
|
|
37
39
|
|
|
38
40
|
|
|
39
41
|
@dataclass(frozen=True)
|
|
40
|
-
class
|
|
41
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
42
|
+
class EC2SecurityGroupToEC2InstanceRelRelProperties(CartographyRelProperties):
|
|
43
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
42
44
|
|
|
43
45
|
|
|
44
46
|
@dataclass(frozen=True)
|
|
45
|
-
class
|
|
46
|
-
target_node_label: str =
|
|
47
|
+
class EC2SecurityGroupToEC2InstanceRel(CartographyRelSchema):
|
|
48
|
+
target_node_label: str = "EC2Instance"
|
|
47
49
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
48
|
-
{
|
|
50
|
+
{"id": PropertyRef("InstanceId")},
|
|
49
51
|
)
|
|
50
52
|
direction: LinkDirection = LinkDirection.INWARD
|
|
51
53
|
rel_label: str = "MEMBER_OF_EC2_SECURITY_GROUP"
|
|
52
|
-
properties:
|
|
54
|
+
properties: EC2SecurityGroupToEC2InstanceRelRelProperties = (
|
|
55
|
+
EC2SecurityGroupToEC2InstanceRelRelProperties()
|
|
56
|
+
)
|
|
53
57
|
|
|
54
58
|
|
|
55
59
|
@dataclass(frozen=True)
|
|
@@ -57,11 +61,16 @@ class EC2SecurityGroupInstanceSchema(CartographyNodeSchema):
|
|
|
57
61
|
"""
|
|
58
62
|
Security groups as known by describe-ec2-instances
|
|
59
63
|
"""
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
|
|
65
|
+
label: str = "EC2SecurityGroup"
|
|
66
|
+
properties: EC2SecurityGroupInstanceNodeProperties = (
|
|
67
|
+
EC2SecurityGroupInstanceNodeProperties()
|
|
68
|
+
)
|
|
69
|
+
sub_resource_relationship: EC2SecurityGroupToAWSAccountRel = (
|
|
70
|
+
EC2SecurityGroupToAWSAccountRel()
|
|
71
|
+
)
|
|
63
72
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
64
73
|
[
|
|
65
|
-
|
|
74
|
+
EC2SecurityGroupToEC2InstanceRel(),
|
|
66
75
|
],
|
|
67
76
|
)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
|
|
3
|
-
from cartography.models.aws.ec2.securitygroup_instance import
|
|
3
|
+
from cartography.models.aws.ec2.securitygroup_instance import (
|
|
4
|
+
EC2SecurityGroupToAWSAccountRel,
|
|
5
|
+
)
|
|
4
6
|
from cartography.models.core.common import PropertyRef
|
|
5
7
|
from cartography.models.core.nodes import CartographyNodeProperties
|
|
6
8
|
from cartography.models.core.nodes import CartographyNodeSchema
|
|
@@ -15,26 +17,28 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
15
17
|
@dataclass(frozen=True)
|
|
16
18
|
class EC2SecurityGroupNetworkInterfaceNodeProperties(CartographyNodeProperties):
|
|
17
19
|
# arn: PropertyRef = PropertyRef('Arn', extra_index=True) # TODO use arn; issue #1024
|
|
18
|
-
id: PropertyRef = PropertyRef(
|
|
19
|
-
groupid: PropertyRef = PropertyRef(
|
|
20
|
-
region: PropertyRef = PropertyRef(
|
|
21
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
20
|
+
id: PropertyRef = PropertyRef("GroupId")
|
|
21
|
+
groupid: PropertyRef = PropertyRef("GroupId", extra_index=True)
|
|
22
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
23
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
22
24
|
|
|
23
25
|
|
|
24
26
|
@dataclass(frozen=True)
|
|
25
|
-
class
|
|
26
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
27
|
+
class EC2SubnetToNetworkInterfaceRelRelProperties(CartographyRelProperties):
|
|
28
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
27
29
|
|
|
28
30
|
|
|
29
31
|
@dataclass(frozen=True)
|
|
30
|
-
class
|
|
31
|
-
target_node_label: str =
|
|
32
|
+
class EC2SecurityGroupToNetworkInterfaceRel(CartographyRelSchema):
|
|
33
|
+
target_node_label: str = "NetworkInterface"
|
|
32
34
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
33
|
-
{
|
|
35
|
+
{"id": PropertyRef("NetworkInterfaceId")},
|
|
34
36
|
)
|
|
35
37
|
direction: LinkDirection = LinkDirection.INWARD
|
|
36
38
|
rel_label: str = "MEMBER_OF_EC2_SECURITY_GROUP"
|
|
37
|
-
properties:
|
|
39
|
+
properties: EC2SubnetToNetworkInterfaceRelRelProperties = (
|
|
40
|
+
EC2SubnetToNetworkInterfaceRelRelProperties()
|
|
41
|
+
)
|
|
38
42
|
|
|
39
43
|
|
|
40
44
|
@dataclass(frozen=True)
|
|
@@ -42,11 +46,16 @@ class EC2SecurityGroupNetworkInterfaceSchema(CartographyNodeSchema):
|
|
|
42
46
|
"""
|
|
43
47
|
Security groups as known by describe-network-interfaces.
|
|
44
48
|
"""
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
|
|
50
|
+
label: str = "EC2SecurityGroup"
|
|
51
|
+
properties: EC2SecurityGroupNetworkInterfaceNodeProperties = (
|
|
52
|
+
EC2SecurityGroupNetworkInterfaceNodeProperties()
|
|
53
|
+
)
|
|
54
|
+
sub_resource_relationship: EC2SecurityGroupToAWSAccountRel = (
|
|
55
|
+
EC2SecurityGroupToAWSAccountRel()
|
|
56
|
+
)
|
|
48
57
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
49
58
|
[
|
|
50
|
-
|
|
59
|
+
EC2SecurityGroupToNetworkInterfaceRel(),
|
|
51
60
|
],
|
|
52
61
|
)
|
|
@@ -14,42 +14,46 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
14
14
|
@dataclass(frozen=True)
|
|
15
15
|
class EC2SubnetInstanceNodeProperties(CartographyNodeProperties):
|
|
16
16
|
# arn: PropertyRef = PropertyRef('Arn', extra_index=True) TODO use arn; issue #1024
|
|
17
|
-
id: PropertyRef = PropertyRef(
|
|
18
|
-
subnetid: PropertyRef = PropertyRef(
|
|
19
|
-
region: PropertyRef = PropertyRef(
|
|
20
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
17
|
+
id: PropertyRef = PropertyRef("SubnetId")
|
|
18
|
+
subnetid: PropertyRef = PropertyRef("SubnetId", extra_index=True)
|
|
19
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
20
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
@dataclass(frozen=True)
|
|
24
|
-
class
|
|
25
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
24
|
+
class EC2SubnetToAWSAccountRelRelProperties(CartographyRelProperties):
|
|
25
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
@dataclass(frozen=True)
|
|
29
|
-
class
|
|
30
|
-
target_node_label: str =
|
|
29
|
+
class EC2SubnetToAWSAccountRel(CartographyRelSchema):
|
|
30
|
+
target_node_label: str = "AWSAccount"
|
|
31
31
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
32
|
-
{
|
|
32
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
33
33
|
)
|
|
34
34
|
direction: LinkDirection = LinkDirection.INWARD
|
|
35
35
|
rel_label: str = "RESOURCE"
|
|
36
|
-
properties:
|
|
36
|
+
properties: EC2SubnetToAWSAccountRelRelProperties = (
|
|
37
|
+
EC2SubnetToAWSAccountRelRelProperties()
|
|
38
|
+
)
|
|
37
39
|
|
|
38
40
|
|
|
39
41
|
@dataclass(frozen=True)
|
|
40
|
-
class
|
|
41
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
42
|
+
class EC2SubnetToEC2InstanceRelRelProperties(CartographyRelProperties):
|
|
43
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
42
44
|
|
|
43
45
|
|
|
44
46
|
@dataclass(frozen=True)
|
|
45
|
-
class
|
|
46
|
-
target_node_label: str =
|
|
47
|
+
class EC2SubnetToEC2InstanceRel(CartographyRelSchema):
|
|
48
|
+
target_node_label: str = "EC2Instance"
|
|
47
49
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
48
|
-
{
|
|
50
|
+
{"id": PropertyRef("InstanceId")},
|
|
49
51
|
)
|
|
50
52
|
direction: LinkDirection = LinkDirection.INWARD
|
|
51
53
|
rel_label: str = "PART_OF_SUBNET"
|
|
52
|
-
properties:
|
|
54
|
+
properties: EC2SubnetToEC2InstanceRelRelProperties = (
|
|
55
|
+
EC2SubnetToEC2InstanceRelRelProperties()
|
|
56
|
+
)
|
|
53
57
|
|
|
54
58
|
|
|
55
59
|
@dataclass(frozen=True)
|
|
@@ -57,11 +61,12 @@ class EC2SubnetInstanceSchema(CartographyNodeSchema):
|
|
|
57
61
|
"""
|
|
58
62
|
EC2 Subnet as known by describe-ec2-instances
|
|
59
63
|
"""
|
|
60
|
-
|
|
64
|
+
|
|
65
|
+
label: str = "EC2Subnet"
|
|
61
66
|
properties: EC2SubnetInstanceNodeProperties = EC2SubnetInstanceNodeProperties()
|
|
62
|
-
sub_resource_relationship:
|
|
67
|
+
sub_resource_relationship: EC2SubnetToAWSAccountRel = EC2SubnetToAWSAccountRel()
|
|
63
68
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
64
69
|
[
|
|
65
|
-
|
|
70
|
+
EC2SubnetToEC2InstanceRel(),
|
|
66
71
|
],
|
|
67
72
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
|
|
3
|
-
from cartography.models.aws.ec2.subnet_instance import
|
|
4
|
-
from cartography.models.aws.ec2.subnet_instance import
|
|
3
|
+
from cartography.models.aws.ec2.subnet_instance import EC2SubnetToAWSAccountRel
|
|
4
|
+
from cartography.models.aws.ec2.subnet_instance import EC2SubnetToEC2InstanceRel
|
|
5
5
|
from cartography.models.core.common import PropertyRef
|
|
6
6
|
from cartography.models.core.nodes import CartographyNodeProperties
|
|
7
7
|
from cartography.models.core.nodes import CartographyNodeSchema
|
|
@@ -15,58 +15,64 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
15
15
|
|
|
16
16
|
@dataclass(frozen=True)
|
|
17
17
|
class EC2SubnetNetworkInterfaceNodeProperties(CartographyNodeProperties):
|
|
18
|
-
id: PropertyRef = PropertyRef(
|
|
19
|
-
subnet_id: PropertyRef = PropertyRef(
|
|
20
|
-
region: PropertyRef = PropertyRef(
|
|
21
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
18
|
+
id: PropertyRef = PropertyRef("SubnetId")
|
|
19
|
+
subnet_id: PropertyRef = PropertyRef("SubnetId", extra_index=True)
|
|
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 EC2SubnetToNetworkInterfaceRelRelProperties(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 EC2SubnetToNetworkInterfaceRel(CartographyRelSchema):
|
|
31
|
+
target_node_label: str = "NetworkInterface"
|
|
32
32
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
33
|
-
{
|
|
33
|
+
{"id": PropertyRef("NetworkInterfaceId")},
|
|
34
34
|
)
|
|
35
35
|
direction: LinkDirection = LinkDirection.INWARD
|
|
36
36
|
rel_label: str = "PART_OF_SUBNET"
|
|
37
|
-
properties:
|
|
37
|
+
properties: EC2SubnetToNetworkInterfaceRelRelProperties = (
|
|
38
|
+
EC2SubnetToNetworkInterfaceRelRelProperties()
|
|
39
|
+
)
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
@dataclass(frozen=True)
|
|
41
|
-
class
|
|
42
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
43
|
+
class EC2SubnetToLoadBalancerRelRelProperties(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 EC2SubnetToLoadBalancerRel(CartographyRelSchema):
|
|
49
|
+
target_node_label: str = "LoadBalancer"
|
|
48
50
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
49
|
-
{
|
|
51
|
+
{"id": PropertyRef("ElbV1Id")},
|
|
50
52
|
)
|
|
51
53
|
direction: LinkDirection = LinkDirection.INWARD
|
|
52
54
|
rel_label: str = "PART_OF_SUBNET"
|
|
53
|
-
properties:
|
|
55
|
+
properties: EC2SubnetToLoadBalancerRelRelProperties = (
|
|
56
|
+
EC2SubnetToLoadBalancerRelRelProperties()
|
|
57
|
+
)
|
|
54
58
|
|
|
55
59
|
|
|
56
60
|
@dataclass(frozen=True)
|
|
57
|
-
class
|
|
58
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
61
|
+
class EC2SubnetToLoadBalancerV2RelRelProperties(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 EC2SubnetToLoadBalancerV2Rel(CartographyRelSchema):
|
|
67
|
+
target_node_label: str = "LoadBalancerV2"
|
|
64
68
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
65
|
-
{
|
|
69
|
+
{"id": PropertyRef("ElbV2Id")},
|
|
66
70
|
)
|
|
67
71
|
direction: LinkDirection = LinkDirection.INWARD
|
|
68
72
|
rel_label: str = "PART_OF_SUBNET"
|
|
69
|
-
properties:
|
|
73
|
+
properties: EC2SubnetToLoadBalancerV2RelRelProperties = (
|
|
74
|
+
EC2SubnetToLoadBalancerV2RelRelProperties()
|
|
75
|
+
)
|
|
70
76
|
|
|
71
77
|
|
|
72
78
|
@dataclass(frozen=True)
|
|
@@ -74,14 +80,17 @@ class EC2SubnetNetworkInterfaceSchema(CartographyNodeSchema):
|
|
|
74
80
|
"""
|
|
75
81
|
Subnet as known by describe-network-interfaces
|
|
76
82
|
"""
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
|
|
84
|
+
label: str = "EC2Subnet"
|
|
85
|
+
properties: EC2SubnetNetworkInterfaceNodeProperties = (
|
|
86
|
+
EC2SubnetNetworkInterfaceNodeProperties()
|
|
87
|
+
)
|
|
88
|
+
sub_resource_relationship: EC2SubnetToAWSAccountRel = EC2SubnetToAWSAccountRel()
|
|
80
89
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
81
90
|
[
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
EC2SubnetToNetworkInterfaceRel(),
|
|
92
|
+
EC2SubnetToEC2InstanceRel(),
|
|
93
|
+
EC2SubnetToLoadBalancerRel(),
|
|
94
|
+
EC2SubnetToLoadBalancerV2Rel(),
|
|
86
95
|
],
|
|
87
96
|
)
|
|
@@ -13,55 +13,59 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
13
13
|
|
|
14
14
|
@dataclass(frozen=True)
|
|
15
15
|
class EBSVolumeNodeProperties(CartographyNodeProperties):
|
|
16
|
-
arn: PropertyRef = PropertyRef(
|
|
17
|
-
id: PropertyRef = PropertyRef(
|
|
18
|
-
volumeid: PropertyRef = PropertyRef(
|
|
19
|
-
region: PropertyRef = PropertyRef(
|
|
20
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
21
|
-
availabilityzone: PropertyRef = PropertyRef(
|
|
22
|
-
createtime: PropertyRef = PropertyRef(
|
|
23
|
-
encrypted: PropertyRef = PropertyRef(
|
|
24
|
-
size: PropertyRef = PropertyRef(
|
|
25
|
-
state: PropertyRef = PropertyRef(
|
|
26
|
-
outpostarn: PropertyRef = PropertyRef(
|
|
27
|
-
snapshotid: PropertyRef = PropertyRef(
|
|
28
|
-
iops: PropertyRef = PropertyRef(
|
|
29
|
-
fastrestored: PropertyRef = PropertyRef(
|
|
30
|
-
multiattachenabled: PropertyRef = PropertyRef(
|
|
31
|
-
type: PropertyRef = PropertyRef(
|
|
32
|
-
kmskeyid: PropertyRef = PropertyRef(
|
|
16
|
+
arn: PropertyRef = PropertyRef("Arn", extra_index=True)
|
|
17
|
+
id: PropertyRef = PropertyRef("VolumeId")
|
|
18
|
+
volumeid: PropertyRef = PropertyRef("VolumeId", extra_index=True)
|
|
19
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
20
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
21
|
+
availabilityzone: PropertyRef = PropertyRef("AvailabilityZone")
|
|
22
|
+
createtime: PropertyRef = PropertyRef("CreateTime")
|
|
23
|
+
encrypted: PropertyRef = PropertyRef("Encrypted")
|
|
24
|
+
size: PropertyRef = PropertyRef("Size")
|
|
25
|
+
state: PropertyRef = PropertyRef("State")
|
|
26
|
+
outpostarn: PropertyRef = PropertyRef("OutpostArn")
|
|
27
|
+
snapshotid: PropertyRef = PropertyRef("SnapshotId")
|
|
28
|
+
iops: PropertyRef = PropertyRef("Iops")
|
|
29
|
+
fastrestored: PropertyRef = PropertyRef("FastRestored")
|
|
30
|
+
multiattachenabled: PropertyRef = PropertyRef("MultiAttachEnabled")
|
|
31
|
+
type: PropertyRef = PropertyRef("VolumeType")
|
|
32
|
+
kmskeyid: PropertyRef = PropertyRef("KmsKeyId")
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
@dataclass(frozen=True)
|
|
36
|
-
class
|
|
37
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
36
|
+
class EBSVolumeToAWSAccountRelRelProperties(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 EBSVolumeToAWSAccountRel(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: EBSVolumeToAWSAccountRelRelProperties = (
|
|
49
|
+
EBSVolumeToAWSAccountRelRelProperties()
|
|
50
|
+
)
|
|
49
51
|
|
|
50
52
|
|
|
51
53
|
@dataclass(frozen=True)
|
|
52
|
-
class
|
|
53
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
54
|
+
class EBSVolumeToEC2InstanceRelRelProperties(CartographyRelProperties):
|
|
55
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
54
56
|
|
|
55
57
|
|
|
56
58
|
@dataclass(frozen=True)
|
|
57
|
-
class
|
|
58
|
-
target_node_label: str =
|
|
59
|
+
class EBSVolumeToEC2InstanceRel(CartographyRelSchema):
|
|
60
|
+
target_node_label: str = "EC2Instance"
|
|
59
61
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
60
|
-
{
|
|
62
|
+
{"id": PropertyRef("InstanceId")},
|
|
61
63
|
)
|
|
62
64
|
direction: LinkDirection = LinkDirection.OUTWARD
|
|
63
65
|
rel_label: str = "ATTACHED_TO"
|
|
64
|
-
properties:
|
|
66
|
+
properties: EBSVolumeToEC2InstanceRelRelProperties = (
|
|
67
|
+
EBSVolumeToEC2InstanceRelRelProperties()
|
|
68
|
+
)
|
|
65
69
|
|
|
66
70
|
|
|
67
71
|
@dataclass(frozen=True)
|
|
@@ -69,12 +73,13 @@ class EBSVolumeSchema(CartographyNodeSchema):
|
|
|
69
73
|
"""
|
|
70
74
|
EBS Volume properties as returned from the EBS Volume API response
|
|
71
75
|
"""
|
|
72
|
-
|
|
76
|
+
|
|
77
|
+
label: str = "EBSVolume"
|
|
73
78
|
properties: EBSVolumeNodeProperties = EBSVolumeNodeProperties()
|
|
74
|
-
sub_resource_relationship:
|
|
79
|
+
sub_resource_relationship: EBSVolumeToAWSAccountRel = EBSVolumeToAWSAccountRel()
|
|
75
80
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
76
81
|
[
|
|
77
|
-
|
|
82
|
+
EBSVolumeToEC2InstanceRel(),
|
|
78
83
|
],
|
|
79
84
|
)
|
|
80
85
|
|
|
@@ -85,11 +90,12 @@ class EBSVolumeInstanceProperties(CartographyNodeProperties):
|
|
|
85
90
|
EBS Volume properties as known by an EC2 instance.
|
|
86
91
|
The EC2 instance API response includes a `deleteontermination` field and the volume id.
|
|
87
92
|
"""
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
|
|
94
|
+
arn: PropertyRef = PropertyRef("Arn", extra_index=True)
|
|
95
|
+
id: PropertyRef = PropertyRef("VolumeId")
|
|
96
|
+
volumeid: PropertyRef = PropertyRef("VolumeId", extra_index=True)
|
|
97
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
98
|
+
deleteontermination: PropertyRef = PropertyRef("DeleteOnTermination")
|
|
93
99
|
|
|
94
100
|
|
|
95
101
|
@dataclass(frozen=True)
|
|
@@ -97,11 +103,12 @@ class EBSVolumeInstanceSchema(CartographyNodeSchema):
|
|
|
97
103
|
"""
|
|
98
104
|
EBS Volume from EC2 Instance API response. This is separate from `EBSVolumeSchema` to prevent issue #1210.
|
|
99
105
|
"""
|
|
100
|
-
|
|
106
|
+
|
|
107
|
+
label: str = "EBSVolume"
|
|
101
108
|
properties: EBSVolumeInstanceProperties = EBSVolumeInstanceProperties()
|
|
102
|
-
sub_resource_relationship:
|
|
109
|
+
sub_resource_relationship: EBSVolumeToAWSAccountRel = EBSVolumeToAWSAccountRel()
|
|
103
110
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
104
111
|
[
|
|
105
|
-
|
|
112
|
+
EBSVolumeToEC2InstanceRel(),
|
|
106
113
|
],
|
|
107
114
|
)
|
|
File without changes
|