cartography 0.108.0rc1__py3-none-any.whl → 0.109.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 +14 -0
- cartography/config.py +4 -0
- cartography/data/indexes.cypher +0 -17
- cartography/data/jobs/cleanup/gcp_compute_vpc_cleanup.json +0 -12
- cartography/intel/aws/cloudtrail.py +17 -4
- cartography/intel/aws/cloudtrail_management_events.py +614 -16
- cartography/intel/aws/cloudwatch.py +73 -4
- 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/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/resourcegroupstaggingapi.py +77 -18
- cartography/intel/aws/resources.py +4 -0
- cartography/intel/aws/route53.py +334 -332
- cartography/intel/aws/secretsmanager.py +62 -44
- cartography/intel/entra/groups.py +29 -1
- cartography/intel/gcp/__init__.py +10 -0
- cartography/intel/gcp/compute.py +19 -42
- cartography/intel/trivy/__init__.py +73 -13
- cartography/intel/trivy/scanner.py +115 -92
- 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/subnets.py +65 -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/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/aws/secretsmanager/secret.py +106 -0
- cartography/models/entra/group.py +26 -0
- cartography/models/entra/user.py +6 -0
- cartography/models/gcp/compute/__init__.py +0 -0
- cartography/models/gcp/compute/vpc.py +50 -0
- cartography/util.py +8 -1
- {cartography-0.108.0rc1.dist-info → cartography-0.109.0.dist-info}/METADATA +2 -2
- {cartography-0.108.0rc1.dist-info → cartography-0.109.0.dist-info}/RECORD +73 -44
- 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_import_secrets_cleanup.json +0 -8
- cartography/data/jobs/cleanup/aws_kms_details.json +0 -10
- {cartography-0.108.0rc1.dist-info → cartography-0.109.0.dist-info}/WHEEL +0 -0
- {cartography-0.108.0rc1.dist-info → cartography-0.109.0.dist-info}/entry_points.txt +0 -0
- {cartography-0.108.0rc1.dist-info → cartography-0.109.0.dist-info}/licenses/LICENSE +0 -0
- {cartography-0.108.0rc1.dist-info → cartography-0.109.0.dist-info}/top_level.txt +0 -0
|
@@ -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
|
+
)
|
|
@@ -0,0 +1,67 @@
|
|
|
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 ElasticacheTopicNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("TopicArn")
|
|
17
|
+
arn: PropertyRef = PropertyRef("TopicArn", extra_index=True)
|
|
18
|
+
status: PropertyRef = PropertyRef("TopicStatus")
|
|
19
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@dataclass(frozen=True)
|
|
23
|
+
class ElasticacheTopicToAWSAccountRelProperties(CartographyRelProperties):
|
|
24
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclass(frozen=True)
|
|
28
|
+
class ElasticacheTopicToAWSAccountRel(CartographyRelSchema):
|
|
29
|
+
target_node_label: str = "AWSAccount"
|
|
30
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
31
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)}
|
|
32
|
+
)
|
|
33
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
34
|
+
rel_label: str = "RESOURCE"
|
|
35
|
+
properties: ElasticacheTopicToAWSAccountRelProperties = (
|
|
36
|
+
ElasticacheTopicToAWSAccountRelProperties()
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass(frozen=True)
|
|
41
|
+
class ElasticacheTopicToElasticacheClusterRelProperties(CartographyRelProperties):
|
|
42
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@dataclass(frozen=True)
|
|
46
|
+
class ElasticacheTopicToElasticacheClusterRel(CartographyRelSchema):
|
|
47
|
+
target_node_label: str = "ElasticacheCluster"
|
|
48
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
49
|
+
{"id": PropertyRef("cluster_arns", one_to_many=True)}
|
|
50
|
+
)
|
|
51
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
52
|
+
rel_label: str = "CACHE_CLUSTER"
|
|
53
|
+
properties: ElasticacheTopicToElasticacheClusterRelProperties = (
|
|
54
|
+
ElasticacheTopicToElasticacheClusterRelProperties()
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@dataclass(frozen=True)
|
|
59
|
+
class ElasticacheTopicSchema(CartographyNodeSchema):
|
|
60
|
+
label: str = "ElasticacheTopic"
|
|
61
|
+
properties: ElasticacheTopicNodeProperties = ElasticacheTopicNodeProperties()
|
|
62
|
+
sub_resource_relationship: ElasticacheTopicToAWSAccountRel = (
|
|
63
|
+
ElasticacheTopicToAWSAccountRel()
|
|
64
|
+
)
|
|
65
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
66
|
+
[ElasticacheTopicToElasticacheClusterRel()]
|
|
67
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,77 @@
|
|
|
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 EventBridgeRuleNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("Arn")
|
|
17
|
+
arn: PropertyRef = PropertyRef("Arn", extra_index=True)
|
|
18
|
+
name: PropertyRef = PropertyRef("Name")
|
|
19
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
20
|
+
event_pattern: PropertyRef = PropertyRef("EventPattern")
|
|
21
|
+
state: PropertyRef = PropertyRef("State")
|
|
22
|
+
description: PropertyRef = PropertyRef("Description")
|
|
23
|
+
schedule_expression: PropertyRef = PropertyRef("ScheduleExpression")
|
|
24
|
+
role_arn: PropertyRef = PropertyRef("RoleArn")
|
|
25
|
+
managed_by: PropertyRef = PropertyRef("ManagedBy")
|
|
26
|
+
event_bus_name: PropertyRef = PropertyRef("EventBusName")
|
|
27
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(frozen=True)
|
|
31
|
+
class EventBridgeRuleToAwsAccountRelProperties(CartographyRelProperties):
|
|
32
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@dataclass(frozen=True)
|
|
36
|
+
class EventBridgeRuleToAWSAccountRel(CartographyRelSchema):
|
|
37
|
+
target_node_label: str = "AWSAccount"
|
|
38
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
39
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
40
|
+
)
|
|
41
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
42
|
+
rel_label: str = "RESOURCE"
|
|
43
|
+
properties: EventBridgeRuleToAwsAccountRelProperties = (
|
|
44
|
+
EventBridgeRuleToAwsAccountRelProperties()
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@dataclass(frozen=True)
|
|
49
|
+
class EventBridgeRuleToAWSRoleRelProperties(CartographyRelProperties):
|
|
50
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@dataclass(frozen=True)
|
|
54
|
+
class EventBridgeRuleToAWSRoleRel(CartographyRelSchema):
|
|
55
|
+
target_node_label: str = "AWSRole"
|
|
56
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
57
|
+
{"arn": PropertyRef("RoleArn")},
|
|
58
|
+
)
|
|
59
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
60
|
+
rel_label: str = "ASSOCIATED_WITH"
|
|
61
|
+
properties: EventBridgeRuleToAWSRoleRelProperties = (
|
|
62
|
+
EventBridgeRuleToAWSRoleRelProperties()
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@dataclass(frozen=True)
|
|
67
|
+
class EventBridgeRuleSchema(CartographyNodeSchema):
|
|
68
|
+
label: str = "EventBridgeRule"
|
|
69
|
+
properties: EventBridgeRuleNodeProperties = EventBridgeRuleNodeProperties()
|
|
70
|
+
sub_resource_relationship: EventBridgeRuleToAWSAccountRel = (
|
|
71
|
+
EventBridgeRuleToAWSAccountRel()
|
|
72
|
+
)
|
|
73
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
74
|
+
[
|
|
75
|
+
EventBridgeRuleToAWSRoleRel(),
|
|
76
|
+
]
|
|
77
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,51 @@
|
|
|
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 GlueConnectionNodeProperties(CartographyNodeProperties):
|
|
15
|
+
id: PropertyRef = PropertyRef("Name")
|
|
16
|
+
arn: PropertyRef = PropertyRef("Name", extra_index=True)
|
|
17
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
18
|
+
description: PropertyRef = PropertyRef("Description")
|
|
19
|
+
connection_type: PropertyRef = PropertyRef("ConnectionType")
|
|
20
|
+
status: PropertyRef = PropertyRef("Status")
|
|
21
|
+
status_reason: PropertyRef = PropertyRef("StatusReason")
|
|
22
|
+
authentication_type: PropertyRef = PropertyRef("AuthenticationType")
|
|
23
|
+
secret_arn: PropertyRef = PropertyRef("SecretArn")
|
|
24
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclass(frozen=True)
|
|
28
|
+
class GlueConnectionToAwsAccountRelProperties(CartographyRelProperties):
|
|
29
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass(frozen=True)
|
|
33
|
+
class GlueConnectionToAWSAccountRel(CartographyRelSchema):
|
|
34
|
+
target_node_label: str = "AWSAccount"
|
|
35
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
36
|
+
{"id": PropertyRef("AWS_ID", set_in_kwargs=True)},
|
|
37
|
+
)
|
|
38
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
39
|
+
rel_label: str = "RESOURCE"
|
|
40
|
+
properties: GlueConnectionToAwsAccountRelProperties = (
|
|
41
|
+
GlueConnectionToAwsAccountRelProperties()
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@dataclass(frozen=True)
|
|
46
|
+
class GlueConnectionSchema(CartographyNodeSchema):
|
|
47
|
+
label: str = "GlueConnection"
|
|
48
|
+
properties: GlueConnectionNodeProperties = GlueConnectionNodeProperties()
|
|
49
|
+
sub_resource_relationship: GlueConnectionToAWSAccountRel = (
|
|
50
|
+
GlueConnectionToAWSAccountRel()
|
|
51
|
+
)
|
|
@@ -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
|