cartography 0.109.0rc1__py3-none-any.whl → 0.110.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/_version.py +2 -2
- cartography/cli.py +22 -0
- cartography/config.py +13 -0
- cartography/data/indexes.cypher +0 -15
- cartography/intel/aws/cloudtrail_management_events.py +21 -0
- cartography/intel/aws/eventbridge.py +91 -0
- cartography/intel/aws/glue.py +117 -0
- cartography/intel/aws/identitycenter.py +71 -23
- cartography/intel/aws/kms.py +160 -200
- cartography/intel/aws/lambda_function.py +206 -190
- cartography/intel/aws/rds.py +243 -458
- cartography/intel/aws/resources.py +4 -0
- cartography/intel/aws/route53.py +334 -332
- cartography/intel/entra/__init__.py +43 -41
- cartography/intel/entra/applications.py +1 -2
- cartography/intel/entra/ou.py +1 -1
- cartography/intel/entra/resources.py +20 -0
- cartography/intel/trivy/__init__.py +73 -13
- cartography/intel/trivy/scanner.py +115 -92
- cartography/models/aws/eventbridge/__init__.py +0 -0
- cartography/models/aws/eventbridge/rule.py +77 -0
- cartography/models/aws/glue/__init__.py +0 -0
- cartography/models/aws/glue/connection.py +51 -0
- cartography/models/aws/identitycenter/awspermissionset.py +44 -0
- cartography/models/aws/kms/__init__.py +0 -0
- cartography/models/aws/kms/aliases.py +86 -0
- cartography/models/aws/kms/grants.py +65 -0
- cartography/models/aws/kms/keys.py +88 -0
- cartography/models/aws/lambda_function/__init__.py +0 -0
- cartography/models/aws/lambda_function/alias.py +74 -0
- cartography/models/aws/lambda_function/event_source_mapping.py +88 -0
- cartography/models/aws/lambda_function/lambda_function.py +89 -0
- cartography/models/aws/lambda_function/layer.py +72 -0
- cartography/models/aws/rds/__init__.py +0 -0
- cartography/models/aws/rds/cluster.py +89 -0
- cartography/models/aws/rds/instance.py +154 -0
- cartography/models/aws/rds/snapshot.py +108 -0
- cartography/models/aws/rds/subnet_group.py +101 -0
- cartography/models/aws/route53/__init__.py +0 -0
- cartography/models/aws/route53/dnsrecord.py +214 -0
- cartography/models/aws/route53/nameserver.py +63 -0
- cartography/models/aws/route53/subzone.py +40 -0
- cartography/models/aws/route53/zone.py +47 -0
- cartography/models/snipeit/asset.py +1 -0
- cartography/util.py +8 -1
- {cartography-0.109.0rc1.dist-info → cartography-0.110.0rc1.dist-info}/METADATA +2 -2
- {cartography-0.109.0rc1.dist-info → cartography-0.110.0rc1.dist-info}/RECORD +51 -32
- cartography/data/jobs/cleanup/aws_dns_cleanup.json +0 -65
- cartography/data/jobs/cleanup/aws_import_identity_center_cleanup.json +0 -16
- cartography/data/jobs/cleanup/aws_import_lambda_cleanup.json +0 -50
- cartography/data/jobs/cleanup/aws_import_rds_clusters_cleanup.json +0 -23
- cartography/data/jobs/cleanup/aws_import_rds_instances_cleanup.json +0 -47
- cartography/data/jobs/cleanup/aws_import_rds_snapshots_cleanup.json +0 -23
- cartography/data/jobs/cleanup/aws_kms_details.json +0 -10
- {cartography-0.109.0rc1.dist-info → cartography-0.110.0rc1.dist-info}/WHEEL +0 -0
- {cartography-0.109.0rc1.dist-info → cartography-0.110.0rc1.dist-info}/entry_points.txt +0 -0
- {cartography-0.109.0rc1.dist-info → cartography-0.110.0rc1.dist-info}/licenses/LICENSE +0 -0
- {cartography-0.109.0rc1.dist-info → cartography-0.110.0rc1.dist-info}/top_level.txt +0 -0
|
@@ -6,8 +6,10 @@ from cartography.models.core.nodes import CartographyNodeSchema
|
|
|
6
6
|
from cartography.models.core.relationships import CartographyRelProperties
|
|
7
7
|
from cartography.models.core.relationships import CartographyRelSchema
|
|
8
8
|
from cartography.models.core.relationships import LinkDirection
|
|
9
|
+
from cartography.models.core.relationships import make_source_node_matcher
|
|
9
10
|
from cartography.models.core.relationships import make_target_node_matcher
|
|
10
11
|
from cartography.models.core.relationships import OtherRelationships
|
|
12
|
+
from cartography.models.core.relationships import SourceNodeMatcher
|
|
11
13
|
from cartography.models.core.relationships import TargetNodeMatcher
|
|
12
14
|
|
|
13
15
|
|
|
@@ -77,6 +79,48 @@ class AWSPermissionSetToAWSAccountRel(CartographyRelSchema):
|
|
|
77
79
|
)
|
|
78
80
|
|
|
79
81
|
|
|
82
|
+
@dataclass(frozen=True)
|
|
83
|
+
class RoleAssignmentAllowedByRelProperties(CartographyRelProperties):
|
|
84
|
+
"""
|
|
85
|
+
Properties for the ALLOWED_BY relationship between AWSRole and AWSSSOUser.
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
# Mandatory fields for MatchLinks
|
|
89
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
90
|
+
_sub_resource_label: PropertyRef = PropertyRef(
|
|
91
|
+
"_sub_resource_label", set_in_kwargs=True
|
|
92
|
+
)
|
|
93
|
+
_sub_resource_id: PropertyRef = PropertyRef("_sub_resource_id", set_in_kwargs=True)
|
|
94
|
+
|
|
95
|
+
# Role assignment specific properties
|
|
96
|
+
permission_set_arn: PropertyRef = PropertyRef("PermissionSetArn")
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
@dataclass(frozen=True)
|
|
100
|
+
class RoleAssignmentAllowedByMatchLink(CartographyRelSchema):
|
|
101
|
+
"""
|
|
102
|
+
MatchLink schema for ALLOWED_BY relationships from role assignments.
|
|
103
|
+
Creates relationships like: (AWSRole)-[:ALLOWED_BY]->(AWSSSOUser)
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
# MatchLink-specific fields for AWSRole as source
|
|
107
|
+
source_node_label: str = "AWSRole"
|
|
108
|
+
source_node_matcher: SourceNodeMatcher = make_source_node_matcher(
|
|
109
|
+
{"arn": PropertyRef("RoleArn")},
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
# Standard CartographyRelSchema fields for AWSSSOUser as target
|
|
113
|
+
target_node_label: str = "AWSSSOUser"
|
|
114
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
115
|
+
{"id": PropertyRef("UserId")},
|
|
116
|
+
)
|
|
117
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
118
|
+
rel_label: str = "ALLOWED_BY"
|
|
119
|
+
properties: RoleAssignmentAllowedByRelProperties = (
|
|
120
|
+
RoleAssignmentAllowedByRelProperties()
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
|
|
80
124
|
@dataclass(frozen=True)
|
|
81
125
|
class AWSPermissionSetSchema(CartographyNodeSchema):
|
|
82
126
|
label: str = "AWSPermissionSet"
|
|
File without changes
|
|
@@ -0,0 +1,86 @@
|
|
|
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 KMSAliasNodeProperties(CartographyNodeProperties):
|
|
16
|
+
"""
|
|
17
|
+
Properties for AWS KMS Alias
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
id: PropertyRef = PropertyRef("AliasArn")
|
|
21
|
+
arn: PropertyRef = PropertyRef("AliasArn", extra_index=True)
|
|
22
|
+
alias_name: PropertyRef = PropertyRef("AliasName", extra_index=True)
|
|
23
|
+
target_key_id: PropertyRef = PropertyRef("TargetKeyId")
|
|
24
|
+
|
|
25
|
+
# Date properties (will be converted to epoch timestamps)
|
|
26
|
+
creation_date: PropertyRef = PropertyRef("CreationDate")
|
|
27
|
+
last_updated_date: PropertyRef = PropertyRef("LastUpdatedDate")
|
|
28
|
+
|
|
29
|
+
# Standard cartography properties
|
|
30
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
31
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@dataclass(frozen=True)
|
|
35
|
+
class KMSAliasRelProperties(CartographyRelProperties):
|
|
36
|
+
"""
|
|
37
|
+
Properties for relationships between KMS Alias and other nodes
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@dataclass(frozen=True)
|
|
44
|
+
class KMSAliasToAWSAccountRel(CartographyRelSchema):
|
|
45
|
+
"""
|
|
46
|
+
Relationship between KMS Alias and AWS Account
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
target_node_label: str = "AWSAccount"
|
|
50
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
51
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
52
|
+
)
|
|
53
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
54
|
+
rel_label: str = "RESOURCE"
|
|
55
|
+
properties: KMSAliasRelProperties = KMSAliasRelProperties()
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@dataclass(frozen=True)
|
|
59
|
+
class KMSAliasToKMSKeyRel(CartographyRelSchema):
|
|
60
|
+
"""
|
|
61
|
+
Relationship between KMS Alias and its associated KMS Key
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
target_node_label: str = "KMSKey"
|
|
65
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
66
|
+
{"id": PropertyRef("TargetKeyId")},
|
|
67
|
+
)
|
|
68
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
69
|
+
rel_label: str = "KNOWN_AS"
|
|
70
|
+
properties: KMSAliasRelProperties = KMSAliasRelProperties()
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@dataclass(frozen=True)
|
|
74
|
+
class KMSAliasSchema(CartographyNodeSchema):
|
|
75
|
+
"""
|
|
76
|
+
Schema for AWS KMS Alias
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
label: str = "KMSAlias"
|
|
80
|
+
properties: KMSAliasNodeProperties = KMSAliasNodeProperties()
|
|
81
|
+
sub_resource_relationship: KMSAliasToAWSAccountRel = KMSAliasToAWSAccountRel()
|
|
82
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
83
|
+
[
|
|
84
|
+
KMSAliasToKMSKeyRel(),
|
|
85
|
+
],
|
|
86
|
+
)
|
|
@@ -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 OtherRelationships
|
|
11
|
+
from cartography.models.core.relationships import TargetNodeMatcher
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass(frozen=True)
|
|
15
|
+
class KMSGrantNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("GrantId")
|
|
17
|
+
grant_id: PropertyRef = PropertyRef("GrantId", extra_index=True)
|
|
18
|
+
name: PropertyRef = PropertyRef("Name")
|
|
19
|
+
grantee_principal: PropertyRef = PropertyRef("GranteePrincipal")
|
|
20
|
+
creation_date: PropertyRef = PropertyRef("CreationDate")
|
|
21
|
+
key_id: PropertyRef = PropertyRef("KeyId")
|
|
22
|
+
issuing_account: PropertyRef = PropertyRef("IssuingAccount")
|
|
23
|
+
operations: PropertyRef = PropertyRef("Operations")
|
|
24
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclass(frozen=True)
|
|
28
|
+
class KMSGrantRelProperties(CartographyRelProperties):
|
|
29
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass(frozen=True)
|
|
33
|
+
class KMSGrantToKMSKeyRel(CartographyRelSchema):
|
|
34
|
+
target_node_label: str = "KMSKey"
|
|
35
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
36
|
+
{"arn": PropertyRef("KeyId")}
|
|
37
|
+
)
|
|
38
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
39
|
+
rel_label: str = "APPLIED_ON"
|
|
40
|
+
properties: KMSGrantRelProperties = KMSGrantRelProperties()
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@dataclass(frozen=True)
|
|
44
|
+
class KMSGrantToAWSAccountRel(CartographyRelSchema):
|
|
45
|
+
"""
|
|
46
|
+
Relationship between KMSGrant and AWS Account
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
target_node_label: str = "AWSAccount"
|
|
50
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
51
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
52
|
+
)
|
|
53
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
54
|
+
rel_label: str = "RESOURCE"
|
|
55
|
+
properties: KMSGrantRelProperties = KMSGrantRelProperties()
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@dataclass(frozen=True)
|
|
59
|
+
class KMSGrantSchema(CartographyNodeSchema):
|
|
60
|
+
label: str = "KMSGrant"
|
|
61
|
+
properties: KMSGrantNodeProperties = KMSGrantNodeProperties()
|
|
62
|
+
sub_resource_relationship: KMSGrantToAWSAccountRel = KMSGrantToAWSAccountRel()
|
|
63
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
64
|
+
[KMSGrantToKMSKeyRel()]
|
|
65
|
+
)
|
|
@@ -0,0 +1,88 @@
|
|
|
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 KMSKeyNodeProperties(CartographyNodeProperties):
|
|
16
|
+
"""
|
|
17
|
+
Properties for AWS KMS Key
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
id: PropertyRef = PropertyRef("KeyId")
|
|
21
|
+
arn: PropertyRef = PropertyRef("Arn", extra_index=True)
|
|
22
|
+
key_id: PropertyRef = PropertyRef("KeyId", extra_index=True)
|
|
23
|
+
description: PropertyRef = PropertyRef("Description")
|
|
24
|
+
|
|
25
|
+
# Key configuration properties
|
|
26
|
+
enabled: PropertyRef = PropertyRef("Enabled")
|
|
27
|
+
key_state: PropertyRef = PropertyRef("KeyState")
|
|
28
|
+
key_usage: PropertyRef = PropertyRef("KeyUsage")
|
|
29
|
+
key_manager: PropertyRef = PropertyRef("KeyManager")
|
|
30
|
+
origin: PropertyRef = PropertyRef("Origin")
|
|
31
|
+
|
|
32
|
+
# Date properties (will be converted to epoch timestamps)
|
|
33
|
+
creation_date: PropertyRef = PropertyRef("CreationDate")
|
|
34
|
+
deletion_date: PropertyRef = PropertyRef("DeletionDate")
|
|
35
|
+
valid_to: PropertyRef = PropertyRef("ValidTo")
|
|
36
|
+
|
|
37
|
+
# Key store properties
|
|
38
|
+
custom_key_store_id: PropertyRef = PropertyRef("CustomKeyStoreId")
|
|
39
|
+
cloud_hsm_cluster_id: PropertyRef = PropertyRef("CloudHsmClusterId")
|
|
40
|
+
expiration_model: PropertyRef = PropertyRef("ExpirationModel")
|
|
41
|
+
|
|
42
|
+
# Key spec and algorithms
|
|
43
|
+
customer_master_key_spec: PropertyRef = PropertyRef("CustomerMasterKeySpec")
|
|
44
|
+
encryption_algorithms: PropertyRef = PropertyRef("EncryptionAlgorithms")
|
|
45
|
+
signing_algorithms: PropertyRef = PropertyRef("SigningAlgorithms")
|
|
46
|
+
|
|
47
|
+
# Policy analysis properties
|
|
48
|
+
anonymous_access: PropertyRef = PropertyRef("anonymous_access")
|
|
49
|
+
anonymous_actions: PropertyRef = PropertyRef("anonymous_actions")
|
|
50
|
+
|
|
51
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
52
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@dataclass(frozen=True)
|
|
56
|
+
class KMSKeyRelProperties(CartographyRelProperties):
|
|
57
|
+
"""
|
|
58
|
+
Properties for relationships between KMSKey and other nodes
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@dataclass(frozen=True)
|
|
65
|
+
class KMSKeyToAWSAccountRel(CartographyRelSchema):
|
|
66
|
+
"""
|
|
67
|
+
Relationship between KMSKey and AWS Account
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
target_node_label: str = "AWSAccount"
|
|
71
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
72
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
73
|
+
)
|
|
74
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
75
|
+
rel_label: str = "RESOURCE"
|
|
76
|
+
properties: KMSKeyRelProperties = KMSKeyRelProperties()
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@dataclass(frozen=True)
|
|
80
|
+
class KMSKeySchema(CartographyNodeSchema):
|
|
81
|
+
"""
|
|
82
|
+
Schema for AWS KMS Key
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
label: str = "KMSKey"
|
|
86
|
+
properties: KMSKeyNodeProperties = KMSKeyNodeProperties()
|
|
87
|
+
sub_resource_relationship: KMSKeyToAWSAccountRel = KMSKeyToAWSAccountRel()
|
|
88
|
+
other_relationships: OtherRelationships = OtherRelationships([])
|
|
File without changes
|
|
@@ -0,0 +1,74 @@
|
|
|
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 AWSLambdaFunctionAliasNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("AliasArn")
|
|
17
|
+
arn: PropertyRef = PropertyRef("AliasArn", extra_index=True)
|
|
18
|
+
aliasname: PropertyRef = PropertyRef("Name")
|
|
19
|
+
functionversion: PropertyRef = PropertyRef("FunctionVersion")
|
|
20
|
+
description: PropertyRef = PropertyRef("Description")
|
|
21
|
+
revisionid: PropertyRef = PropertyRef("RevisionId")
|
|
22
|
+
functionarn: PropertyRef = PropertyRef("FunctionArn")
|
|
23
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass(frozen=True)
|
|
27
|
+
class AWSLambdaFunctionAliasToAWSAccountRelProperties(CartographyRelProperties):
|
|
28
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# Standard relationship: AWSLambda --[:KNOWN_AS]--> AWSLambdaFunctionAlias
|
|
32
|
+
@dataclass(frozen=True)
|
|
33
|
+
class AWSLambdaToAliasRelProperties(CartographyRelProperties):
|
|
34
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@dataclass(frozen=True)
|
|
38
|
+
class AWSLambdaToAliasRel(CartographyRelSchema):
|
|
39
|
+
target_node_label: str = "AWSLambda"
|
|
40
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
41
|
+
{"id": PropertyRef("FunctionArn")},
|
|
42
|
+
)
|
|
43
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
44
|
+
rel_label: str = "KNOWN_AS"
|
|
45
|
+
properties: AWSLambdaToAliasRelProperties = AWSLambdaToAliasRelProperties()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@dataclass(frozen=True)
|
|
49
|
+
class AWSLambdaFunctionAliasToAWSAccountRel(CartographyRelSchema):
|
|
50
|
+
target_node_label: str = "AWSAccount"
|
|
51
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
52
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
53
|
+
)
|
|
54
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
55
|
+
rel_label: str = "RESOURCE"
|
|
56
|
+
properties: AWSLambdaFunctionAliasToAWSAccountRelProperties = (
|
|
57
|
+
AWSLambdaFunctionAliasToAWSAccountRelProperties()
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@dataclass(frozen=True)
|
|
62
|
+
class AWSLambdaFunctionAliasSchema(CartographyNodeSchema):
|
|
63
|
+
label: str = "AWSLambdaFunctionAlias"
|
|
64
|
+
properties: AWSLambdaFunctionAliasNodeProperties = (
|
|
65
|
+
AWSLambdaFunctionAliasNodeProperties()
|
|
66
|
+
)
|
|
67
|
+
sub_resource_relationship: AWSLambdaFunctionAliasToAWSAccountRel = (
|
|
68
|
+
AWSLambdaFunctionAliasToAWSAccountRel()
|
|
69
|
+
)
|
|
70
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
71
|
+
[
|
|
72
|
+
AWSLambdaToAliasRel(),
|
|
73
|
+
]
|
|
74
|
+
)
|
|
@@ -0,0 +1,88 @@
|
|
|
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 AWSLambdaEventSourceMappingNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("UUID")
|
|
17
|
+
batchsize: PropertyRef = PropertyRef("BatchSize")
|
|
18
|
+
startingposition: PropertyRef = PropertyRef("StartingPosition")
|
|
19
|
+
startingpositiontimestamp: PropertyRef = PropertyRef("StartingPositionTimestamp")
|
|
20
|
+
parallelizationfactor: PropertyRef = PropertyRef("ParallelizationFactor")
|
|
21
|
+
maximumbatchingwindowinseconds: PropertyRef = PropertyRef(
|
|
22
|
+
"MaximumBatchingWindowInSeconds"
|
|
23
|
+
)
|
|
24
|
+
eventsourcearn: PropertyRef = PropertyRef("EventSourceArn")
|
|
25
|
+
lastmodified: PropertyRef = PropertyRef("LastModified")
|
|
26
|
+
lastprocessingresult: PropertyRef = PropertyRef("LastProcessingResult")
|
|
27
|
+
state: PropertyRef = PropertyRef("State")
|
|
28
|
+
maximumrecordage: PropertyRef = PropertyRef("MaximumRecordAgeInSeconds")
|
|
29
|
+
bisectbatchonfunctionerror: PropertyRef = PropertyRef("BisectBatchOnFunctionError")
|
|
30
|
+
maximumretryattempts: PropertyRef = PropertyRef("MaximumRetryAttempts")
|
|
31
|
+
tumblingwindowinseconds: PropertyRef = PropertyRef("TumblingWindowInSeconds")
|
|
32
|
+
functionarn: PropertyRef = PropertyRef("FunctionArn")
|
|
33
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# (:AWSLambda)-[:RESOURCE]->(:AWSLambdaEventSourceMapping)
|
|
37
|
+
# Note:The RESOURCE rel here is not the same as sub-resource relationship. Should rename eventually
|
|
38
|
+
@dataclass(frozen=True)
|
|
39
|
+
class AWSLambdaToEventSourceMappingRelProperties(CartographyRelProperties):
|
|
40
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@dataclass(frozen=True)
|
|
44
|
+
class AWSLambdaToEventSourceMappingRel(CartographyRelSchema):
|
|
45
|
+
target_node_label: str = "AWSLambda"
|
|
46
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
47
|
+
{"id": PropertyRef("FunctionArn")},
|
|
48
|
+
)
|
|
49
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
50
|
+
rel_label: str = "RESOURCE"
|
|
51
|
+
properties: AWSLambdaToEventSourceMappingRelProperties = (
|
|
52
|
+
AWSLambdaToEventSourceMappingRelProperties()
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
# Sub-resource relationship: (:AWSAccount)-[:RESOURCE]->(:AWSLambdaEventSourceMapping)
|
|
57
|
+
@dataclass(frozen=True)
|
|
58
|
+
class AWSLambdaEventSourceMappingToAWSAccountRelProperties(CartographyRelProperties):
|
|
59
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@dataclass(frozen=True)
|
|
63
|
+
class AWSLambdaEventSourceMappingToAWSAccountRel(CartographyRelSchema):
|
|
64
|
+
target_node_label: str = "AWSAccount"
|
|
65
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
66
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
67
|
+
)
|
|
68
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
69
|
+
rel_label: str = "RESOURCE"
|
|
70
|
+
properties: AWSLambdaEventSourceMappingToAWSAccountRelProperties = (
|
|
71
|
+
AWSLambdaEventSourceMappingToAWSAccountRelProperties()
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@dataclass(frozen=True)
|
|
76
|
+
class AWSLambdaEventSourceMappingSchema(CartographyNodeSchema):
|
|
77
|
+
label: str = "AWSLambdaEventSourceMapping"
|
|
78
|
+
properties: AWSLambdaEventSourceMappingNodeProperties = (
|
|
79
|
+
AWSLambdaEventSourceMappingNodeProperties()
|
|
80
|
+
)
|
|
81
|
+
sub_resource_relationship: AWSLambdaEventSourceMappingToAWSAccountRel = (
|
|
82
|
+
AWSLambdaEventSourceMappingToAWSAccountRel()
|
|
83
|
+
)
|
|
84
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
85
|
+
[
|
|
86
|
+
AWSLambdaToEventSourceMappingRel(),
|
|
87
|
+
]
|
|
88
|
+
)
|
|
@@ -0,0 +1,89 @@
|
|
|
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 AWSLambdaNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("FunctionArn")
|
|
17
|
+
arn: PropertyRef = PropertyRef("FunctionArn", extra_index=True)
|
|
18
|
+
name: PropertyRef = PropertyRef("FunctionName")
|
|
19
|
+
modifieddate: PropertyRef = PropertyRef("LastModified")
|
|
20
|
+
runtime: PropertyRef = PropertyRef("Runtime")
|
|
21
|
+
description: PropertyRef = PropertyRef("Description")
|
|
22
|
+
timeout: PropertyRef = PropertyRef("Timeout")
|
|
23
|
+
memory: PropertyRef = PropertyRef("MemorySize")
|
|
24
|
+
codesize: PropertyRef = PropertyRef("CodeSize")
|
|
25
|
+
handler: PropertyRef = PropertyRef("Handler")
|
|
26
|
+
version: PropertyRef = PropertyRef("Version")
|
|
27
|
+
tracingconfigmode: PropertyRef = PropertyRef("TracingConfigMode")
|
|
28
|
+
revisionid: PropertyRef = PropertyRef("RevisionId")
|
|
29
|
+
state: PropertyRef = PropertyRef("State")
|
|
30
|
+
statereason: PropertyRef = PropertyRef("StateReason")
|
|
31
|
+
statereasoncode: PropertyRef = PropertyRef("StateReasonCode")
|
|
32
|
+
lastupdatestatus: PropertyRef = PropertyRef("LastUpdateStatus")
|
|
33
|
+
lastupdatestatusreason: PropertyRef = PropertyRef("LastUpdateStatusReason")
|
|
34
|
+
lastupdatestatusreasoncode: PropertyRef = PropertyRef("LastUpdateStatusReasonCode")
|
|
35
|
+
packagetype: PropertyRef = PropertyRef("PackageType")
|
|
36
|
+
signingprofileversionarn: PropertyRef = PropertyRef("SigningProfileVersionArn")
|
|
37
|
+
signingjobarn: PropertyRef = PropertyRef("SigningJobArn")
|
|
38
|
+
codesha256: PropertyRef = PropertyRef("CodeSha256")
|
|
39
|
+
architectures: PropertyRef = PropertyRef("Architectures")
|
|
40
|
+
masterarn: PropertyRef = PropertyRef("MasterArn")
|
|
41
|
+
kmskeyarn: PropertyRef = PropertyRef("KMSKeyArn")
|
|
42
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
43
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@dataclass(frozen=True)
|
|
47
|
+
class AWSLambdaToAWSAccountRelProperties(CartographyRelProperties):
|
|
48
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@dataclass(frozen=True)
|
|
52
|
+
class AWSLambdaToAWSAccountRel(CartographyRelSchema):
|
|
53
|
+
target_node_label: str = "AWSAccount"
|
|
54
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
55
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
56
|
+
)
|
|
57
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
58
|
+
rel_label: str = "RESOURCE"
|
|
59
|
+
properties: AWSLambdaToAWSAccountRelProperties = (
|
|
60
|
+
AWSLambdaToAWSAccountRelProperties()
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@dataclass(frozen=True)
|
|
65
|
+
class AWSLambdaToPrincipalRelProperties(CartographyRelProperties):
|
|
66
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@dataclass(frozen=True)
|
|
70
|
+
class AWSLambdaToPrincipalRel(CartographyRelSchema):
|
|
71
|
+
target_node_label: str = "AWSPrincipal"
|
|
72
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
73
|
+
{"arn": PropertyRef("Role")},
|
|
74
|
+
)
|
|
75
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
76
|
+
rel_label: str = "STS_ASSUMEROLE_ALLOW"
|
|
77
|
+
properties: AWSLambdaToPrincipalRelProperties = AWSLambdaToPrincipalRelProperties()
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@dataclass(frozen=True)
|
|
81
|
+
class AWSLambdaSchema(CartographyNodeSchema):
|
|
82
|
+
label: str = "AWSLambda"
|
|
83
|
+
properties: AWSLambdaNodeProperties = AWSLambdaNodeProperties()
|
|
84
|
+
sub_resource_relationship: AWSLambdaToAWSAccountRel = AWSLambdaToAWSAccountRel()
|
|
85
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
86
|
+
[
|
|
87
|
+
AWSLambdaToPrincipalRel(),
|
|
88
|
+
],
|
|
89
|
+
)
|
|
@@ -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 AWSLambdaLayerNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("Arn")
|
|
17
|
+
arn: PropertyRef = PropertyRef("Arn")
|
|
18
|
+
codesize: PropertyRef = PropertyRef("CodeSize")
|
|
19
|
+
signingprofileversionarn: PropertyRef = PropertyRef("SigningProfileVersionArn")
|
|
20
|
+
signingjobarn: PropertyRef = PropertyRef("SigningJobArn")
|
|
21
|
+
functionarn: PropertyRef = PropertyRef("FunctionArn")
|
|
22
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# (:AWSLambda)-[:HAS]->(:AWSLambdaLayer)
|
|
26
|
+
@dataclass(frozen=True)
|
|
27
|
+
class AWSLambdaToLayerRelProperties(CartographyRelProperties):
|
|
28
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@dataclass(frozen=True)
|
|
32
|
+
class AWSLambdaToLayerRel(CartographyRelSchema):
|
|
33
|
+
target_node_label: str = "AWSLambda"
|
|
34
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
35
|
+
{"id": PropertyRef("FunctionArn")},
|
|
36
|
+
)
|
|
37
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
38
|
+
rel_label: str = "HAS"
|
|
39
|
+
properties: AWSLambdaToLayerRelProperties = AWSLambdaToLayerRelProperties()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# (:AWSAccount)-[:RESOURCE]->(:AWSLambdaLayer)
|
|
43
|
+
@dataclass(frozen=True)
|
|
44
|
+
class AWSLambdaLayerToAWSAccountRelProperties(CartographyRelProperties):
|
|
45
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@dataclass(frozen=True)
|
|
49
|
+
class AWSLambdaLayerToAWSAccountRel(CartographyRelSchema):
|
|
50
|
+
target_node_label: str = "AWSAccount"
|
|
51
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
52
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
53
|
+
)
|
|
54
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
55
|
+
rel_label: str = "RESOURCE"
|
|
56
|
+
properties: AWSLambdaLayerToAWSAccountRelProperties = (
|
|
57
|
+
AWSLambdaLayerToAWSAccountRelProperties()
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@dataclass(frozen=True)
|
|
62
|
+
class AWSLambdaLayerSchema(CartographyNodeSchema):
|
|
63
|
+
label: str = "AWSLambdaLayer"
|
|
64
|
+
properties: AWSLambdaLayerNodeProperties = AWSLambdaLayerNodeProperties()
|
|
65
|
+
sub_resource_relationship: AWSLambdaLayerToAWSAccountRel = (
|
|
66
|
+
AWSLambdaLayerToAWSAccountRel()
|
|
67
|
+
)
|
|
68
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
69
|
+
[
|
|
70
|
+
AWSLambdaToLayerRel(),
|
|
71
|
+
]
|
|
72
|
+
)
|
|
File without changes
|