cartography 0.107.0rc3__py3-none-any.whl → 0.108.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/_version.py +2 -2
- cartography/cli.py +10 -0
- cartography/config.py +5 -0
- cartography/data/indexes.cypher +0 -10
- cartography/data/jobs/cleanup/github_repos_cleanup.json +2 -0
- cartography/intel/aws/__init__.py +1 -0
- cartography/intel/aws/cloudtrail.py +17 -4
- cartography/intel/aws/cloudtrail_management_events.py +560 -16
- cartography/intel/aws/cloudwatch.py +73 -4
- cartography/intel/aws/ec2/security_groups.py +140 -122
- cartography/intel/aws/ec2/snapshots.py +47 -84
- cartography/intel/aws/ec2/subnets.py +37 -63
- cartography/intel/aws/ecr.py +55 -80
- cartography/intel/aws/elasticache.py +102 -79
- cartography/intel/aws/guardduty.py +275 -0
- cartography/intel/aws/resources.py +2 -0
- cartography/intel/aws/secretsmanager.py +62 -44
- cartography/intel/github/repos.py +370 -28
- cartography/models/aws/cloudtrail/management_events.py +95 -6
- cartography/models/aws/cloudtrail/trail.py +21 -0
- cartography/models/aws/cloudwatch/metric_alarm.py +53 -0
- cartography/models/aws/ec2/security_group_rules.py +109 -0
- cartography/models/aws/ec2/security_groups.py +90 -0
- cartography/models/aws/ec2/snapshots.py +58 -0
- cartography/models/aws/ec2/subnets.py +65 -0
- cartography/models/aws/ec2/volumes.py +20 -0
- cartography/models/aws/ecr/__init__.py +0 -0
- cartography/models/aws/ecr/image.py +41 -0
- cartography/models/aws/ecr/repository.py +72 -0
- cartography/models/aws/ecr/repository_image.py +95 -0
- cartography/models/aws/elasticache/__init__.py +0 -0
- cartography/models/aws/elasticache/cluster.py +65 -0
- cartography/models/aws/elasticache/topic.py +67 -0
- cartography/models/aws/guardduty/__init__.py +1 -0
- cartography/models/aws/guardduty/findings.py +102 -0
- cartography/models/aws/secretsmanager/secret.py +106 -0
- cartography/models/github/dependencies.py +74 -0
- cartography/models/github/manifests.py +49 -0
- {cartography-0.107.0rc3.dist-info → cartography-0.108.0.dist-info}/METADATA +3 -3
- {cartography-0.107.0rc3.dist-info → cartography-0.108.0.dist-info}/RECORD +44 -29
- cartography/data/jobs/cleanup/aws_import_ec2_security_groupinfo_cleanup.json +0 -24
- cartography/data/jobs/cleanup/aws_import_secrets_cleanup.json +0 -8
- cartography/data/jobs/cleanup/aws_import_snapshots_cleanup.json +0 -30
- {cartography-0.107.0rc3.dist-info → cartography-0.108.0.dist-info}/WHEEL +0 -0
- {cartography-0.107.0rc3.dist-info → cartography-0.108.0.dist-info}/entry_points.txt +0 -0
- {cartography-0.107.0rc3.dist-info → cartography-0.108.0.dist-info}/licenses/LICENSE +0 -0
- {cartography-0.107.0rc3.dist-info → cartography-0.108.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from cartography.models.core.common import PropertyRef
|
|
4
|
+
from cartography.models.core.nodes import CartographyNodeProperties
|
|
5
|
+
from cartography.models.core.nodes import CartographyNodeSchema
|
|
6
|
+
from cartography.models.core.nodes import ExtraNodeLabels
|
|
7
|
+
from cartography.models.core.relationships import CartographyRelProperties
|
|
8
|
+
from cartography.models.core.relationships import CartographyRelSchema
|
|
9
|
+
from cartography.models.core.relationships import LinkDirection
|
|
10
|
+
from cartography.models.core.relationships import make_target_node_matcher
|
|
11
|
+
from cartography.models.core.relationships import OtherRelationships
|
|
12
|
+
from cartography.models.core.relationships import TargetNodeMatcher
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass(frozen=True)
|
|
16
|
+
class IpRuleNodeProperties(CartographyNodeProperties):
|
|
17
|
+
id: PropertyRef = PropertyRef("RuleId")
|
|
18
|
+
ruleid: PropertyRef = PropertyRef("RuleId", extra_index=True)
|
|
19
|
+
groupid: PropertyRef = PropertyRef("GroupId", extra_index=True)
|
|
20
|
+
protocol: PropertyRef = PropertyRef("Protocol")
|
|
21
|
+
fromport: PropertyRef = PropertyRef("FromPort")
|
|
22
|
+
toport: PropertyRef = PropertyRef("ToPort")
|
|
23
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass(frozen=True)
|
|
27
|
+
class IpRuleToAWSAccountRelProperties(CartographyRelProperties):
|
|
28
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@dataclass(frozen=True)
|
|
32
|
+
class IpRuleToAWSAccountRel(CartographyRelSchema):
|
|
33
|
+
target_node_label: str = "AWSAccount"
|
|
34
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
35
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)}
|
|
36
|
+
)
|
|
37
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
38
|
+
rel_label: str = "RESOURCE"
|
|
39
|
+
properties: IpRuleToAWSAccountRelProperties = IpRuleToAWSAccountRelProperties()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@dataclass(frozen=True)
|
|
43
|
+
class IpRuleToSecurityGroupRelProperties(CartographyRelProperties):
|
|
44
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@dataclass(frozen=True)
|
|
48
|
+
class IpRuleToSecurityGroupRel(CartographyRelSchema):
|
|
49
|
+
target_node_label: str = "EC2SecurityGroup"
|
|
50
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
51
|
+
{"groupid": PropertyRef("GroupId")}
|
|
52
|
+
)
|
|
53
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
54
|
+
rel_label: str = "MEMBER_OF_EC2_SECURITY_GROUP"
|
|
55
|
+
properties: IpRuleToSecurityGroupRelProperties = (
|
|
56
|
+
IpRuleToSecurityGroupRelProperties()
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@dataclass(frozen=True)
|
|
61
|
+
class IpRangeNodeProperties(CartographyNodeProperties):
|
|
62
|
+
id: PropertyRef = PropertyRef("RangeId")
|
|
63
|
+
range: PropertyRef = PropertyRef("RangeId")
|
|
64
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@dataclass(frozen=True)
|
|
68
|
+
class IpRangeToIpRuleRelProperties(CartographyRelProperties):
|
|
69
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
@dataclass(frozen=True)
|
|
73
|
+
class IpRangeToIpRuleRel(CartographyRelSchema):
|
|
74
|
+
target_node_label: str = "IpRule"
|
|
75
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
76
|
+
{"ruleid": PropertyRef("RuleId")}
|
|
77
|
+
)
|
|
78
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
79
|
+
rel_label: str = "MEMBER_OF_IP_RULE"
|
|
80
|
+
properties: IpRangeToIpRuleRelProperties = IpRangeToIpRuleRelProperties()
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@dataclass(frozen=True)
|
|
84
|
+
class IpRuleSchema(CartographyNodeSchema):
|
|
85
|
+
label: str = "IpRule"
|
|
86
|
+
properties: IpRuleNodeProperties = IpRuleNodeProperties()
|
|
87
|
+
sub_resource_relationship: IpRuleToAWSAccountRel = IpRuleToAWSAccountRel()
|
|
88
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
89
|
+
[IpRuleToSecurityGroupRel()]
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
@dataclass(frozen=True)
|
|
94
|
+
class IpPermissionInboundSchema(CartographyNodeSchema):
|
|
95
|
+
label: str = "IpRule"
|
|
96
|
+
extra_node_labels: ExtraNodeLabels = ExtraNodeLabels(["IpPermissionInbound"])
|
|
97
|
+
properties: IpRuleNodeProperties = IpRuleNodeProperties()
|
|
98
|
+
sub_resource_relationship: IpRuleToAWSAccountRel = IpRuleToAWSAccountRel()
|
|
99
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
100
|
+
[IpRuleToSecurityGroupRel()]
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
@dataclass(frozen=True)
|
|
105
|
+
class IpRangeSchema(CartographyNodeSchema):
|
|
106
|
+
label: str = "IpRange"
|
|
107
|
+
properties: IpRangeNodeProperties = IpRangeNodeProperties()
|
|
108
|
+
sub_resource_relationship: IpRuleToAWSAccountRel = IpRuleToAWSAccountRel()
|
|
109
|
+
other_relationships: OtherRelationships = OtherRelationships([IpRangeToIpRuleRel()])
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from cartography.models.core.common import PropertyRef
|
|
4
|
+
from cartography.models.core.nodes import CartographyNodeProperties
|
|
5
|
+
from cartography.models.core.nodes import CartographyNodeSchema
|
|
6
|
+
from cartography.models.core.relationships import CartographyRelProperties
|
|
7
|
+
from cartography.models.core.relationships import CartographyRelSchema
|
|
8
|
+
from cartography.models.core.relationships import LinkDirection
|
|
9
|
+
from cartography.models.core.relationships import make_target_node_matcher
|
|
10
|
+
from cartography.models.core.relationships import OtherRelationships
|
|
11
|
+
from cartography.models.core.relationships import TargetNodeMatcher
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass(frozen=True)
|
|
15
|
+
class EC2SecurityGroupNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("GroupId")
|
|
17
|
+
groupid: PropertyRef = PropertyRef("GroupId", extra_index=True)
|
|
18
|
+
name: PropertyRef = PropertyRef("GroupName")
|
|
19
|
+
description: PropertyRef = PropertyRef("Description")
|
|
20
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
21
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclass(frozen=True)
|
|
25
|
+
class EC2SecurityGroupToAWSAccountRelProperties(CartographyRelProperties):
|
|
26
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass(frozen=True)
|
|
30
|
+
class EC2SecurityGroupToAWSAccountRel(CartographyRelSchema):
|
|
31
|
+
target_node_label: str = "AWSAccount"
|
|
32
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
33
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)}
|
|
34
|
+
)
|
|
35
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
36
|
+
rel_label: str = "RESOURCE"
|
|
37
|
+
properties: EC2SecurityGroupToAWSAccountRelProperties = (
|
|
38
|
+
EC2SecurityGroupToAWSAccountRelProperties()
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@dataclass(frozen=True)
|
|
43
|
+
class EC2SecurityGroupToVpcRelProperties(CartographyRelProperties):
|
|
44
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@dataclass(frozen=True)
|
|
48
|
+
class EC2SecurityGroupToVpcRel(CartographyRelSchema):
|
|
49
|
+
target_node_label: str = "AWSVpc"
|
|
50
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
51
|
+
{"vpcid": PropertyRef("VpcId")}
|
|
52
|
+
)
|
|
53
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
54
|
+
rel_label: str = "MEMBER_OF_EC2_SECURITY_GROUP"
|
|
55
|
+
properties: EC2SecurityGroupToVpcRelProperties = (
|
|
56
|
+
EC2SecurityGroupToVpcRelProperties()
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@dataclass(frozen=True)
|
|
61
|
+
class EC2SecurityGroupToSourceGroupRelProperties(CartographyRelProperties):
|
|
62
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@dataclass(frozen=True)
|
|
66
|
+
class EC2SecurityGroupToSourceGroupRel(CartographyRelSchema):
|
|
67
|
+
target_node_label: str = "EC2SecurityGroup"
|
|
68
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
69
|
+
{"groupid": PropertyRef("SOURCE_GROUP_IDS", one_to_many=True)}
|
|
70
|
+
)
|
|
71
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
72
|
+
rel_label: str = "ALLOWS_TRAFFIC_FROM"
|
|
73
|
+
properties: EC2SecurityGroupToSourceGroupRelProperties = (
|
|
74
|
+
EC2SecurityGroupToSourceGroupRelProperties()
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
@dataclass(frozen=True)
|
|
79
|
+
class EC2SecurityGroupSchema(CartographyNodeSchema):
|
|
80
|
+
label: str = "EC2SecurityGroup"
|
|
81
|
+
properties: EC2SecurityGroupNodeProperties = EC2SecurityGroupNodeProperties()
|
|
82
|
+
sub_resource_relationship: EC2SecurityGroupToAWSAccountRel = (
|
|
83
|
+
EC2SecurityGroupToAWSAccountRel()
|
|
84
|
+
)
|
|
85
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
86
|
+
[
|
|
87
|
+
EC2SecurityGroupToVpcRel(),
|
|
88
|
+
EC2SecurityGroupToSourceGroupRel(),
|
|
89
|
+
]
|
|
90
|
+
)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from cartography.models.core.common import PropertyRef
|
|
4
|
+
from cartography.models.core.nodes import CartographyNodeProperties
|
|
5
|
+
from cartography.models.core.nodes import CartographyNodeSchema
|
|
6
|
+
from cartography.models.core.relationships import CartographyRelProperties
|
|
7
|
+
from cartography.models.core.relationships import CartographyRelSchema
|
|
8
|
+
from cartography.models.core.relationships import LinkDirection
|
|
9
|
+
from cartography.models.core.relationships import make_target_node_matcher
|
|
10
|
+
from cartography.models.core.relationships import OtherRelationships
|
|
11
|
+
from cartography.models.core.relationships import TargetNodeMatcher
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass(frozen=True)
|
|
15
|
+
class EBSSnapshotNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("SnapshotId")
|
|
17
|
+
snapshotid: PropertyRef = PropertyRef("SnapshotId", extra_index=True)
|
|
18
|
+
description: PropertyRef = PropertyRef("Description")
|
|
19
|
+
encrypted: PropertyRef = PropertyRef("Encrypted")
|
|
20
|
+
progress: PropertyRef = PropertyRef("Progress")
|
|
21
|
+
starttime: PropertyRef = PropertyRef("StartTime")
|
|
22
|
+
state: PropertyRef = PropertyRef("State")
|
|
23
|
+
statemessage: PropertyRef = PropertyRef("StateMessage")
|
|
24
|
+
volumeid: PropertyRef = PropertyRef("VolumeId")
|
|
25
|
+
volumesize: PropertyRef = PropertyRef("VolumeSize")
|
|
26
|
+
outpostarn: PropertyRef = PropertyRef("OutpostArn")
|
|
27
|
+
dataencryptionkeyid: PropertyRef = PropertyRef("DataEncryptionKeyId")
|
|
28
|
+
kmskeyid: PropertyRef = PropertyRef("KmsKeyId")
|
|
29
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
30
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@dataclass(frozen=True)
|
|
34
|
+
class EBSSnapshotToAWSAccountRelProperties(CartographyRelProperties):
|
|
35
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@dataclass(frozen=True)
|
|
39
|
+
class EBSSnapshotToAWSAccountRel(CartographyRelSchema):
|
|
40
|
+
target_node_label: str = "AWSAccount"
|
|
41
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
42
|
+
{
|
|
43
|
+
"id": PropertyRef("AWS_ID", set_in_kwargs=True),
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
47
|
+
rel_label: str = "RESOURCE"
|
|
48
|
+
properties: EBSSnapshotToAWSAccountRelProperties = (
|
|
49
|
+
EBSSnapshotToAWSAccountRelProperties()
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@dataclass(frozen=True)
|
|
54
|
+
class EBSSnapshotSchema(CartographyNodeSchema):
|
|
55
|
+
label: str = "EBSSnapshot"
|
|
56
|
+
properties: EBSSnapshotNodeProperties = EBSSnapshotNodeProperties()
|
|
57
|
+
sub_resource_relationship: EBSSnapshotToAWSAccountRel = EBSSnapshotToAWSAccountRel()
|
|
58
|
+
other_relationships: OtherRelationships = OtherRelationships([])
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from cartography.models.aws.ec2.auto_scaling_groups import EC2SubnetToAWSAccountRel
|
|
4
|
+
from cartography.models.core.common import PropertyRef
|
|
5
|
+
from cartography.models.core.nodes import CartographyNodeProperties
|
|
6
|
+
from cartography.models.core.nodes import CartographyNodeSchema
|
|
7
|
+
from cartography.models.core.relationships import CartographyRelProperties
|
|
8
|
+
from cartography.models.core.relationships import CartographyRelSchema
|
|
9
|
+
from cartography.models.core.relationships import LinkDirection
|
|
10
|
+
from cartography.models.core.relationships import make_target_node_matcher
|
|
11
|
+
from cartography.models.core.relationships import OtherRelationships
|
|
12
|
+
from cartography.models.core.relationships import TargetNodeMatcher
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass(frozen=True)
|
|
16
|
+
class EC2SubnetNodeProperties(CartographyNodeProperties):
|
|
17
|
+
id: PropertyRef = PropertyRef("SubnetId")
|
|
18
|
+
subnetid: PropertyRef = PropertyRef("SubnetId", extra_index=True)
|
|
19
|
+
subnet_id: PropertyRef = PropertyRef("SubnetId", extra_index=True)
|
|
20
|
+
subnet_arn: PropertyRef = PropertyRef("SubnetArn")
|
|
21
|
+
name: PropertyRef = PropertyRef("CidrBlock")
|
|
22
|
+
cidr_block: PropertyRef = PropertyRef("CidrBlock")
|
|
23
|
+
available_ip_address_count: PropertyRef = PropertyRef("AvailableIpAddressCount")
|
|
24
|
+
default_for_az: PropertyRef = PropertyRef("DefaultForAz")
|
|
25
|
+
map_customer_owned_ip_on_launch: PropertyRef = PropertyRef(
|
|
26
|
+
"MapCustomerOwnedIpOnLaunch"
|
|
27
|
+
)
|
|
28
|
+
state: PropertyRef = PropertyRef("State")
|
|
29
|
+
assignipv6addressoncreation: PropertyRef = PropertyRef(
|
|
30
|
+
"AssignIpv6AddressOnCreation"
|
|
31
|
+
)
|
|
32
|
+
map_public_ip_on_launch: PropertyRef = PropertyRef("MapPublicIpOnLaunch")
|
|
33
|
+
availability_zone: PropertyRef = PropertyRef("AvailabilityZone")
|
|
34
|
+
availability_zone_id: PropertyRef = PropertyRef("AvailabilityZoneId")
|
|
35
|
+
vpc_id: PropertyRef = PropertyRef("VpcId")
|
|
36
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
37
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass(frozen=True)
|
|
41
|
+
class EC2SubnetToVpcRelProperties(CartographyRelProperties):
|
|
42
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@dataclass(frozen=True)
|
|
46
|
+
class EC2SubnetToVpcRel(CartographyRelSchema):
|
|
47
|
+
target_node_label: str = "AWSVpc"
|
|
48
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
49
|
+
{"id": PropertyRef("VpcId")}
|
|
50
|
+
)
|
|
51
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
52
|
+
rel_label: str = "MEMBER_OF_AWS_VPC"
|
|
53
|
+
properties: EC2SubnetToVpcRelProperties = EC2SubnetToVpcRelProperties()
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@dataclass(frozen=True)
|
|
57
|
+
class EC2SubnetSchema(CartographyNodeSchema):
|
|
58
|
+
label: str = "EC2Subnet"
|
|
59
|
+
properties: EC2SubnetNodeProperties = EC2SubnetNodeProperties()
|
|
60
|
+
sub_resource_relationship: EC2SubnetToAWSAccountRel = EC2SubnetToAWSAccountRel()
|
|
61
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
62
|
+
[
|
|
63
|
+
EC2SubnetToVpcRel(),
|
|
64
|
+
]
|
|
65
|
+
)
|
|
@@ -68,6 +68,24 @@ class EBSVolumeToEC2InstanceRel(CartographyRelSchema):
|
|
|
68
68
|
)
|
|
69
69
|
|
|
70
70
|
|
|
71
|
+
@dataclass(frozen=True)
|
|
72
|
+
class EBSVolumeToEBSSnapshotRelProperties(CartographyRelProperties):
|
|
73
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
@dataclass(frozen=True)
|
|
77
|
+
class EBSVolumeToEBSSnapshotRel(CartographyRelSchema):
|
|
78
|
+
target_node_label: str = "EBSSnapshot"
|
|
79
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
80
|
+
{"id": PropertyRef("SnapshotId")},
|
|
81
|
+
)
|
|
82
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
83
|
+
rel_label: str = "CREATED_FROM"
|
|
84
|
+
properties: EBSVolumeToEBSSnapshotRelProperties = (
|
|
85
|
+
EBSVolumeToEBSSnapshotRelProperties()
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
71
89
|
@dataclass(frozen=True)
|
|
72
90
|
class EBSVolumeSchema(CartographyNodeSchema):
|
|
73
91
|
"""
|
|
@@ -80,6 +98,7 @@ class EBSVolumeSchema(CartographyNodeSchema):
|
|
|
80
98
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
81
99
|
[
|
|
82
100
|
EBSVolumeToEC2InstanceRel(),
|
|
101
|
+
EBSVolumeToEBSSnapshotRel(),
|
|
83
102
|
],
|
|
84
103
|
)
|
|
85
104
|
|
|
@@ -110,5 +129,6 @@ class EBSVolumeInstanceSchema(CartographyNodeSchema):
|
|
|
110
129
|
other_relationships: OtherRelationships = OtherRelationships(
|
|
111
130
|
[
|
|
112
131
|
EBSVolumeToEC2InstanceRel(),
|
|
132
|
+
EBSVolumeToEBSSnapshotRel(),
|
|
113
133
|
],
|
|
114
134
|
)
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from cartography.models.core.common import PropertyRef
|
|
4
|
+
from cartography.models.core.nodes import CartographyNodeProperties
|
|
5
|
+
from cartography.models.core.nodes import CartographyNodeSchema
|
|
6
|
+
from cartography.models.core.relationships import CartographyRelProperties
|
|
7
|
+
from cartography.models.core.relationships import CartographyRelSchema
|
|
8
|
+
from cartography.models.core.relationships import LinkDirection
|
|
9
|
+
from cartography.models.core.relationships import make_target_node_matcher
|
|
10
|
+
from cartography.models.core.relationships import TargetNodeMatcher
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(frozen=True)
|
|
14
|
+
class ECRImageNodeProperties(CartographyNodeProperties):
|
|
15
|
+
id: PropertyRef = PropertyRef("imageDigest")
|
|
16
|
+
digest: PropertyRef = PropertyRef("imageDigest")
|
|
17
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
18
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass(frozen=True)
|
|
22
|
+
class ECRImageToAWSAccountRelProperties(CartographyRelProperties):
|
|
23
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass(frozen=True)
|
|
27
|
+
class ECRImageToAWSAccountRel(CartographyRelSchema):
|
|
28
|
+
target_node_label: str = "AWSAccount"
|
|
29
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
30
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)}
|
|
31
|
+
)
|
|
32
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
33
|
+
rel_label: str = "RESOURCE"
|
|
34
|
+
properties: ECRImageToAWSAccountRelProperties = ECRImageToAWSAccountRelProperties()
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@dataclass(frozen=True)
|
|
38
|
+
class ECRImageSchema(CartographyNodeSchema):
|
|
39
|
+
label: str = "ECRImage"
|
|
40
|
+
properties: ECRImageNodeProperties = ECRImageNodeProperties()
|
|
41
|
+
sub_resource_relationship: ECRImageToAWSAccountRel = ECRImageToAWSAccountRel()
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from cartography.models.core.common import PropertyRef
|
|
4
|
+
from cartography.models.core.nodes import CartographyNodeProperties
|
|
5
|
+
from cartography.models.core.nodes import CartographyNodeSchema
|
|
6
|
+
from cartography.models.core.relationships import CartographyRelProperties
|
|
7
|
+
from cartography.models.core.relationships import CartographyRelSchema
|
|
8
|
+
from cartography.models.core.relationships import LinkDirection
|
|
9
|
+
from cartography.models.core.relationships import make_target_node_matcher
|
|
10
|
+
from cartography.models.core.relationships import OtherRelationships
|
|
11
|
+
from cartography.models.core.relationships import TargetNodeMatcher
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass(frozen=True)
|
|
15
|
+
class ECRRepositoryNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("repositoryArn")
|
|
17
|
+
arn: PropertyRef = PropertyRef("repositoryArn", extra_index=True)
|
|
18
|
+
name: PropertyRef = PropertyRef("repositoryName", extra_index=True)
|
|
19
|
+
uri: PropertyRef = PropertyRef("repositoryUri", extra_index=True)
|
|
20
|
+
created_at: PropertyRef = PropertyRef("createdAt")
|
|
21
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
22
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass(frozen=True)
|
|
26
|
+
class ECRRepositoryToAWSAccountRelProperties(CartographyRelProperties):
|
|
27
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(frozen=True)
|
|
31
|
+
class ECRRepositoryToAWSAccountRel(CartographyRelSchema):
|
|
32
|
+
target_node_label: str = "AWSAccount"
|
|
33
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
34
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)}
|
|
35
|
+
)
|
|
36
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
37
|
+
rel_label: str = "RESOURCE"
|
|
38
|
+
properties: ECRRepositoryToAWSAccountRelProperties = (
|
|
39
|
+
ECRRepositoryToAWSAccountRelProperties()
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@dataclass(frozen=True)
|
|
44
|
+
class ECRRepositoryToRepositoryImageRelProperties(CartographyRelProperties):
|
|
45
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@dataclass(frozen=True)
|
|
49
|
+
class ECRRepositoryToRepositoryImageRel(CartographyRelSchema):
|
|
50
|
+
target_node_label: str = "ECRRepositoryImage"
|
|
51
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
52
|
+
{"id": PropertyRef("id")}
|
|
53
|
+
)
|
|
54
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
55
|
+
rel_label: str = "REPO_IMAGE"
|
|
56
|
+
properties: ECRRepositoryToRepositoryImageRelProperties = (
|
|
57
|
+
ECRRepositoryToRepositoryImageRelProperties()
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@dataclass(frozen=True)
|
|
62
|
+
class ECRRepositorySchema(CartographyNodeSchema):
|
|
63
|
+
label: str = "ECRRepository"
|
|
64
|
+
properties: ECRRepositoryNodeProperties = ECRRepositoryNodeProperties()
|
|
65
|
+
sub_resource_relationship: ECRRepositoryToAWSAccountRel = (
|
|
66
|
+
ECRRepositoryToAWSAccountRel()
|
|
67
|
+
)
|
|
68
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
69
|
+
[
|
|
70
|
+
ECRRepositoryToRepositoryImageRel(),
|
|
71
|
+
]
|
|
72
|
+
)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from cartography.models.core.common import PropertyRef
|
|
4
|
+
from cartography.models.core.nodes import CartographyNodeProperties
|
|
5
|
+
from cartography.models.core.nodes import CartographyNodeSchema
|
|
6
|
+
from cartography.models.core.relationships import CartographyRelProperties
|
|
7
|
+
from cartography.models.core.relationships import CartographyRelSchema
|
|
8
|
+
from cartography.models.core.relationships import LinkDirection
|
|
9
|
+
from cartography.models.core.relationships import make_target_node_matcher
|
|
10
|
+
from cartography.models.core.relationships import OtherRelationships
|
|
11
|
+
from cartography.models.core.relationships import TargetNodeMatcher
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass(frozen=True)
|
|
15
|
+
class ECRRepositoryImageNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("id")
|
|
17
|
+
tag: PropertyRef = PropertyRef("imageTag")
|
|
18
|
+
uri: PropertyRef = PropertyRef("uri")
|
|
19
|
+
repo_uri: PropertyRef = PropertyRef("repo_uri")
|
|
20
|
+
image_size_bytes: PropertyRef = PropertyRef("imageSizeInBytes")
|
|
21
|
+
image_pushed_at: PropertyRef = PropertyRef("imagePushedAt")
|
|
22
|
+
image_manifest_media_type: PropertyRef = PropertyRef("imageManifestMediaType")
|
|
23
|
+
artifact_media_type: PropertyRef = PropertyRef("artifactMediaType")
|
|
24
|
+
last_recorded_pull_time: PropertyRef = PropertyRef("lastRecordedPullTime")
|
|
25
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
26
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass(frozen=True)
|
|
30
|
+
class ECRRepositoryImageToAWSAccountRelProperties(CartographyRelProperties):
|
|
31
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@dataclass(frozen=True)
|
|
35
|
+
class ECRRepositoryImageToAWSAccountRel(CartographyRelSchema):
|
|
36
|
+
target_node_label: str = "AWSAccount"
|
|
37
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
38
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)}
|
|
39
|
+
)
|
|
40
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
41
|
+
rel_label: str = "RESOURCE"
|
|
42
|
+
properties: ECRRepositoryImageToAWSAccountRelProperties = (
|
|
43
|
+
ECRRepositoryImageToAWSAccountRelProperties()
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@dataclass(frozen=True)
|
|
48
|
+
class ECRRepositoryImageToECRRepositoryRelProperties(CartographyRelProperties):
|
|
49
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@dataclass(frozen=True)
|
|
53
|
+
class ECRRepositoryImageToECRRepositoryRel(CartographyRelSchema):
|
|
54
|
+
target_node_label: str = "ECRRepository"
|
|
55
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
56
|
+
{"uri": PropertyRef("repo_uri")}
|
|
57
|
+
)
|
|
58
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
59
|
+
rel_label: str = "REPO_IMAGE"
|
|
60
|
+
properties: ECRRepositoryImageToECRRepositoryRelProperties = (
|
|
61
|
+
ECRRepositoryImageToECRRepositoryRelProperties()
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@dataclass(frozen=True)
|
|
66
|
+
class ECRRepositoryImageToECRImageRelProperties(CartographyRelProperties):
|
|
67
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
@dataclass(frozen=True)
|
|
71
|
+
class ECRRepositoryImageToECRImageRel(CartographyRelSchema):
|
|
72
|
+
target_node_label: str = "ECRImage"
|
|
73
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
74
|
+
{"id": PropertyRef("imageDigest")}
|
|
75
|
+
)
|
|
76
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
77
|
+
rel_label: str = "IMAGE"
|
|
78
|
+
properties: ECRRepositoryImageToECRImageRelProperties = (
|
|
79
|
+
ECRRepositoryImageToECRImageRelProperties()
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@dataclass(frozen=True)
|
|
84
|
+
class ECRRepositoryImageSchema(CartographyNodeSchema):
|
|
85
|
+
label: str = "ECRRepositoryImage"
|
|
86
|
+
properties: ECRRepositoryImageNodeProperties = ECRRepositoryImageNodeProperties()
|
|
87
|
+
sub_resource_relationship: ECRRepositoryImageToAWSAccountRel = (
|
|
88
|
+
ECRRepositoryImageToAWSAccountRel()
|
|
89
|
+
)
|
|
90
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
91
|
+
[
|
|
92
|
+
ECRRepositoryImageToECRRepositoryRel(),
|
|
93
|
+
ECRRepositoryImageToECRImageRel(),
|
|
94
|
+
]
|
|
95
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from cartography.models.core.common import PropertyRef
|
|
4
|
+
from cartography.models.core.nodes import CartographyNodeProperties
|
|
5
|
+
from cartography.models.core.nodes import CartographyNodeSchema
|
|
6
|
+
from cartography.models.core.relationships import CartographyRelProperties
|
|
7
|
+
from cartography.models.core.relationships import CartographyRelSchema
|
|
8
|
+
from cartography.models.core.relationships import LinkDirection
|
|
9
|
+
from cartography.models.core.relationships import make_target_node_matcher
|
|
10
|
+
from cartography.models.core.relationships import TargetNodeMatcher
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(frozen=True)
|
|
14
|
+
class ElasticacheClusterNodeProperties(CartographyNodeProperties):
|
|
15
|
+
id: PropertyRef = PropertyRef("ARN")
|
|
16
|
+
arn: PropertyRef = PropertyRef("ARN", extra_index=True)
|
|
17
|
+
cache_cluster_id: PropertyRef = PropertyRef("CacheClusterId")
|
|
18
|
+
cache_node_type: PropertyRef = PropertyRef("CacheNodeType")
|
|
19
|
+
engine: PropertyRef = PropertyRef("Engine")
|
|
20
|
+
engine_version: PropertyRef = PropertyRef("EngineVersion")
|
|
21
|
+
cache_cluster_status: PropertyRef = PropertyRef("CacheClusterStatus")
|
|
22
|
+
num_cache_nodes: PropertyRef = PropertyRef("NumCacheNodes")
|
|
23
|
+
preferred_availability_zone: PropertyRef = PropertyRef("PreferredAvailabilityZone")
|
|
24
|
+
preferred_maintenance_window: PropertyRef = PropertyRef(
|
|
25
|
+
"PreferredMaintenanceWindow"
|
|
26
|
+
)
|
|
27
|
+
cache_cluster_create_time: PropertyRef = PropertyRef("CacheClusterCreateTime")
|
|
28
|
+
cache_subnet_group_name: PropertyRef = PropertyRef("CacheSubnetGroupName")
|
|
29
|
+
auto_minor_version_upgrade: PropertyRef = PropertyRef("AutoMinorVersionUpgrade")
|
|
30
|
+
replication_group_id: PropertyRef = PropertyRef("ReplicationGroupId")
|
|
31
|
+
snapshot_retention_limit: PropertyRef = PropertyRef("SnapshotRetentionLimit")
|
|
32
|
+
snapshot_window: PropertyRef = PropertyRef("SnapshotWindow")
|
|
33
|
+
auth_token_enabled: PropertyRef = PropertyRef("AuthTokenEnabled")
|
|
34
|
+
transit_encryption_enabled: PropertyRef = PropertyRef("TransitEncryptionEnabled")
|
|
35
|
+
at_rest_encryption_enabled: PropertyRef = PropertyRef("AtRestEncryptionEnabled")
|
|
36
|
+
topic_arn: PropertyRef = PropertyRef("TopicArn")
|
|
37
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
38
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass(frozen=True)
|
|
42
|
+
class ElasticacheClusterToAWSAccountRelProperties(CartographyRelProperties):
|
|
43
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@dataclass(frozen=True)
|
|
47
|
+
class ElasticacheClusterToAWSAccountRel(CartographyRelSchema):
|
|
48
|
+
target_node_label: str = "AWSAccount"
|
|
49
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
50
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)}
|
|
51
|
+
)
|
|
52
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
53
|
+
rel_label: str = "RESOURCE"
|
|
54
|
+
properties: ElasticacheClusterToAWSAccountRelProperties = (
|
|
55
|
+
ElasticacheClusterToAWSAccountRelProperties()
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@dataclass(frozen=True)
|
|
60
|
+
class ElasticacheClusterSchema(CartographyNodeSchema):
|
|
61
|
+
label: str = "ElasticacheCluster"
|
|
62
|
+
properties: ElasticacheClusterNodeProperties = ElasticacheClusterNodeProperties()
|
|
63
|
+
sub_resource_relationship: ElasticacheClusterToAWSAccountRel = (
|
|
64
|
+
ElasticacheClusterToAWSAccountRel()
|
|
65
|
+
)
|