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
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
|
|
3
|
-
from cartography.models.aws.ec2.networkinterface_instance import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
from cartography.models.aws.ec2.networkinterface_instance import
|
|
3
|
+
from cartography.models.aws.ec2.networkinterface_instance import (
|
|
4
|
+
EC2NetworkInterfaceToAWSAccountRel,
|
|
5
|
+
)
|
|
6
|
+
from cartography.models.aws.ec2.networkinterface_instance import (
|
|
7
|
+
EC2NetworkInterfaceToEC2InstanceRel,
|
|
8
|
+
)
|
|
9
|
+
from cartography.models.aws.ec2.networkinterface_instance import (
|
|
10
|
+
EC2NetworkInterfaceToEC2SecurityGroupRel,
|
|
11
|
+
)
|
|
12
|
+
from cartography.models.aws.ec2.networkinterface_instance import (
|
|
13
|
+
EC2NetworkInterfaceToEC2SubnetRel,
|
|
14
|
+
)
|
|
7
15
|
from cartography.models.core.common import PropertyRef
|
|
8
16
|
from cartography.models.core.nodes import CartographyNodeProperties
|
|
9
17
|
from cartography.models.core.nodes import CartographyNodeSchema
|
|
@@ -20,54 +28,59 @@ class EC2NetworkInterfaceNodeProperties(CartographyNodeProperties):
|
|
|
20
28
|
"""
|
|
21
29
|
Network interface properties
|
|
22
30
|
"""
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
|
|
32
|
+
id: PropertyRef = PropertyRef("NetworkInterfaceId")
|
|
33
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
34
|
+
description: PropertyRef = PropertyRef("Description")
|
|
35
|
+
mac_address: PropertyRef = PropertyRef("MacAddress", extra_index=True)
|
|
36
|
+
private_dns_name: PropertyRef = PropertyRef("PrivateDnsName")
|
|
37
|
+
private_ip_address: PropertyRef = PropertyRef("PrivateIpAddress", extra_index=True)
|
|
38
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
39
|
+
status: PropertyRef = PropertyRef("Status")
|
|
31
40
|
|
|
32
41
|
# Properties only returned by describe-network-interfaces
|
|
33
|
-
interface_type: PropertyRef = PropertyRef(
|
|
34
|
-
public_ip: PropertyRef = PropertyRef(
|
|
35
|
-
requester_id: PropertyRef = PropertyRef(
|
|
36
|
-
requester_managed: PropertyRef = PropertyRef(
|
|
37
|
-
source_dest_check: PropertyRef = PropertyRef(
|
|
38
|
-
subnetid: PropertyRef = PropertyRef(
|
|
42
|
+
interface_type: PropertyRef = PropertyRef("InterfaceType")
|
|
43
|
+
public_ip: PropertyRef = PropertyRef("PublicIp", extra_index=True)
|
|
44
|
+
requester_id: PropertyRef = PropertyRef("RequesterId", extra_index=True)
|
|
45
|
+
requester_managed: PropertyRef = PropertyRef("RequesterManaged")
|
|
46
|
+
source_dest_check: PropertyRef = PropertyRef("SourceDestCheck")
|
|
47
|
+
subnetid: PropertyRef = PropertyRef("SubnetId", extra_index=True)
|
|
39
48
|
|
|
40
49
|
|
|
41
50
|
@dataclass(frozen=True)
|
|
42
|
-
class
|
|
43
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
51
|
+
class EC2NetworkInterfaceToElbRelRelProperties(CartographyRelProperties):
|
|
52
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
44
53
|
|
|
45
54
|
|
|
46
55
|
@dataclass(frozen=True)
|
|
47
|
-
class
|
|
48
|
-
target_node_label: str =
|
|
56
|
+
class EC2NetworkInterfaceToElbRel(CartographyRelSchema):
|
|
57
|
+
target_node_label: str = "LoadBalancer"
|
|
49
58
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
50
|
-
{
|
|
59
|
+
{"name": PropertyRef("ElbV1Id")},
|
|
51
60
|
)
|
|
52
61
|
direction: LinkDirection = LinkDirection.INWARD
|
|
53
62
|
rel_label: str = "NETWORK_INTERFACE"
|
|
54
|
-
properties:
|
|
63
|
+
properties: EC2NetworkInterfaceToElbRelRelProperties = (
|
|
64
|
+
EC2NetworkInterfaceToElbRelRelProperties()
|
|
65
|
+
)
|
|
55
66
|
|
|
56
67
|
|
|
57
68
|
@dataclass(frozen=True)
|
|
58
|
-
class
|
|
59
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
69
|
+
class EC2NetworkInterfaceToElbV2RelRelProperties(CartographyRelProperties):
|
|
70
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
60
71
|
|
|
61
72
|
|
|
62
73
|
@dataclass(frozen=True)
|
|
63
|
-
class
|
|
64
|
-
target_node_label: str =
|
|
74
|
+
class EC2NetworkInterfaceToElbV2Rel(CartographyRelSchema):
|
|
75
|
+
target_node_label: str = "LoadBalancerV2"
|
|
65
76
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
66
|
-
{
|
|
77
|
+
{"id": PropertyRef("ElbV2Id")},
|
|
67
78
|
)
|
|
68
79
|
direction: LinkDirection = LinkDirection.INWARD
|
|
69
80
|
rel_label: str = "NETWORK_INTERFACE"
|
|
70
|
-
properties:
|
|
81
|
+
properties: EC2NetworkInterfaceToElbV2RelRelProperties = (
|
|
82
|
+
EC2NetworkInterfaceToElbV2RelRelProperties()
|
|
83
|
+
)
|
|
71
84
|
|
|
72
85
|
|
|
73
86
|
@dataclass(frozen=True)
|
|
@@ -75,15 +88,18 @@ class EC2NetworkInterfaceSchema(CartographyNodeSchema):
|
|
|
75
88
|
"""
|
|
76
89
|
Network interface as known by describe-network-interfaces.
|
|
77
90
|
"""
|
|
78
|
-
|
|
91
|
+
|
|
92
|
+
label: str = "NetworkInterface"
|
|
79
93
|
properties: EC2NetworkInterfaceNodeProperties = EC2NetworkInterfaceNodeProperties()
|
|
80
|
-
sub_resource_relationship:
|
|
94
|
+
sub_resource_relationship: EC2NetworkInterfaceToAWSAccountRel = (
|
|
95
|
+
EC2NetworkInterfaceToAWSAccountRel()
|
|
96
|
+
)
|
|
81
97
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
82
98
|
[
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
99
|
+
EC2NetworkInterfaceToEC2SubnetRel(),
|
|
100
|
+
EC2NetworkInterfaceToEC2SecurityGroupRel(),
|
|
101
|
+
EC2NetworkInterfaceToElbRel(),
|
|
102
|
+
EC2NetworkInterfaceToElbV2Rel(),
|
|
103
|
+
EC2NetworkInterfaceToEC2InstanceRel(),
|
|
88
104
|
],
|
|
89
105
|
)
|
|
@@ -16,45 +16,50 @@ class EC2PrivateIpNetworkInterfaceNodeProperties(CartographyNodeProperties):
|
|
|
16
16
|
"""
|
|
17
17
|
Selection of properties of a private IP as known by an EC2 network interface
|
|
18
18
|
"""
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
|
|
20
|
+
id: PropertyRef = PropertyRef("Id")
|
|
21
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
22
|
+
network_interface_id: PropertyRef = PropertyRef("NetworkInterfaceId")
|
|
23
|
+
primary: PropertyRef = PropertyRef("Primary")
|
|
24
|
+
private_ip_address: PropertyRef = PropertyRef("PrivateIpAddress")
|
|
25
|
+
public_ip: PropertyRef = PropertyRef("PublicIp")
|
|
26
|
+
ip_owner_id: PropertyRef = PropertyRef("IpOwnerId")
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
@dataclass(frozen=True)
|
|
29
|
-
class
|
|
30
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
30
|
+
class EC2PrivateIpToAWSAccountRelRelProperties(CartographyRelProperties):
|
|
31
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
@dataclass(frozen=True)
|
|
34
|
-
class
|
|
35
|
-
target_node_label: str =
|
|
35
|
+
class EC2PrivateIpToAWSAccountRel(CartographyRelSchema):
|
|
36
|
+
target_node_label: str = "AWSAccount"
|
|
36
37
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
37
|
-
{
|
|
38
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
38
39
|
)
|
|
39
40
|
direction: LinkDirection = LinkDirection.INWARD
|
|
40
41
|
rel_label: str = "RESOURCE"
|
|
41
|
-
properties:
|
|
42
|
+
properties: EC2PrivateIpToAWSAccountRelRelProperties = (
|
|
43
|
+
EC2PrivateIpToAWSAccountRelRelProperties()
|
|
44
|
+
)
|
|
42
45
|
|
|
43
46
|
|
|
44
47
|
@dataclass(frozen=True)
|
|
45
48
|
class EC2NetworkInterfaceToPrivateIpRelProperties(CartographyRelProperties):
|
|
46
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
49
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
47
50
|
|
|
48
51
|
|
|
49
52
|
@dataclass(frozen=True)
|
|
50
|
-
class
|
|
51
|
-
target_node_label: str =
|
|
53
|
+
class EC2PrivateIpToNetworkInterfaceRel(CartographyRelSchema):
|
|
54
|
+
target_node_label: str = "NetworkInterface"
|
|
52
55
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
53
|
-
{
|
|
56
|
+
{"id": PropertyRef("NetworkInterfaceId")},
|
|
54
57
|
)
|
|
55
58
|
direction: LinkDirection = LinkDirection.INWARD
|
|
56
59
|
rel_label: str = "PRIVATE_IP_ADDRESS"
|
|
57
|
-
properties: EC2NetworkInterfaceToPrivateIpRelProperties =
|
|
60
|
+
properties: EC2NetworkInterfaceToPrivateIpRelProperties = (
|
|
61
|
+
EC2NetworkInterfaceToPrivateIpRelProperties()
|
|
62
|
+
)
|
|
58
63
|
|
|
59
64
|
|
|
60
65
|
@dataclass(frozen=True)
|
|
@@ -62,11 +67,16 @@ class EC2PrivateIpNetworkInterfaceSchema(CartographyNodeSchema):
|
|
|
62
67
|
"""
|
|
63
68
|
PrivateIp as known by a Network Interface
|
|
64
69
|
"""
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
|
|
71
|
+
label: str = "EC2PrivateIp"
|
|
72
|
+
properties: EC2PrivateIpNetworkInterfaceNodeProperties = (
|
|
73
|
+
EC2PrivateIpNetworkInterfaceNodeProperties()
|
|
74
|
+
)
|
|
75
|
+
sub_resource_relationship: EC2PrivateIpToAWSAccountRel = (
|
|
76
|
+
EC2PrivateIpToAWSAccountRel()
|
|
77
|
+
)
|
|
68
78
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
69
79
|
[
|
|
70
|
-
|
|
80
|
+
EC2PrivateIpToNetworkInterfaceRel(),
|
|
71
81
|
],
|
|
72
82
|
)
|
|
@@ -12,32 +12,36 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
12
12
|
|
|
13
13
|
@dataclass(frozen=True)
|
|
14
14
|
class EC2ReservationNodeProperties(CartographyNodeProperties):
|
|
15
|
-
id: PropertyRef = PropertyRef(
|
|
16
|
-
reservationid: PropertyRef = PropertyRef(
|
|
17
|
-
ownerid: PropertyRef = PropertyRef(
|
|
18
|
-
requesterid: PropertyRef = PropertyRef(
|
|
19
|
-
region: PropertyRef = PropertyRef(
|
|
20
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
15
|
+
id: PropertyRef = PropertyRef("ReservationId")
|
|
16
|
+
reservationid: PropertyRef = PropertyRef("ReservationId")
|
|
17
|
+
ownerid: PropertyRef = PropertyRef("OwnerId")
|
|
18
|
+
requesterid: PropertyRef = PropertyRef("RequesterId")
|
|
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 EC2ReservationToAWSAccountRelRelProperties(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 EC2ReservationToAWSAccountRel(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: EC2ReservationToAWSAccountRelRelProperties = (
|
|
37
|
+
EC2ReservationToAWSAccountRelRelProperties()
|
|
38
|
+
)
|
|
37
39
|
|
|
38
40
|
|
|
39
41
|
@dataclass(frozen=True)
|
|
40
42
|
class EC2ReservationSchema(CartographyNodeSchema):
|
|
41
|
-
label: str =
|
|
43
|
+
label: str = "EC2Reservation"
|
|
42
44
|
properties: EC2ReservationNodeProperties = EC2ReservationNodeProperties()
|
|
43
|
-
sub_resource_relationship:
|
|
45
|
+
sub_resource_relationship: EC2ReservationToAWSAccountRel = (
|
|
46
|
+
EC2ReservationToAWSAccountRel()
|
|
47
|
+
)
|
|
@@ -13,75 +13,85 @@ from cartography.models.core.relationships import TargetNodeMatcher
|
|
|
13
13
|
|
|
14
14
|
@dataclass(frozen=True)
|
|
15
15
|
class RouteTableAssociationNodeProperties(CartographyNodeProperties):
|
|
16
|
-
id: PropertyRef = PropertyRef(
|
|
17
|
-
route_table_association_id: PropertyRef = PropertyRef(
|
|
18
|
-
target: PropertyRef = PropertyRef(
|
|
19
|
-
gateway_id: PropertyRef = PropertyRef(
|
|
20
|
-
main: PropertyRef = PropertyRef(
|
|
21
|
-
route_table_id: PropertyRef = PropertyRef(
|
|
22
|
-
subnet_id: PropertyRef = PropertyRef(
|
|
23
|
-
association_state: PropertyRef = PropertyRef(
|
|
24
|
-
association_state_message: PropertyRef = PropertyRef(
|
|
25
|
-
region: PropertyRef = PropertyRef(
|
|
26
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
16
|
+
id: PropertyRef = PropertyRef("id")
|
|
17
|
+
route_table_association_id: PropertyRef = PropertyRef("id", extra_index=True)
|
|
18
|
+
target: PropertyRef = PropertyRef("_target")
|
|
19
|
+
gateway_id: PropertyRef = PropertyRef("gateway_id")
|
|
20
|
+
main: PropertyRef = PropertyRef("main")
|
|
21
|
+
route_table_id: PropertyRef = PropertyRef("route_table_id")
|
|
22
|
+
subnet_id: PropertyRef = PropertyRef("subnet_id")
|
|
23
|
+
association_state: PropertyRef = PropertyRef("association_state")
|
|
24
|
+
association_state_message: PropertyRef = PropertyRef("association_state_message")
|
|
25
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
26
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
@dataclass(frozen=True)
|
|
30
|
-
class
|
|
31
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
30
|
+
class RouteTableAssociationToAWSAccountRelRelProperties(CartographyRelProperties):
|
|
31
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
@dataclass(frozen=True)
|
|
35
|
-
class
|
|
36
|
-
target_node_label: str =
|
|
35
|
+
class RouteTableAssociationToAWSAccountRel(CartographyRelSchema):
|
|
36
|
+
target_node_label: str = "AWSAccount"
|
|
37
37
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
38
|
-
{
|
|
38
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
39
39
|
)
|
|
40
40
|
direction: LinkDirection = LinkDirection.INWARD
|
|
41
41
|
rel_label: str = "RESOURCE"
|
|
42
|
-
properties:
|
|
42
|
+
properties: RouteTableAssociationToAWSAccountRelRelProperties = (
|
|
43
|
+
RouteTableAssociationToAWSAccountRelRelProperties()
|
|
44
|
+
)
|
|
43
45
|
|
|
44
46
|
|
|
45
47
|
@dataclass(frozen=True)
|
|
46
|
-
class
|
|
47
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
48
|
+
class RouteTableAssociationToSubnetRelRelProperties(CartographyRelProperties):
|
|
49
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
48
50
|
|
|
49
51
|
|
|
50
52
|
@dataclass(frozen=True)
|
|
51
|
-
class
|
|
52
|
-
target_node_label: str =
|
|
53
|
+
class RouteTableAssociationToSubnetRel(CartographyRelSchema):
|
|
54
|
+
target_node_label: str = "EC2Subnet"
|
|
53
55
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
54
|
-
{
|
|
56
|
+
{"subnetid": PropertyRef("subnet_id")},
|
|
55
57
|
)
|
|
56
58
|
direction: LinkDirection = LinkDirection.OUTWARD
|
|
57
59
|
rel_label: str = "ASSOCIATED_SUBNET"
|
|
58
|
-
properties:
|
|
60
|
+
properties: RouteTableAssociationToSubnetRelRelProperties = (
|
|
61
|
+
RouteTableAssociationToSubnetRelRelProperties()
|
|
62
|
+
)
|
|
59
63
|
|
|
60
64
|
|
|
61
65
|
@dataclass(frozen=True)
|
|
62
|
-
class
|
|
63
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
66
|
+
class RouteTableAssociationToIgwRelRelProperties(CartographyRelProperties):
|
|
67
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
64
68
|
|
|
65
69
|
|
|
66
70
|
@dataclass(frozen=True)
|
|
67
|
-
class
|
|
68
|
-
target_node_label: str =
|
|
71
|
+
class RouteTableAssociationToIgwRel(CartographyRelSchema):
|
|
72
|
+
target_node_label: str = "AWSInternetGateway"
|
|
69
73
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
70
|
-
{
|
|
74
|
+
{"id": PropertyRef("gateway_id")},
|
|
71
75
|
)
|
|
72
76
|
direction: LinkDirection = LinkDirection.OUTWARD
|
|
73
77
|
rel_label: str = "ASSOCIATED_IGW_FOR_INGRESS"
|
|
74
|
-
properties:
|
|
78
|
+
properties: RouteTableAssociationToIgwRelRelProperties = (
|
|
79
|
+
RouteTableAssociationToIgwRelRelProperties()
|
|
80
|
+
)
|
|
75
81
|
|
|
76
82
|
|
|
77
83
|
@dataclass(frozen=True)
|
|
78
84
|
class RouteTableAssociationSchema(CartographyNodeSchema):
|
|
79
|
-
label: str =
|
|
80
|
-
properties: RouteTableAssociationNodeProperties =
|
|
81
|
-
|
|
85
|
+
label: str = "EC2RouteTableAssociation"
|
|
86
|
+
properties: RouteTableAssociationNodeProperties = (
|
|
87
|
+
RouteTableAssociationNodeProperties()
|
|
88
|
+
)
|
|
89
|
+
sub_resource_relationship: RouteTableAssociationToAWSAccountRel = (
|
|
90
|
+
RouteTableAssociationToAWSAccountRel()
|
|
91
|
+
)
|
|
82
92
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
83
93
|
[
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
RouteTableAssociationToSubnetRel(),
|
|
95
|
+
RouteTableAssociationToIgwRel(),
|
|
86
96
|
],
|
|
87
97
|
)
|
|
@@ -16,106 +16,113 @@ class RouteTableNodeProperties(CartographyNodeProperties):
|
|
|
16
16
|
"""
|
|
17
17
|
Schema describing a RouteTable.
|
|
18
18
|
"""
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
|
|
20
|
+
id: PropertyRef = PropertyRef("id")
|
|
21
|
+
route_table_id: PropertyRef = PropertyRef("route_table_id", extra_index=True)
|
|
22
|
+
owner_id: PropertyRef = PropertyRef("owner_id")
|
|
23
|
+
vpc_id: PropertyRef = PropertyRef("VpcId")
|
|
24
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
25
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
26
|
+
main: PropertyRef = PropertyRef("main")
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
@dataclass(frozen=True)
|
|
29
|
-
class
|
|
30
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
30
|
+
class RouteTableToAWSAccountRelRelProperties(CartographyRelProperties):
|
|
31
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
@dataclass(frozen=True)
|
|
34
|
-
class
|
|
35
|
-
target_node_label: str =
|
|
35
|
+
class RouteTableToAWSAccountRel(CartographyRelSchema):
|
|
36
|
+
target_node_label: str = "AWSAccount"
|
|
36
37
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
37
|
-
{
|
|
38
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
38
39
|
)
|
|
39
40
|
direction: LinkDirection = LinkDirection.INWARD
|
|
40
41
|
rel_label: str = "RESOURCE"
|
|
41
|
-
properties:
|
|
42
|
+
properties: RouteTableToAWSAccountRelRelProperties = (
|
|
43
|
+
RouteTableToAWSAccountRelRelProperties()
|
|
44
|
+
)
|
|
42
45
|
|
|
43
46
|
|
|
44
47
|
@dataclass(frozen=True)
|
|
45
|
-
class
|
|
46
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
48
|
+
class RouteTableToVpcRelRelProperties(CartographyRelProperties):
|
|
49
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
47
50
|
|
|
48
51
|
|
|
49
52
|
@dataclass(frozen=True)
|
|
50
|
-
class
|
|
51
|
-
target_node_label: str =
|
|
53
|
+
class RouteTableToVpcRel(CartographyRelSchema):
|
|
54
|
+
target_node_label: str = "AWSVpc"
|
|
52
55
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
53
|
-
{
|
|
56
|
+
{"id": PropertyRef("vpc_id")},
|
|
54
57
|
)
|
|
55
58
|
direction: LinkDirection = LinkDirection.OUTWARD
|
|
56
59
|
rel_label: str = "MEMBER_OF_AWS_VPC"
|
|
57
|
-
properties:
|
|
60
|
+
properties: RouteTableToVpcRelRelProperties = RouteTableToVpcRelRelProperties()
|
|
58
61
|
|
|
59
62
|
|
|
60
63
|
@dataclass(frozen=True)
|
|
61
|
-
class
|
|
62
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
64
|
+
class RouteTableToRouteRelRelProperties(CartographyRelProperties):
|
|
65
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
63
66
|
|
|
64
67
|
|
|
65
68
|
@dataclass(frozen=True)
|
|
66
|
-
class
|
|
67
|
-
target_node_label: str =
|
|
69
|
+
class RouteTableToRouteRel(CartographyRelSchema):
|
|
70
|
+
target_node_label: str = "EC2Route"
|
|
68
71
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
69
|
-
{
|
|
72
|
+
{"id": PropertyRef("RouteIds", one_to_many=True)},
|
|
70
73
|
)
|
|
71
74
|
direction: LinkDirection = LinkDirection.OUTWARD
|
|
72
75
|
rel_label: str = "ROUTE"
|
|
73
|
-
properties:
|
|
76
|
+
properties: RouteTableToRouteRelRelProperties = RouteTableToRouteRelRelProperties()
|
|
74
77
|
|
|
75
78
|
|
|
76
79
|
@dataclass(frozen=True)
|
|
77
|
-
class
|
|
78
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
80
|
+
class RouteTableToAssociationRelRelProperties(CartographyRelProperties):
|
|
81
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
79
82
|
|
|
80
83
|
|
|
81
84
|
@dataclass(frozen=True)
|
|
82
|
-
class
|
|
83
|
-
target_node_label: str =
|
|
85
|
+
class RouteTableToAssociationRel(CartographyRelSchema):
|
|
86
|
+
target_node_label: str = "EC2RouteTableAssociation"
|
|
84
87
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
85
|
-
{
|
|
88
|
+
{"id": PropertyRef("RouteTableAssociationIds", one_to_many=True)},
|
|
86
89
|
)
|
|
87
90
|
direction: LinkDirection = LinkDirection.OUTWARD
|
|
88
91
|
rel_label: str = "ASSOCIATION"
|
|
89
|
-
properties:
|
|
92
|
+
properties: RouteTableToAssociationRelRelProperties = (
|
|
93
|
+
RouteTableToAssociationRelRelProperties()
|
|
94
|
+
)
|
|
90
95
|
|
|
91
96
|
|
|
92
97
|
@dataclass(frozen=True)
|
|
93
|
-
class
|
|
94
|
-
lastupdated: PropertyRef = PropertyRef(
|
|
98
|
+
class RouteTableToVpnGatewayRelRelProperties(CartographyRelProperties):
|
|
99
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
95
100
|
|
|
96
101
|
|
|
97
102
|
# TODO implement AWSVpnGateways
|
|
98
103
|
@dataclass(frozen=True)
|
|
99
|
-
class
|
|
100
|
-
target_node_label: str =
|
|
104
|
+
class RouteTableToVpnGatewayRel(CartographyRelSchema):
|
|
105
|
+
target_node_label: str = "AWSVpnGateway"
|
|
101
106
|
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
102
|
-
{
|
|
107
|
+
{"id": PropertyRef("VpnGatewayIds", one_to_many=True)},
|
|
103
108
|
)
|
|
104
109
|
direction: LinkDirection = LinkDirection.OUTWARD
|
|
105
110
|
rel_label: str = "CONNECTED_TO"
|
|
106
|
-
properties:
|
|
111
|
+
properties: RouteTableToVpnGatewayRelRelProperties = (
|
|
112
|
+
RouteTableToVpnGatewayRelRelProperties()
|
|
113
|
+
)
|
|
107
114
|
|
|
108
115
|
|
|
109
116
|
@dataclass(frozen=True)
|
|
110
117
|
class RouteTableSchema(CartographyNodeSchema):
|
|
111
|
-
label: str =
|
|
118
|
+
label: str = "EC2RouteTable"
|
|
112
119
|
properties: RouteTableNodeProperties = RouteTableNodeProperties()
|
|
113
|
-
sub_resource_relationship:
|
|
120
|
+
sub_resource_relationship: RouteTableToAWSAccountRel = RouteTableToAWSAccountRel()
|
|
114
121
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
115
122
|
[
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
123
|
+
RouteTableToVpcRel(),
|
|
124
|
+
RouteTableToRouteRel(),
|
|
125
|
+
RouteTableToAssociationRel(),
|
|
126
|
+
RouteTableToVpnGatewayRel(),
|
|
120
127
|
],
|
|
121
128
|
)
|