cartography 0.110.0rc1__py3-none-any.whl → 0.111.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 +16 -3
- cartography/cli.py +46 -8
- cartography/config.py +16 -9
- cartography/data/indexes.cypher +0 -2
- cartography/data/jobs/analysis/aws_ec2_keypair_analysis.json +2 -2
- cartography/data/jobs/analysis/keycloak_inheritance.json +30 -0
- cartography/graph/querybuilder.py +70 -0
- cartography/intel/aws/apigateway.py +113 -4
- cartography/intel/aws/cognito.py +201 -0
- cartography/intel/aws/ec2/vpc.py +140 -124
- cartography/intel/aws/ecs.py +7 -1
- cartography/intel/aws/eventbridge.py +73 -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 +2 -0
- cartography/intel/aws/route53.py +3 -1
- cartography/intel/aws/s3.py +104 -0
- cartography/intel/entra/__init__.py +41 -43
- cartography/intel/entra/applications.py +2 -1
- cartography/intel/entra/ou.py +1 -1
- cartography/intel/github/__init__.py +21 -25
- cartography/intel/github/repos.py +32 -48
- cartography/intel/github/util.py +12 -0
- cartography/intel/keycloak/__init__.py +153 -0
- cartography/intel/keycloak/authenticationexecutions.py +322 -0
- cartography/intel/keycloak/authenticationflows.py +77 -0
- cartography/intel/keycloak/clients.py +187 -0
- cartography/intel/keycloak/groups.py +126 -0
- cartography/intel/keycloak/identityproviders.py +94 -0
- cartography/intel/keycloak/organizations.py +163 -0
- cartography/intel/keycloak/realms.py +61 -0
- cartography/intel/keycloak/roles.py +202 -0
- cartography/intel/keycloak/scopes.py +73 -0
- cartography/intel/keycloak/users.py +70 -0
- cartography/intel/keycloak/util.py +47 -0
- cartography/intel/kubernetes/__init__.py +4 -0
- cartography/intel/kubernetes/rbac.py +464 -0
- cartography/intel/kubernetes/util.py +17 -0
- cartography/models/aws/apigateway/apigatewaydeployment.py +74 -0
- 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/ec2/vpc.py +46 -0
- cartography/models/aws/ec2/vpc_cidr.py +102 -0
- cartography/models/aws/ecs/services.py +17 -0
- cartography/models/aws/ecs/tasks.py +1 -0
- cartography/models/aws/eventbridge/target.py +71 -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/keycloak/__init__.py +0 -0
- cartography/models/keycloak/authenticationexecution.py +160 -0
- cartography/models/keycloak/authenticationflow.py +54 -0
- cartography/models/keycloak/client.py +177 -0
- cartography/models/keycloak/group.py +101 -0
- cartography/models/keycloak/identityprovider.py +89 -0
- cartography/models/keycloak/organization.py +116 -0
- cartography/models/keycloak/organizationdomain.py +73 -0
- cartography/models/keycloak/realm.py +173 -0
- cartography/models/keycloak/role.py +126 -0
- cartography/models/keycloak/scope.py +73 -0
- cartography/models/keycloak/user.py +51 -0
- 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/tailscale/device.py +1 -0
- cartography/sync.py +2 -0
- cartography/util.py +8 -0
- {cartography-0.110.0rc1.dist-info → cartography-0.111.0.dist-info}/METADATA +4 -3
- {cartography-0.110.0rc1.dist-info → cartography-0.111.0.dist-info}/RECORD +85 -46
- cartography/data/jobs/cleanup/aws_import_vpc_cleanup.json +0 -23
- cartography/intel/entra/resources.py +0 -20
- /cartography/data/jobs/{analysis → scoped_analysis}/aws_s3acl_analysis.json +0 -0
- /cartography/models/aws/{__init__.py → apigateway/__init__.py} +0 -0
- /cartography/models/aws/{apigateway.py → apigateway/apigateway.py} +0 -0
- /cartography/models/aws/{apigatewaycertificate.py → apigateway/apigatewaycertificate.py} +0 -0
- /cartography/models/aws/{apigatewayresource.py → apigateway/apigatewayresource.py} +0 -0
- /cartography/models/aws/{apigatewaystage.py → apigateway/apigatewaystage.py} +0 -0
- {cartography-0.110.0rc1.dist-info → cartography-0.111.0.dist-info}/WHEEL +0 -0
- {cartography-0.110.0rc1.dist-info → cartography-0.111.0.dist-info}/entry_points.txt +0 -0
- {cartography-0.110.0rc1.dist-info → cartography-0.111.0.dist-info}/licenses/LICENSE +0 -0
- {cartography-0.110.0rc1.dist-info → cartography-0.111.0.dist-info}/top_level.txt +0 -0
|
@@ -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
|
+
)
|
|
@@ -28,6 +28,7 @@ class TailscaleDeviceNodeProperties(CartographyNodeProperties):
|
|
|
28
28
|
authorized: PropertyRef = PropertyRef("authorized")
|
|
29
29
|
is_external: PropertyRef = PropertyRef("isExternal")
|
|
30
30
|
node_key: PropertyRef = PropertyRef("nodeKey")
|
|
31
|
+
addresses: PropertyRef = PropertyRef("addresses")
|
|
31
32
|
blocks_incoming_connections: PropertyRef = PropertyRef("blocksIncomingConnections")
|
|
32
33
|
client_connectivity_endpoints: PropertyRef = PropertyRef(
|
|
33
34
|
"clientConnectivity.endpoints"
|
cartography/sync.py
CHANGED
|
@@ -31,6 +31,7 @@ import cartography.intel.github
|
|
|
31
31
|
import cartography.intel.gsuite
|
|
32
32
|
import cartography.intel.jamf
|
|
33
33
|
import cartography.intel.kandji
|
|
34
|
+
import cartography.intel.keycloak
|
|
34
35
|
import cartography.intel.kubernetes
|
|
35
36
|
import cartography.intel.lastpass
|
|
36
37
|
import cartography.intel.oci
|
|
@@ -70,6 +71,7 @@ TOP_LEVEL_MODULES = OrderedDict(
|
|
|
70
71
|
"github": cartography.intel.github.start_github_ingestion,
|
|
71
72
|
"digitalocean": cartography.intel.digitalocean.start_digitalocean_ingestion,
|
|
72
73
|
"kandji": cartography.intel.kandji.start_kandji_ingestion,
|
|
74
|
+
"keycloak": cartography.intel.keycloak.start_keycloak_ingestion,
|
|
73
75
|
"kubernetes": cartography.intel.kubernetes.start_k8s_ingestion,
|
|
74
76
|
"lastpass": cartography.intel.lastpass.start_lastpass_ingestion,
|
|
75
77
|
"bigfix": cartography.intel.bigfix.start_bigfix_ingestion,
|
cartography/util.py
CHANGED
|
@@ -25,6 +25,7 @@ import backoff
|
|
|
25
25
|
import boto3
|
|
26
26
|
import botocore
|
|
27
27
|
import neo4j
|
|
28
|
+
from botocore.exceptions import EndpointConnectionError
|
|
28
29
|
|
|
29
30
|
from cartography.graph.job import GraphJob
|
|
30
31
|
from cartography.graph.statement import get_job_shortname
|
|
@@ -309,6 +310,13 @@ def aws_handle_regions(func: AWSGetFunc) -> AWSGetFunc:
|
|
|
309
310
|
return []
|
|
310
311
|
else:
|
|
311
312
|
raise
|
|
313
|
+
except EndpointConnectionError:
|
|
314
|
+
logger.warning(
|
|
315
|
+
"Encountered an EndpointConnectionError. This means that the AWS "
|
|
316
|
+
"resource is not available in this region. Skipping.",
|
|
317
|
+
exc_info=True,
|
|
318
|
+
)
|
|
319
|
+
return []
|
|
312
320
|
|
|
313
321
|
return cast(AWSGetFunc, inner_function)
|
|
314
322
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cartography
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.111.0
|
|
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,8 @@ 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
|
-
- [
|
|
96
|
+
- [Keycloak](https://cartography-cncf.github.io/cartography/modules/keycloak/index.html) - Realms, Users, Groups, Roles, Scopes, Clients, IdentityProviders, Authentication Flows, Authentication Executions, Organizations, Organization Domains
|
|
97
|
+
- [Kubernetes](https://cartography-cncf.github.io/cartography/modules/kubernetes/index.html) - Cluster, Namespace, Service, Pod, Container, ServiceAccount, Role, RoleBinding, ClusterRole, ClusterRoleBinding
|
|
97
98
|
- [Lastpass](https://cartography-cncf.github.io/cartography/modules/lastpass/index.html) - users
|
|
98
99
|
- [Microsoft Azure](https://cartography-cncf.github.io/cartography/modules/azure/index.html) - CosmosDB, SQL, Storage, Virtual Machine
|
|
99
100
|
- [Microsoft Entra ID](https://cartography-cncf.github.io/cartography/modules/entra/index.html) - Users
|