cartography 0.109.0rc2__py3-none-any.whl → 0.110.0rc2__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/jobs/analysis/aws_ec2_keypair_analysis.json +2 -2
- cartography/intel/aws/cloudtrail_management_events.py +21 -0
- cartography/intel/aws/cognito.py +201 -0
- cartography/intel/aws/ecs.py +7 -1
- cartography/intel/aws/eventbridge.py +91 -0
- cartography/intel/aws/glue.py +64 -0
- cartography/intel/aws/kms.py +13 -1
- cartography/intel/aws/rds.py +105 -0
- cartography/intel/aws/resources.py +4 -0
- cartography/intel/aws/route53.py +3 -1
- cartography/intel/aws/s3.py +104 -0
- cartography/intel/github/__init__.py +21 -25
- cartography/intel/github/repos.py +4 -36
- cartography/intel/kubernetes/__init__.py +4 -0
- cartography/intel/kubernetes/rbac.py +464 -0
- cartography/intel/kubernetes/util.py +17 -0
- cartography/intel/trivy/__init__.py +73 -13
- cartography/intel/trivy/scanner.py +115 -92
- cartography/models/aws/cognito/__init__.py +0 -0
- cartography/models/aws/cognito/identity_pool.py +70 -0
- cartography/models/aws/cognito/user_pool.py +47 -0
- cartography/models/aws/ec2/security_groups.py +1 -1
- cartography/models/aws/ecs/services.py +17 -0
- cartography/models/aws/ecs/tasks.py +1 -0
- cartography/models/aws/eventbridge/__init__.py +0 -0
- cartography/models/aws/eventbridge/rule.py +77 -0
- cartography/models/aws/glue/job.py +69 -0
- cartography/models/aws/rds/event_subscription.py +146 -0
- cartography/models/aws/route53/dnsrecord.py +21 -0
- cartography/models/github/dependencies.py +1 -2
- cartography/models/kubernetes/clusterrolebindings.py +98 -0
- cartography/models/kubernetes/clusterroles.py +52 -0
- cartography/models/kubernetes/rolebindings.py +119 -0
- cartography/models/kubernetes/roles.py +76 -0
- cartography/models/kubernetes/serviceaccounts.py +77 -0
- cartography/models/snipeit/asset.py +1 -0
- {cartography-0.109.0rc2.dist-info → cartography-0.110.0rc2.dist-info}/METADATA +3 -3
- {cartography-0.109.0rc2.dist-info → cartography-0.110.0rc2.dist-info}/RECORD +46 -31
- /cartography/data/jobs/{analysis → scoped_analysis}/aws_s3acl_analysis.json +0 -0
- {cartography-0.109.0rc2.dist-info → cartography-0.110.0rc2.dist-info}/WHEEL +0 -0
- {cartography-0.109.0rc2.dist-info → cartography-0.110.0rc2.dist-info}/entry_points.txt +0 -0
- {cartography-0.109.0rc2.dist-info → cartography-0.110.0rc2.dist-info}/licenses/LICENSE +0 -0
- {cartography-0.109.0rc2.dist-info → cartography-0.110.0rc2.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
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 RDSEventSubscriptionNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("CustSubscriptionId")
|
|
17
|
+
arn: PropertyRef = PropertyRef("EventSubscriptionArn", extra_index=True)
|
|
18
|
+
customer_aws_id: PropertyRef = PropertyRef("CustomerAwsId")
|
|
19
|
+
sns_topic_arn: PropertyRef = PropertyRef("SnsTopicArn")
|
|
20
|
+
source_type: PropertyRef = PropertyRef("SourceType")
|
|
21
|
+
status: PropertyRef = PropertyRef("Status")
|
|
22
|
+
enabled: PropertyRef = PropertyRef("Enabled")
|
|
23
|
+
subscription_creation_time: PropertyRef = PropertyRef("SubscriptionCreationTime")
|
|
24
|
+
event_categories: PropertyRef = PropertyRef("event_categories", one_to_many=True)
|
|
25
|
+
source_ids: PropertyRef = PropertyRef("source_ids", one_to_many=True)
|
|
26
|
+
region: PropertyRef = PropertyRef("Region", set_in_kwargs=True)
|
|
27
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(frozen=True)
|
|
31
|
+
class RDSEventSubscriptionToAWSAccountRelProperties(CartographyRelProperties):
|
|
32
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@dataclass(frozen=True)
|
|
36
|
+
class RDSEventSubscriptionToAWSAccountRel(CartographyRelSchema):
|
|
37
|
+
target_node_label: str = "AWSAccount"
|
|
38
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
39
|
+
{
|
|
40
|
+
"id": PropertyRef("AWS_ID", set_in_kwargs=True),
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
44
|
+
rel_label: str = "RESOURCE"
|
|
45
|
+
properties: RDSEventSubscriptionToAWSAccountRelProperties = (
|
|
46
|
+
RDSEventSubscriptionToAWSAccountRelProperties()
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@dataclass(frozen=True)
|
|
51
|
+
class RDSEventSubscriptionToSNSTopicRelProperties(CartographyRelProperties):
|
|
52
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@dataclass(frozen=True)
|
|
56
|
+
class RDSEventSubscriptionToSNSTopicRel(CartographyRelSchema):
|
|
57
|
+
target_node_label: str = "SNSTopic"
|
|
58
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
59
|
+
{
|
|
60
|
+
"arn": PropertyRef("SnsTopicArn"),
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
64
|
+
rel_label: str = "NOTIFIES"
|
|
65
|
+
properties: RDSEventSubscriptionToSNSTopicRelProperties = (
|
|
66
|
+
RDSEventSubscriptionToSNSTopicRelProperties()
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
@dataclass(frozen=True)
|
|
71
|
+
class RDSEventSubscriptionToRDSInstanceRelProperties(CartographyRelProperties):
|
|
72
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@dataclass(frozen=True)
|
|
76
|
+
class RDSEventSubscriptionToRDSInstanceRel(CartographyRelSchema):
|
|
77
|
+
target_node_label: str = "RDSInstance"
|
|
78
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
79
|
+
{
|
|
80
|
+
"db_instance_identifier": PropertyRef("source_ids", one_to_many=True),
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
84
|
+
rel_label: str = "MONITORS"
|
|
85
|
+
properties: RDSEventSubscriptionToRDSInstanceRelProperties = (
|
|
86
|
+
RDSEventSubscriptionToRDSInstanceRelProperties()
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@dataclass(frozen=True)
|
|
91
|
+
class RDSEventSubscriptionToRDSClusterRelProperties(CartographyRelProperties):
|
|
92
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
@dataclass(frozen=True)
|
|
96
|
+
class RDSEventSubscriptionToRDSClusterRel(CartographyRelSchema):
|
|
97
|
+
target_node_label: str = "RDSCluster"
|
|
98
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
99
|
+
{
|
|
100
|
+
"db_cluster_identifier": PropertyRef("source_ids", one_to_many=True),
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
104
|
+
rel_label: str = "MONITORS"
|
|
105
|
+
properties: RDSEventSubscriptionToRDSClusterRelProperties = (
|
|
106
|
+
RDSEventSubscriptionToRDSClusterRelProperties()
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
@dataclass(frozen=True)
|
|
111
|
+
class RDSEventSubscriptionToRDSSnapshotRelProperties(CartographyRelProperties):
|
|
112
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
@dataclass(frozen=True)
|
|
116
|
+
class RDSEventSubscriptionToRDSSnapshotRel(CartographyRelSchema):
|
|
117
|
+
target_node_label: str = "RDSSnapshot"
|
|
118
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
119
|
+
{
|
|
120
|
+
"db_snapshot_identifier": PropertyRef("source_ids", one_to_many=True),
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
124
|
+
rel_label: str = "MONITORS"
|
|
125
|
+
properties: RDSEventSubscriptionToRDSSnapshotRelProperties = (
|
|
126
|
+
RDSEventSubscriptionToRDSSnapshotRelProperties()
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
@dataclass(frozen=True)
|
|
131
|
+
class RDSEventSubscriptionSchema(CartographyNodeSchema):
|
|
132
|
+
label: str = "RDSEventSubscription"
|
|
133
|
+
properties: RDSEventSubscriptionNodeProperties = (
|
|
134
|
+
RDSEventSubscriptionNodeProperties()
|
|
135
|
+
)
|
|
136
|
+
sub_resource_relationship: RDSEventSubscriptionToAWSAccountRel = (
|
|
137
|
+
RDSEventSubscriptionToAWSAccountRel()
|
|
138
|
+
)
|
|
139
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
140
|
+
[
|
|
141
|
+
RDSEventSubscriptionToSNSTopicRel(),
|
|
142
|
+
RDSEventSubscriptionToRDSInstanceRel(),
|
|
143
|
+
RDSEventSubscriptionToRDSClusterRel(),
|
|
144
|
+
RDSEventSubscriptionToRDSSnapshotRel(),
|
|
145
|
+
]
|
|
146
|
+
)
|
|
@@ -193,6 +193,26 @@ class AWSDNSRecordToIpRel(CartographyRelSchema):
|
|
|
193
193
|
properties: AWSDNSRecordToIpRelProperties = AWSDNSRecordToIpRelProperties()
|
|
194
194
|
|
|
195
195
|
|
|
196
|
+
@dataclass(frozen=True)
|
|
197
|
+
class AWSDNSRecordToElasticIPAddressRelProperties(CartographyRelProperties):
|
|
198
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
@dataclass(frozen=True)
|
|
202
|
+
class AWSDNSRecordToElasticIPAddressRel(CartographyRelSchema):
|
|
203
|
+
target_node_label: str = "ElasticIPAddress"
|
|
204
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
205
|
+
{
|
|
206
|
+
"public_ip": PropertyRef("value"),
|
|
207
|
+
}
|
|
208
|
+
)
|
|
209
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
210
|
+
rel_label: str = "DNS_POINTS_TO"
|
|
211
|
+
properties: AWSDNSRecordToElasticIPAddressRelProperties = (
|
|
212
|
+
AWSDNSRecordToElasticIPAddressRelProperties()
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
|
|
196
216
|
class AWSDNSRecordSchema(CartographyNodeSchema):
|
|
197
217
|
label: str = "AWSDNSRecord"
|
|
198
218
|
properties: AWSDNSRecordNodeProperties = AWSDNSRecordNodeProperties()
|
|
@@ -210,5 +230,6 @@ class AWSDNSRecordSchema(CartographyNodeSchema):
|
|
|
210
230
|
AWSDNSRecordToDNSRecordRel(),
|
|
211
231
|
AWSDNSRecordToZoneRel(),
|
|
212
232
|
AWSDNSRecordToIpRel(),
|
|
233
|
+
AWSDNSRecordToElasticIPAddressRel(),
|
|
213
234
|
]
|
|
214
235
|
)
|
|
@@ -16,10 +16,9 @@ class GitHubDependencyNodeProperties(CartographyNodeProperties):
|
|
|
16
16
|
id: PropertyRef = PropertyRef("id")
|
|
17
17
|
name: PropertyRef = PropertyRef("name")
|
|
18
18
|
original_name: PropertyRef = PropertyRef("original_name")
|
|
19
|
-
|
|
19
|
+
requirements: PropertyRef = PropertyRef("requirements")
|
|
20
20
|
ecosystem: PropertyRef = PropertyRef("ecosystem")
|
|
21
21
|
package_manager: PropertyRef = PropertyRef("package_manager")
|
|
22
|
-
repo_name: PropertyRef = PropertyRef("repo_name")
|
|
23
22
|
manifest_file: PropertyRef = PropertyRef("manifest_file")
|
|
24
23
|
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
25
24
|
|
|
@@ -0,0 +1,98 @@
|
|
|
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 KubernetesClusterRoleBindingNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("id")
|
|
17
|
+
name: PropertyRef = PropertyRef("name")
|
|
18
|
+
uid: PropertyRef = PropertyRef("uid")
|
|
19
|
+
creation_timestamp: PropertyRef = PropertyRef("creation_timestamp")
|
|
20
|
+
resource_version: PropertyRef = PropertyRef("resource_version")
|
|
21
|
+
role_name: PropertyRef = PropertyRef("role_name")
|
|
22
|
+
role_kind: PropertyRef = PropertyRef("role_kind")
|
|
23
|
+
service_account_ids: PropertyRef = PropertyRef("service_account_ids")
|
|
24
|
+
role_id: PropertyRef = PropertyRef("role_id")
|
|
25
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@dataclass(frozen=True)
|
|
29
|
+
class KubernetesClusterRoleBindingToClusterRelProperties(CartographyRelProperties):
|
|
30
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@dataclass(frozen=True)
|
|
34
|
+
class KubernetesClusterRoleBindingToClusterRel(CartographyRelSchema):
|
|
35
|
+
target_node_label: str = "KubernetesCluster"
|
|
36
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
37
|
+
{"id": PropertyRef("CLUSTER_ID", set_in_kwargs=True)}
|
|
38
|
+
)
|
|
39
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
40
|
+
rel_label: str = "RESOURCE"
|
|
41
|
+
properties: KubernetesClusterRoleBindingToClusterRelProperties = (
|
|
42
|
+
KubernetesClusterRoleBindingToClusterRelProperties()
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@dataclass(frozen=True)
|
|
47
|
+
class KubernetesClusterRoleBindingToServiceAccountRelProperties(
|
|
48
|
+
CartographyRelProperties
|
|
49
|
+
):
|
|
50
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@dataclass(frozen=True)
|
|
54
|
+
class KubernetesClusterRoleBindingToServiceAccountRel(CartographyRelSchema):
|
|
55
|
+
target_node_label: str = "KubernetesServiceAccount"
|
|
56
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
57
|
+
{"id": PropertyRef("service_account_ids", one_to_many=True)}
|
|
58
|
+
)
|
|
59
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
60
|
+
rel_label: str = "SUBJECT"
|
|
61
|
+
properties: KubernetesClusterRoleBindingToServiceAccountRelProperties = (
|
|
62
|
+
KubernetesClusterRoleBindingToServiceAccountRelProperties()
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@dataclass(frozen=True)
|
|
67
|
+
class KubernetesClusterRoleBindingToClusterRoleRelProperties(CartographyRelProperties):
|
|
68
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@dataclass(frozen=True)
|
|
72
|
+
class KubernetesClusterRoleBindingToClusterRoleRel(CartographyRelSchema):
|
|
73
|
+
target_node_label: str = "KubernetesClusterRole"
|
|
74
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
75
|
+
{"id": PropertyRef("role_id")}
|
|
76
|
+
)
|
|
77
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
78
|
+
rel_label: str = "ROLE_REF"
|
|
79
|
+
properties: KubernetesClusterRoleBindingToClusterRoleRelProperties = (
|
|
80
|
+
KubernetesClusterRoleBindingToClusterRoleRelProperties()
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@dataclass(frozen=True)
|
|
85
|
+
class KubernetesClusterRoleBindingSchema(CartographyNodeSchema):
|
|
86
|
+
label: str = "KubernetesClusterRoleBinding"
|
|
87
|
+
properties: KubernetesClusterRoleBindingNodeProperties = (
|
|
88
|
+
KubernetesClusterRoleBindingNodeProperties()
|
|
89
|
+
)
|
|
90
|
+
sub_resource_relationship: KubernetesClusterRoleBindingToClusterRel = (
|
|
91
|
+
KubernetesClusterRoleBindingToClusterRel()
|
|
92
|
+
)
|
|
93
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
94
|
+
[
|
|
95
|
+
KubernetesClusterRoleBindingToServiceAccountRel(),
|
|
96
|
+
KubernetesClusterRoleBindingToClusterRoleRel(),
|
|
97
|
+
]
|
|
98
|
+
)
|
|
@@ -0,0 +1,52 @@
|
|
|
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 KubernetesClusterRoleNodeProperties(CartographyNodeProperties):
|
|
15
|
+
id: PropertyRef = PropertyRef("id")
|
|
16
|
+
name: PropertyRef = PropertyRef("name")
|
|
17
|
+
uid: PropertyRef = PropertyRef("uid")
|
|
18
|
+
creation_timestamp: PropertyRef = PropertyRef("creation_timestamp")
|
|
19
|
+
resource_version: PropertyRef = PropertyRef("resource_version")
|
|
20
|
+
api_groups: PropertyRef = PropertyRef("api_groups")
|
|
21
|
+
resources: PropertyRef = PropertyRef("resources")
|
|
22
|
+
verbs: PropertyRef = PropertyRef("verbs")
|
|
23
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass(frozen=True)
|
|
27
|
+
class KubernetesClusterRoleToClusterRelProperties(CartographyRelProperties):
|
|
28
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@dataclass(frozen=True)
|
|
32
|
+
class KubernetesClusterRoleToClusterRel(CartographyRelSchema):
|
|
33
|
+
target_node_label: str = "KubernetesCluster"
|
|
34
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
35
|
+
{"id": PropertyRef("CLUSTER_ID", set_in_kwargs=True)}
|
|
36
|
+
)
|
|
37
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
38
|
+
rel_label: str = "RESOURCE"
|
|
39
|
+
properties: KubernetesClusterRoleToClusterRelProperties = (
|
|
40
|
+
KubernetesClusterRoleToClusterRelProperties()
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@dataclass(frozen=True)
|
|
45
|
+
class KubernetesClusterRoleSchema(CartographyNodeSchema):
|
|
46
|
+
label: str = "KubernetesClusterRole"
|
|
47
|
+
properties: KubernetesClusterRoleNodeProperties = (
|
|
48
|
+
KubernetesClusterRoleNodeProperties()
|
|
49
|
+
)
|
|
50
|
+
sub_resource_relationship: KubernetesClusterRoleToClusterRel = (
|
|
51
|
+
KubernetesClusterRoleToClusterRel()
|
|
52
|
+
)
|
|
@@ -0,0 +1,119 @@
|
|
|
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 KubernetesRoleBindingNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("id")
|
|
17
|
+
name: PropertyRef = PropertyRef("name")
|
|
18
|
+
namespace: PropertyRef = PropertyRef("namespace")
|
|
19
|
+
uid: PropertyRef = PropertyRef("uid")
|
|
20
|
+
creation_timestamp: PropertyRef = PropertyRef("creation_timestamp")
|
|
21
|
+
resource_version: PropertyRef = PropertyRef("resource_version")
|
|
22
|
+
role_name: PropertyRef = PropertyRef("role_name")
|
|
23
|
+
role_kind: PropertyRef = PropertyRef("role_kind")
|
|
24
|
+
service_account_ids: PropertyRef = PropertyRef("service_account_ids")
|
|
25
|
+
role_id: PropertyRef = PropertyRef("role_id")
|
|
26
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass(frozen=True)
|
|
30
|
+
class KubernetesRoleBindingToNamespaceRelProperties(CartographyRelProperties):
|
|
31
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@dataclass(frozen=True)
|
|
35
|
+
class KubernetesRoleBindingToNamespaceRel(CartographyRelSchema):
|
|
36
|
+
target_node_label: str = "KubernetesNamespace"
|
|
37
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
38
|
+
{
|
|
39
|
+
"cluster_name": PropertyRef("CLUSTER_NAME", set_in_kwargs=True),
|
|
40
|
+
"name": PropertyRef("namespace"),
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
44
|
+
rel_label: str = "CONTAINS"
|
|
45
|
+
properties: KubernetesRoleBindingToNamespaceRelProperties = (
|
|
46
|
+
KubernetesRoleBindingToNamespaceRelProperties()
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@dataclass(frozen=True)
|
|
51
|
+
class KubernetesRoleBindingToClusterRelProperties(CartographyRelProperties):
|
|
52
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@dataclass(frozen=True)
|
|
56
|
+
class KubernetesRoleBindingToClusterRel(CartographyRelSchema):
|
|
57
|
+
target_node_label: str = "KubernetesCluster"
|
|
58
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
59
|
+
{"id": PropertyRef("CLUSTER_ID", set_in_kwargs=True)}
|
|
60
|
+
)
|
|
61
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
62
|
+
rel_label: str = "RESOURCE"
|
|
63
|
+
properties: KubernetesRoleBindingToClusterRelProperties = (
|
|
64
|
+
KubernetesRoleBindingToClusterRelProperties()
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
@dataclass(frozen=True)
|
|
69
|
+
class KubernetesRoleBindingToServiceAccountRelProperties(CartographyRelProperties):
|
|
70
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@dataclass(frozen=True)
|
|
74
|
+
class KubernetesRoleBindingToServiceAccountRel(CartographyRelSchema):
|
|
75
|
+
target_node_label: str = "KubernetesServiceAccount"
|
|
76
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
77
|
+
{"id": PropertyRef("service_account_ids", one_to_many=True)}
|
|
78
|
+
)
|
|
79
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
80
|
+
rel_label: str = "SUBJECT"
|
|
81
|
+
properties: KubernetesRoleBindingToServiceAccountRelProperties = (
|
|
82
|
+
KubernetesRoleBindingToServiceAccountRelProperties()
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@dataclass(frozen=True)
|
|
87
|
+
class KubernetesRoleBindingToRoleRelProperties(CartographyRelProperties):
|
|
88
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
@dataclass(frozen=True)
|
|
92
|
+
class KubernetesRoleBindingToRoleRel(CartographyRelSchema):
|
|
93
|
+
target_node_label: str = "KubernetesRole"
|
|
94
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
95
|
+
{"id": PropertyRef("role_id")}
|
|
96
|
+
)
|
|
97
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
98
|
+
rel_label: str = "ROLE_REF"
|
|
99
|
+
properties: KubernetesRoleBindingToRoleRelProperties = (
|
|
100
|
+
KubernetesRoleBindingToRoleRelProperties()
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
@dataclass(frozen=True)
|
|
105
|
+
class KubernetesRoleBindingSchema(CartographyNodeSchema):
|
|
106
|
+
label: str = "KubernetesRoleBinding"
|
|
107
|
+
properties: KubernetesRoleBindingNodeProperties = (
|
|
108
|
+
KubernetesRoleBindingNodeProperties()
|
|
109
|
+
)
|
|
110
|
+
sub_resource_relationship: KubernetesRoleBindingToClusterRel = (
|
|
111
|
+
KubernetesRoleBindingToClusterRel()
|
|
112
|
+
)
|
|
113
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
114
|
+
[
|
|
115
|
+
KubernetesRoleBindingToNamespaceRel(),
|
|
116
|
+
KubernetesRoleBindingToServiceAccountRel(),
|
|
117
|
+
KubernetesRoleBindingToRoleRel(),
|
|
118
|
+
]
|
|
119
|
+
)
|
|
@@ -0,0 +1,76 @@
|
|
|
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 KubernetesRoleNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("id")
|
|
17
|
+
name: PropertyRef = PropertyRef("name")
|
|
18
|
+
namespace: PropertyRef = PropertyRef("namespace")
|
|
19
|
+
uid: PropertyRef = PropertyRef("uid")
|
|
20
|
+
creation_timestamp: PropertyRef = PropertyRef("creation_timestamp")
|
|
21
|
+
resource_version: PropertyRef = PropertyRef("resource_version")
|
|
22
|
+
api_groups: PropertyRef = PropertyRef("api_groups")
|
|
23
|
+
resources: PropertyRef = PropertyRef("resources")
|
|
24
|
+
verbs: PropertyRef = PropertyRef("verbs")
|
|
25
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@dataclass(frozen=True)
|
|
29
|
+
class KubernetesRoleToNamespaceRelProperties(CartographyRelProperties):
|
|
30
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@dataclass(frozen=True)
|
|
34
|
+
class KubernetesRoleToNamespaceRel(CartographyRelSchema):
|
|
35
|
+
target_node_label: str = "KubernetesNamespace"
|
|
36
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
37
|
+
{
|
|
38
|
+
"cluster_name": PropertyRef("CLUSTER_NAME", set_in_kwargs=True),
|
|
39
|
+
"name": PropertyRef("namespace"),
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
43
|
+
rel_label: str = "CONTAINS"
|
|
44
|
+
properties: KubernetesRoleToNamespaceRelProperties = (
|
|
45
|
+
KubernetesRoleToNamespaceRelProperties()
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@dataclass(frozen=True)
|
|
50
|
+
class KubernetesRoleToClusterRelProperties(CartographyRelProperties):
|
|
51
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@dataclass(frozen=True)
|
|
55
|
+
class KubernetesRoleToClusterRel(CartographyRelSchema):
|
|
56
|
+
target_node_label: str = "KubernetesCluster"
|
|
57
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
58
|
+
{"id": PropertyRef("CLUSTER_ID", set_in_kwargs=True)}
|
|
59
|
+
)
|
|
60
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
61
|
+
rel_label: str = "RESOURCE"
|
|
62
|
+
properties: KubernetesRoleToClusterRelProperties = (
|
|
63
|
+
KubernetesRoleToClusterRelProperties()
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@dataclass(frozen=True)
|
|
68
|
+
class KubernetesRoleSchema(CartographyNodeSchema):
|
|
69
|
+
label: str = "KubernetesRole"
|
|
70
|
+
properties: KubernetesRoleNodeProperties = KubernetesRoleNodeProperties()
|
|
71
|
+
sub_resource_relationship: KubernetesRoleToClusterRel = KubernetesRoleToClusterRel()
|
|
72
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
73
|
+
[
|
|
74
|
+
KubernetesRoleToNamespaceRel(),
|
|
75
|
+
]
|
|
76
|
+
)
|
|
@@ -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 KubernetesServiceAccountNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("id")
|
|
17
|
+
name: PropertyRef = PropertyRef("name")
|
|
18
|
+
namespace: PropertyRef = PropertyRef("namespace")
|
|
19
|
+
uid: PropertyRef = PropertyRef("uid")
|
|
20
|
+
creation_timestamp: PropertyRef = PropertyRef("creation_timestamp")
|
|
21
|
+
resource_version: PropertyRef = PropertyRef("resource_version")
|
|
22
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass(frozen=True)
|
|
26
|
+
class KubernetesServiceAccountToNamespaceRelProperties(CartographyRelProperties):
|
|
27
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(frozen=True)
|
|
31
|
+
class KubernetesServiceAccountToNamespaceRel(CartographyRelSchema):
|
|
32
|
+
target_node_label: str = "KubernetesNamespace"
|
|
33
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
34
|
+
{
|
|
35
|
+
"cluster_name": PropertyRef("CLUSTER_NAME", set_in_kwargs=True),
|
|
36
|
+
"name": PropertyRef("namespace"),
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
40
|
+
rel_label: str = "CONTAINS"
|
|
41
|
+
properties: KubernetesServiceAccountToNamespaceRelProperties = (
|
|
42
|
+
KubernetesServiceAccountToNamespaceRelProperties()
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@dataclass(frozen=True)
|
|
47
|
+
class KubernetesServiceAccountToClusterRelProperties(CartographyRelProperties):
|
|
48
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@dataclass(frozen=True)
|
|
52
|
+
class KubernetesServiceAccountToClusterRel(CartographyRelSchema):
|
|
53
|
+
target_node_label: str = "KubernetesCluster"
|
|
54
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
55
|
+
{"id": PropertyRef("CLUSTER_ID", set_in_kwargs=True)}
|
|
56
|
+
)
|
|
57
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
58
|
+
rel_label: str = "RESOURCE"
|
|
59
|
+
properties: KubernetesServiceAccountToClusterRelProperties = (
|
|
60
|
+
KubernetesServiceAccountToClusterRelProperties()
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@dataclass(frozen=True)
|
|
65
|
+
class KubernetesServiceAccountSchema(CartographyNodeSchema):
|
|
66
|
+
label: str = "KubernetesServiceAccount"
|
|
67
|
+
properties: KubernetesServiceAccountNodeProperties = (
|
|
68
|
+
KubernetesServiceAccountNodeProperties()
|
|
69
|
+
)
|
|
70
|
+
sub_resource_relationship: KubernetesServiceAccountToClusterRel = (
|
|
71
|
+
KubernetesServiceAccountToClusterRel()
|
|
72
|
+
)
|
|
73
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
74
|
+
[
|
|
75
|
+
KubernetesServiceAccountToNamespaceRel(),
|
|
76
|
+
]
|
|
77
|
+
)
|
|
@@ -29,6 +29,7 @@ class SnipeitAssetNodeProperties(CartographyNodeProperties):
|
|
|
29
29
|
manufacturer: PropertyRef = PropertyRef("manufacturer.name")
|
|
30
30
|
model: PropertyRef = PropertyRef("model.name")
|
|
31
31
|
serial: PropertyRef = PropertyRef("serial", extra_index=True)
|
|
32
|
+
status: PropertyRef = PropertyRef("status_label.name")
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
###
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cartography
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.110.0rc2
|
|
4
4
|
Summary: Explore assets and their relationships across your technical infrastructure.
|
|
5
5
|
Maintainer: Cartography Contributors
|
|
6
6
|
License: apache2
|
|
@@ -82,7 +82,7 @@ You can learn more about the story behind Cartography in our [presentation at BS
|
|
|
82
82
|
|
|
83
83
|
## Supported platforms
|
|
84
84
|
- [Airbyte](https://cartography-cncf.github.io/cartography/modules/airbyte/index.html) - Organization, Workspace, User, Source, Destination, Connection, Tag, Stream
|
|
85
|
-
- [Amazon Web Services](https://cartography-cncf.github.io/cartography/modules/aws/index.html) - ACM, API Gateway, CloudWatch, CodeBuild, Config, EC2, ECS, ECR, EFS, Elasticsearch, Elastic Kubernetes Service (EKS), DynamoDB, Glue,
|
|
85
|
+
- [Amazon Web Services](https://cartography-cncf.github.io/cartography/modules/aws/index.html) - ACM, API Gateway, CloudWatch, CodeBuild, Config, Cognito, EC2, ECS, ECR, EFS, Elasticsearch, Elastic Kubernetes Service (EKS), DynamoDB, Glue, GuardDuty, IAM, Inspector, KMS, Lambda, RDS, Redshift, Route53, S3, Secrets Manager(Secret Versions), Security Hub, SNS, SQS, SSM, STS, Tags
|
|
86
86
|
- [Anthropic](https://cartography-cncf.github.io/cartography/modules/anthropic/index.html) - Organization, ApiKey, User, Workspace
|
|
87
87
|
- [BigFix](https://cartography-cncf.github.io/cartography/modules/bigfix/index.html) - Computers
|
|
88
88
|
- [Cloudflare](https://cartography-cncf.github.io/cartography/modules/cloudflare/index.html) - Account, Role, Member, Zone, DNSRecord
|
|
@@ -93,7 +93,7 @@ You can learn more about the story behind Cartography in our [presentation at BS
|
|
|
93
93
|
- [Google Cloud Platform](https://cartography-cncf.github.io/cartography/modules/gcp/index.html) - Cloud Resource Manager, Compute, DNS, Storage, Google Kubernetes Engine
|
|
94
94
|
- [Google GSuite](https://cartography-cncf.github.io/cartography/modules/gsuite/index.html) - users, groups
|
|
95
95
|
- [Kandji](https://cartography-cncf.github.io/cartography/modules/kandji/index.html) - Devices
|
|
96
|
-
- [Kubernetes](https://cartography-cncf.github.io/cartography/modules/kubernetes/index.html) - Cluster, Namespace, Service, Pod, Container
|
|
96
|
+
- [Kubernetes](https://cartography-cncf.github.io/cartography/modules/kubernetes/index.html) - Cluster, Namespace, Service, Pod, Container, ServiceAccount, Role, RoleBinding, ClusterRole, ClusterRoleBinding
|
|
97
97
|
- [Lastpass](https://cartography-cncf.github.io/cartography/modules/lastpass/index.html) - users
|
|
98
98
|
- [Microsoft Azure](https://cartography-cncf.github.io/cartography/modules/azure/index.html) - CosmosDB, SQL, Storage, Virtual Machine
|
|
99
99
|
- [Microsoft Entra ID](https://cartography-cncf.github.io/cartography/modules/entra/index.html) - Users
|