cartography 0.111.0rc1__py3-none-any.whl → 0.113.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 +57 -0
- cartography/config.py +24 -0
- cartography/data/indexes.cypher +0 -6
- cartography/data/jobs/analysis/keycloak_inheritance.json +30 -0
- cartography/intel/aws/apigateway.py +128 -17
- cartography/intel/aws/apigatewayv2.py +116 -0
- cartography/intel/aws/ec2/instances.py +3 -1
- cartography/intel/aws/ec2/network_interfaces.py +1 -1
- cartography/intel/aws/ec2/vpc_peerings.py +262 -125
- cartography/intel/aws/resources.py +2 -0
- cartography/intel/azure/__init__.py +35 -32
- cartography/intel/azure/subscription.py +2 -2
- cartography/intel/azure/tenant.py +39 -30
- cartography/intel/azure/util/credentials.py +49 -174
- cartography/intel/entra/__init__.py +47 -1
- cartography/intel/entra/applications.py +220 -170
- cartography/intel/entra/groups.py +41 -22
- cartography/intel/entra/ou.py +28 -20
- cartography/intel/entra/users.py +24 -18
- cartography/intel/gcp/__init__.py +32 -11
- cartography/intel/gcp/compute.py +47 -12
- cartography/intel/gcp/dns.py +82 -169
- cartography/intel/gcp/iam.py +66 -54
- cartography/intel/gcp/storage.py +75 -159
- cartography/intel/github/repos.py +19 -10
- 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 +26 -0
- cartography/intel/kubernetes/eks.py +402 -0
- cartography/intel/kubernetes/rbac.py +133 -0
- cartography/models/aws/apigateway/apigatewayintegration.py +79 -0
- cartography/models/aws/apigateway/apigatewaymethod.py +74 -0
- cartography/models/aws/apigatewayv2/__init__.py +0 -0
- cartography/models/aws/apigatewayv2/apigatewayv2.py +53 -0
- cartography/models/aws/ec2/vpc_peering.py +157 -0
- cartography/models/azure/principal.py +44 -0
- cartography/models/azure/tenant.py +20 -0
- cartography/models/gcp/dns.py +109 -0
- cartography/models/gcp/iam.py +3 -0
- cartography/models/gcp/storage/__init__.py +0 -0
- cartography/models/gcp/storage/bucket.py +119 -0
- 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 +40 -0
- cartography/models/kubernetes/groups.py +107 -0
- cartography/models/kubernetes/oidc.py +51 -0
- cartography/models/kubernetes/rolebindings.py +40 -0
- cartography/models/kubernetes/users.py +105 -0
- cartography/sync.py +2 -0
- cartography/util.py +10 -0
- {cartography-0.111.0rc1.dist-info → cartography-0.113.0.dist-info}/METADATA +9 -5
- {cartography-0.111.0rc1.dist-info → cartography-0.113.0.dist-info}/RECORD +78 -41
- cartography/data/jobs/cleanup/aws_import_vpc_peering_cleanup.json +0 -45
- cartography/data/jobs/cleanup/gcp_dns_cleanup.json +0 -29
- cartography/data/jobs/cleanup/gcp_storage_bucket_cleanup.json +0 -29
- {cartography-0.111.0rc1.dist-info → cartography-0.113.0.dist-info}/WHEEL +0 -0
- {cartography-0.111.0rc1.dist-info → cartography-0.113.0.dist-info}/entry_points.txt +0 -0
- {cartography-0.111.0rc1.dist-info → cartography-0.113.0.dist-info}/licenses/LICENSE +0 -0
- {cartography-0.111.0rc1.dist-info → cartography-0.113.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
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 KubernetesGroupNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("id")
|
|
17
|
+
name: PropertyRef = PropertyRef("name")
|
|
18
|
+
cluster_name: PropertyRef = PropertyRef("cluster_name")
|
|
19
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@dataclass(frozen=True)
|
|
23
|
+
class KubernetesGroupToClusterRelProperties(CartographyRelProperties):
|
|
24
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclass(frozen=True)
|
|
28
|
+
class KubernetesGroupToClusterRel(CartographyRelSchema):
|
|
29
|
+
target_node_label: str = "KubernetesCluster"
|
|
30
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
31
|
+
{"id": PropertyRef("CLUSTER_ID", set_in_kwargs=True)}
|
|
32
|
+
)
|
|
33
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
34
|
+
rel_label: str = "RESOURCE"
|
|
35
|
+
properties: KubernetesGroupToClusterRelProperties = (
|
|
36
|
+
KubernetesGroupToClusterRelProperties()
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass(frozen=True)
|
|
41
|
+
class KubernetesGroupToOktaGroupRelProperties(CartographyRelProperties):
|
|
42
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@dataclass(frozen=True)
|
|
46
|
+
class KubernetesGroupToAWSRoleRelProperties(CartographyRelProperties):
|
|
47
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@dataclass(frozen=True)
|
|
51
|
+
class KubernetesGroupToAWSUserRelProperties(CartographyRelProperties):
|
|
52
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@dataclass(frozen=True)
|
|
56
|
+
class KubernetesGroupToOktaGroupRel(CartographyRelSchema):
|
|
57
|
+
target_node_label: str = "OktaGroup"
|
|
58
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
59
|
+
{"name": PropertyRef("name")}
|
|
60
|
+
)
|
|
61
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
62
|
+
rel_label: str = "MAPS_TO"
|
|
63
|
+
properties: KubernetesGroupToOktaGroupRelProperties = (
|
|
64
|
+
KubernetesGroupToOktaGroupRelProperties()
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
@dataclass(frozen=True)
|
|
69
|
+
class KubernetesGroupToAWSRoleRel(CartographyRelSchema):
|
|
70
|
+
target_node_label: str = "AWSRole"
|
|
71
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
72
|
+
{"arn": PropertyRef("aws_role_arn")}
|
|
73
|
+
)
|
|
74
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
75
|
+
rel_label: str = "MAPS_TO"
|
|
76
|
+
properties: KubernetesGroupToAWSRoleRelProperties = (
|
|
77
|
+
KubernetesGroupToAWSRoleRelProperties()
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@dataclass(frozen=True)
|
|
82
|
+
class KubernetesGroupToAWSUserRel(CartographyRelSchema):
|
|
83
|
+
target_node_label: str = "AWSUser"
|
|
84
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
85
|
+
{"arn": PropertyRef("aws_user_arn")}
|
|
86
|
+
)
|
|
87
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
88
|
+
rel_label: str = "MAPS_TO"
|
|
89
|
+
properties: KubernetesGroupToAWSUserRelProperties = (
|
|
90
|
+
KubernetesGroupToAWSUserRelProperties()
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
@dataclass(frozen=True)
|
|
95
|
+
class KubernetesGroupSchema(CartographyNodeSchema):
|
|
96
|
+
label: str = "KubernetesGroup"
|
|
97
|
+
properties: KubernetesGroupNodeProperties = KubernetesGroupNodeProperties()
|
|
98
|
+
sub_resource_relationship: KubernetesGroupToClusterRel = (
|
|
99
|
+
KubernetesGroupToClusterRel()
|
|
100
|
+
)
|
|
101
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
102
|
+
[
|
|
103
|
+
KubernetesGroupToOktaGroupRel(),
|
|
104
|
+
KubernetesGroupToAWSRoleRel(),
|
|
105
|
+
KubernetesGroupToAWSUserRel(),
|
|
106
|
+
]
|
|
107
|
+
)
|
|
@@ -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 KubernetesOIDCProviderNodeProperties(CartographyNodeProperties):
|
|
15
|
+
id: PropertyRef = PropertyRef("id")
|
|
16
|
+
issuer_url: PropertyRef = PropertyRef("issuer_url")
|
|
17
|
+
cluster_name: PropertyRef = PropertyRef("cluster_name")
|
|
18
|
+
k8s_platform: PropertyRef = PropertyRef("k8s_platform")
|
|
19
|
+
client_id: PropertyRef = PropertyRef("client_id")
|
|
20
|
+
status: PropertyRef = PropertyRef("status")
|
|
21
|
+
name: PropertyRef = PropertyRef("name")
|
|
22
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass(frozen=True)
|
|
26
|
+
class KubernetesOIDCProviderToClusterRelProperties(CartographyRelProperties):
|
|
27
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(frozen=True)
|
|
31
|
+
class KubernetesOIDCProviderToClusterRel(CartographyRelSchema):
|
|
32
|
+
target_node_label: str = "KubernetesCluster"
|
|
33
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
34
|
+
{"id": PropertyRef("CLUSTER_ID", set_in_kwargs=True)}
|
|
35
|
+
)
|
|
36
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
37
|
+
rel_label: str = "TRUSTS"
|
|
38
|
+
properties: KubernetesOIDCProviderToClusterRelProperties = (
|
|
39
|
+
KubernetesOIDCProviderToClusterRelProperties()
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@dataclass(frozen=True)
|
|
44
|
+
class KubernetesOIDCProviderSchema(CartographyNodeSchema):
|
|
45
|
+
label: str = "KubernetesOIDCProvider"
|
|
46
|
+
properties: KubernetesOIDCProviderNodeProperties = (
|
|
47
|
+
KubernetesOIDCProviderNodeProperties()
|
|
48
|
+
)
|
|
49
|
+
sub_resource_relationship: KubernetesOIDCProviderToClusterRel = (
|
|
50
|
+
KubernetesOIDCProviderToClusterRel()
|
|
51
|
+
)
|
|
@@ -22,6 +22,8 @@ class KubernetesRoleBindingNodeProperties(CartographyNodeProperties):
|
|
|
22
22
|
role_name: PropertyRef = PropertyRef("role_name")
|
|
23
23
|
role_kind: PropertyRef = PropertyRef("role_kind")
|
|
24
24
|
service_account_ids: PropertyRef = PropertyRef("service_account_ids")
|
|
25
|
+
user_ids: PropertyRef = PropertyRef("user_ids")
|
|
26
|
+
group_ids: PropertyRef = PropertyRef("group_ids")
|
|
25
27
|
role_id: PropertyRef = PropertyRef("role_id")
|
|
26
28
|
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
27
29
|
|
|
@@ -83,6 +85,42 @@ class KubernetesRoleBindingToServiceAccountRel(CartographyRelSchema):
|
|
|
83
85
|
)
|
|
84
86
|
|
|
85
87
|
|
|
88
|
+
@dataclass(frozen=True)
|
|
89
|
+
class KubernetesRoleBindingToUserRelProperties(CartographyRelProperties):
|
|
90
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
@dataclass(frozen=True)
|
|
94
|
+
class KubernetesRoleBindingToUserRel(CartographyRelSchema):
|
|
95
|
+
target_node_label: str = "KubernetesUser"
|
|
96
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
97
|
+
{"id": PropertyRef("user_ids", one_to_many=True)}
|
|
98
|
+
)
|
|
99
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
100
|
+
rel_label: str = "SUBJECT"
|
|
101
|
+
properties: KubernetesRoleBindingToUserRelProperties = (
|
|
102
|
+
KubernetesRoleBindingToUserRelProperties()
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
@dataclass(frozen=True)
|
|
107
|
+
class KubernetesRoleBindingToGroupRelProperties(CartographyRelProperties):
|
|
108
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
@dataclass(frozen=True)
|
|
112
|
+
class KubernetesRoleBindingToGroupRel(CartographyRelSchema):
|
|
113
|
+
target_node_label: str = "KubernetesGroup"
|
|
114
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
115
|
+
{"id": PropertyRef("group_ids", one_to_many=True)}
|
|
116
|
+
)
|
|
117
|
+
direction: LinkDirection = LinkDirection.OUTWARD
|
|
118
|
+
rel_label: str = "SUBJECT"
|
|
119
|
+
properties: KubernetesRoleBindingToGroupRelProperties = (
|
|
120
|
+
KubernetesRoleBindingToGroupRelProperties()
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
|
|
86
124
|
@dataclass(frozen=True)
|
|
87
125
|
class KubernetesRoleBindingToRoleRelProperties(CartographyRelProperties):
|
|
88
126
|
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
@@ -114,6 +152,8 @@ class KubernetesRoleBindingSchema(CartographyNodeSchema):
|
|
|
114
152
|
[
|
|
115
153
|
KubernetesRoleBindingToNamespaceRel(),
|
|
116
154
|
KubernetesRoleBindingToServiceAccountRel(),
|
|
155
|
+
KubernetesRoleBindingToUserRel(),
|
|
156
|
+
KubernetesRoleBindingToGroupRel(),
|
|
117
157
|
KubernetesRoleBindingToRoleRel(),
|
|
118
158
|
]
|
|
119
159
|
)
|
|
@@ -0,0 +1,105 @@
|
|
|
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 KubernetesUserNodeProperties(CartographyNodeProperties):
|
|
16
|
+
id: PropertyRef = PropertyRef("id")
|
|
17
|
+
name: PropertyRef = PropertyRef("name")
|
|
18
|
+
cluster_name: PropertyRef = PropertyRef("cluster_name")
|
|
19
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@dataclass(frozen=True)
|
|
23
|
+
class KubernetesUserToClusterRelProperties(CartographyRelProperties):
|
|
24
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclass(frozen=True)
|
|
28
|
+
class KubernetesUserToClusterRel(CartographyRelSchema):
|
|
29
|
+
target_node_label: str = "KubernetesCluster"
|
|
30
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
31
|
+
{"id": PropertyRef("CLUSTER_ID", set_in_kwargs=True)}
|
|
32
|
+
)
|
|
33
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
34
|
+
rel_label: str = "RESOURCE"
|
|
35
|
+
properties: KubernetesUserToClusterRelProperties = (
|
|
36
|
+
KubernetesUserToClusterRelProperties()
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass(frozen=True)
|
|
41
|
+
class KubernetesUserToOktaUserRelProperties(CartographyRelProperties):
|
|
42
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@dataclass(frozen=True)
|
|
46
|
+
class KubernetesUserToAWSRoleRelProperties(CartographyRelProperties):
|
|
47
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@dataclass(frozen=True)
|
|
51
|
+
class KubernetesUserToAWSUserRelProperties(CartographyRelProperties):
|
|
52
|
+
lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@dataclass(frozen=True)
|
|
56
|
+
class KubernetesUserToOktaUserRel(CartographyRelSchema):
|
|
57
|
+
target_node_label: str = "OktaUser"
|
|
58
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
59
|
+
{"email": PropertyRef("name")}
|
|
60
|
+
)
|
|
61
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
62
|
+
rel_label: str = "MAPS_TO"
|
|
63
|
+
properties: KubernetesUserToOktaUserRelProperties = (
|
|
64
|
+
KubernetesUserToOktaUserRelProperties()
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
@dataclass(frozen=True)
|
|
69
|
+
class KubernetesUserToAWSRoleRel(CartographyRelSchema):
|
|
70
|
+
target_node_label: str = "AWSRole"
|
|
71
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
72
|
+
{"arn": PropertyRef("aws_role_arn")}
|
|
73
|
+
)
|
|
74
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
75
|
+
rel_label: str = "MAPS_TO"
|
|
76
|
+
properties: KubernetesUserToAWSRoleRelProperties = (
|
|
77
|
+
KubernetesUserToAWSRoleRelProperties()
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@dataclass(frozen=True)
|
|
82
|
+
class KubernetesUserToAWSUserRel(CartographyRelSchema):
|
|
83
|
+
target_node_label: str = "AWSUser"
|
|
84
|
+
target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
|
|
85
|
+
{"arn": PropertyRef("aws_user_arn")}
|
|
86
|
+
)
|
|
87
|
+
direction: LinkDirection = LinkDirection.INWARD
|
|
88
|
+
rel_label: str = "MAPS_TO"
|
|
89
|
+
properties: KubernetesUserToAWSUserRelProperties = (
|
|
90
|
+
KubernetesUserToAWSUserRelProperties()
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
@dataclass(frozen=True)
|
|
95
|
+
class KubernetesUserSchema(CartographyNodeSchema):
|
|
96
|
+
label: str = "KubernetesUser"
|
|
97
|
+
properties: KubernetesUserNodeProperties = KubernetesUserNodeProperties()
|
|
98
|
+
sub_resource_relationship: KubernetesUserToClusterRel = KubernetesUserToClusterRel()
|
|
99
|
+
other_relationships: OtherRelationships = OtherRelationships(
|
|
100
|
+
[
|
|
101
|
+
KubernetesUserToOktaUserRel(),
|
|
102
|
+
KubernetesUserToAWSRoleRel(),
|
|
103
|
+
KubernetesUserToAWSUserRel(),
|
|
104
|
+
]
|
|
105
|
+
)
|
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
|
|
@@ -269,6 +270,8 @@ def aws_handle_regions(func: AWSGetFunc) -> AWSGetFunc:
|
|
|
269
270
|
"AccessDenied",
|
|
270
271
|
"AccessDeniedException",
|
|
271
272
|
"AuthFailure",
|
|
273
|
+
"AuthorizationError",
|
|
274
|
+
"AuthorizationErrorException",
|
|
272
275
|
"InvalidClientTokenId",
|
|
273
276
|
"UnauthorizedOperation",
|
|
274
277
|
"UnrecognizedClientException",
|
|
@@ -309,6 +312,13 @@ def aws_handle_regions(func: AWSGetFunc) -> AWSGetFunc:
|
|
|
309
312
|
return []
|
|
310
313
|
else:
|
|
311
314
|
raise
|
|
315
|
+
except EndpointConnectionError:
|
|
316
|
+
logger.warning(
|
|
317
|
+
"Encountered an EndpointConnectionError. This means that the AWS "
|
|
318
|
+
"resource is not available in this region. Skipping.",
|
|
319
|
+
exc_info=True,
|
|
320
|
+
)
|
|
321
|
+
return []
|
|
312
322
|
|
|
313
323
|
return cast(AWSGetFunc, inner_function)
|
|
314
324
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cartography
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.113.0
|
|
4
4
|
Summary: Explore assets and their relationships across your technical infrastructure.
|
|
5
5
|
Maintainer: Cartography Contributors
|
|
6
|
-
License:
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
7
|
Project-URL: Homepage, https://cartography-cncf.github.io/cartography
|
|
8
8
|
Project-URL: Documentation, https://cartography-cncf.github.io/cartography
|
|
9
9
|
Project-URL: Repository, https://github.com/cartography-cncf/cartography
|
|
@@ -11,7 +11,6 @@ Project-URL: Issues, https://github.com/cartography-cncf/cartography/issues
|
|
|
11
11
|
Project-URL: Changelog, https://github.com/cartography-cncf/cartography/releases
|
|
12
12
|
Classifier: Development Status :: 4 - Beta
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
14
|
Classifier: Natural Language :: English
|
|
16
15
|
Classifier: Programming Language :: Python
|
|
17
16
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -93,7 +92,8 @@ You can learn more about the story behind Cartography in our [presentation at BS
|
|
|
93
92
|
- [Google Cloud Platform](https://cartography-cncf.github.io/cartography/modules/gcp/index.html) - Cloud Resource Manager, Compute, DNS, Storage, Google Kubernetes Engine
|
|
94
93
|
- [Google GSuite](https://cartography-cncf.github.io/cartography/modules/gsuite/index.html) - users, groups
|
|
95
94
|
- [Kandji](https://cartography-cncf.github.io/cartography/modules/kandji/index.html) - Devices
|
|
96
|
-
- [
|
|
95
|
+
- [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
|
|
96
|
+
- [Kubernetes](https://cartography-cncf.github.io/cartography/modules/kubernetes/index.html) - Cluster, Namespace, Service, Pod, Container, ServiceAccount, Role, RoleBinding, ClusterRole, ClusterRoleBinding, OIDCProvider
|
|
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
|
|
@@ -152,6 +152,10 @@ Now that data is in the graph, you can quickly start with our [querying tutorial
|
|
|
152
152
|
Directly querying Neo4j is already very useful as a sort of "swiss army knife" for security data problems, but you can also build applications and data pipelines around Cartography. View this doc on [applications](https://cartography-cncf.github.io/cartography/usage/applications.html).
|
|
153
153
|
|
|
154
154
|
|
|
155
|
+
## Docs
|
|
156
|
+
|
|
157
|
+
See [here](https://cartography-cncf.github.io/cartography/)
|
|
158
|
+
|
|
155
159
|
## Community
|
|
156
160
|
|
|
157
161
|
- Hang out with us on Slack: Join the CNCF Slack workspace [here](https://communityinviter.com/apps/cloud-native/cncf), and then join the `#cartography` channel.
|
|
@@ -167,7 +171,7 @@ This project is licensed under the [Apache 2.0 License](LICENSE).
|
|
|
167
171
|
Thank you for considering contributing to Cartography!
|
|
168
172
|
|
|
169
173
|
### Code of conduct
|
|
170
|
-
All contributors and participants of this project must follow the
|
|
174
|
+
All contributors and participants of this project must follow the [CNCF code of conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md).
|
|
171
175
|
|
|
172
176
|
### Bug reports and feature requests and discussions
|
|
173
177
|
Submit a GitHub issue to report a bug or request a new feature. If we decide that the issue needs more discussion - usually because the scope is too large or we need to make careful decision - we will convert the issue to a [GitHub Discussion](https://github.com/cartography-cncf/cartography/discussions).
|