cartography 0.103.0rc1__py3-none-any.whl → 0.104.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.
Files changed (73) hide show
  1. cartography/_version.py +2 -2
  2. cartography/cli.py +97 -1
  3. cartography/config.py +28 -0
  4. cartography/intel/anthropic/__init__.py +62 -0
  5. cartography/intel/anthropic/apikeys.py +72 -0
  6. cartography/intel/anthropic/users.py +75 -0
  7. cartography/intel/anthropic/util.py +51 -0
  8. cartography/intel/anthropic/workspaces.py +95 -0
  9. cartography/intel/aws/cloudwatch.py +93 -0
  10. cartography/intel/aws/ec2/load_balancer_v2s.py +4 -1
  11. cartography/intel/aws/efs.py +93 -0
  12. cartography/intel/aws/resources.py +4 -0
  13. cartography/intel/aws/secretsmanager.py +136 -3
  14. cartography/intel/aws/ssm.py +71 -0
  15. cartography/intel/cloudflare/__init__.py +74 -0
  16. cartography/intel/cloudflare/accounts.py +57 -0
  17. cartography/intel/cloudflare/dnsrecords.py +64 -0
  18. cartography/intel/cloudflare/members.py +75 -0
  19. cartography/intel/cloudflare/roles.py +65 -0
  20. cartography/intel/cloudflare/zones.py +64 -0
  21. cartography/intel/openai/__init__.py +86 -0
  22. cartography/intel/openai/adminapikeys.py +89 -0
  23. cartography/intel/openai/apikeys.py +96 -0
  24. cartography/intel/openai/projects.py +97 -0
  25. cartography/intel/openai/serviceaccounts.py +82 -0
  26. cartography/intel/openai/users.py +75 -0
  27. cartography/intel/openai/util.py +45 -0
  28. cartography/intel/tailscale/__init__.py +77 -0
  29. cartography/intel/tailscale/acls.py +146 -0
  30. cartography/intel/tailscale/devices.py +127 -0
  31. cartography/intel/tailscale/postureintegrations.py +81 -0
  32. cartography/intel/tailscale/tailnets.py +76 -0
  33. cartography/intel/tailscale/users.py +80 -0
  34. cartography/intel/tailscale/utils.py +132 -0
  35. cartography/models/anthropic/__init__.py +0 -0
  36. cartography/models/anthropic/apikey.py +90 -0
  37. cartography/models/anthropic/organization.py +19 -0
  38. cartography/models/anthropic/user.py +48 -0
  39. cartography/models/anthropic/workspace.py +90 -0
  40. cartography/models/aws/cloudwatch/__init__.py +0 -0
  41. cartography/models/aws/cloudwatch/loggroup.py +52 -0
  42. cartography/models/aws/efs/__init__.py +0 -0
  43. cartography/models/aws/efs/mount_target.py +52 -0
  44. cartography/models/aws/secretsmanager/__init__.py +0 -0
  45. cartography/models/aws/secretsmanager/secret_version.py +116 -0
  46. cartography/models/aws/ssm/parameters.py +84 -0
  47. cartography/models/cloudflare/__init__.py +0 -0
  48. cartography/models/cloudflare/account.py +25 -0
  49. cartography/models/cloudflare/dnsrecord.py +55 -0
  50. cartography/models/cloudflare/member.py +82 -0
  51. cartography/models/cloudflare/role.py +44 -0
  52. cartography/models/cloudflare/zone.py +59 -0
  53. cartography/models/openai/__init__.py +0 -0
  54. cartography/models/openai/adminapikey.py +90 -0
  55. cartography/models/openai/apikey.py +84 -0
  56. cartography/models/openai/organization.py +17 -0
  57. cartography/models/openai/project.py +89 -0
  58. cartography/models/openai/serviceaccount.py +50 -0
  59. cartography/models/openai/user.py +49 -0
  60. cartography/models/tailscale/__init__.py +0 -0
  61. cartography/models/tailscale/device.py +95 -0
  62. cartography/models/tailscale/group.py +86 -0
  63. cartography/models/tailscale/postureintegration.py +58 -0
  64. cartography/models/tailscale/tag.py +102 -0
  65. cartography/models/tailscale/tailnet.py +29 -0
  66. cartography/models/tailscale/user.py +52 -0
  67. cartography/sync.py +8 -0
  68. {cartography-0.103.0rc1.dist-info → cartography-0.104.0rc2.dist-info}/METADATA +8 -4
  69. {cartography-0.103.0rc1.dist-info → cartography-0.104.0rc2.dist-info}/RECORD +73 -14
  70. {cartography-0.103.0rc1.dist-info → cartography-0.104.0rc2.dist-info}/WHEEL +1 -1
  71. {cartography-0.103.0rc1.dist-info → cartography-0.104.0rc2.dist-info}/entry_points.txt +0 -0
  72. {cartography-0.103.0rc1.dist-info → cartography-0.104.0rc2.dist-info}/licenses/LICENSE +0 -0
  73. {cartography-0.103.0rc1.dist-info → cartography-0.104.0rc2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,50 @@
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 OpenAIServiceAccountNodeProperties(CartographyNodeProperties):
15
+ object: PropertyRef = PropertyRef("object")
16
+ id: PropertyRef = PropertyRef("id")
17
+ name: PropertyRef = PropertyRef("name")
18
+ role: PropertyRef = PropertyRef("role")
19
+ created_at: PropertyRef = PropertyRef("created_at")
20
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
21
+
22
+
23
+ @dataclass(frozen=True)
24
+ class OpenAIServiceAccountToProjectRelProperties(CartographyRelProperties):
25
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
26
+
27
+
28
+ @dataclass(frozen=True)
29
+ # (:OpenAIServiceAccount)<-[:RESOURCE]-(:OpenAIProject)
30
+ class OpenAIServiceAccountToProjectRel(CartographyRelSchema):
31
+ target_node_label: str = "OpenAIProject"
32
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
33
+ {"id": PropertyRef("project_id", set_in_kwargs=True)},
34
+ )
35
+ direction: LinkDirection = LinkDirection.INWARD
36
+ rel_label: str = "RESOURCE"
37
+ properties: OpenAIServiceAccountToProjectRelProperties = (
38
+ OpenAIServiceAccountToProjectRelProperties()
39
+ )
40
+
41
+
42
+ @dataclass(frozen=True)
43
+ class OpenAIServiceAccountSchema(CartographyNodeSchema):
44
+ label: str = "OpenAIServiceAccount"
45
+ properties: OpenAIServiceAccountNodeProperties = (
46
+ OpenAIServiceAccountNodeProperties()
47
+ )
48
+ sub_resource_relationship: OpenAIServiceAccountToProjectRel = (
49
+ OpenAIServiceAccountToProjectRel()
50
+ )
@@ -0,0 +1,49 @@
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 OpenAIUserNodeProperties(CartographyNodeProperties):
15
+ object: PropertyRef = PropertyRef("object")
16
+ id: PropertyRef = PropertyRef("id")
17
+ name: PropertyRef = PropertyRef("name")
18
+ email: PropertyRef = PropertyRef("email", extra_index=True)
19
+ role: PropertyRef = PropertyRef("role")
20
+ added_at: PropertyRef = PropertyRef("added_at")
21
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
22
+
23
+
24
+ @dataclass(frozen=True)
25
+ class OpenAIUserToOrganizationRelProperties(CartographyRelProperties):
26
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
27
+
28
+
29
+ @dataclass(frozen=True)
30
+ # (:OpenAIOrganization)-[:RESOURCE]->(:OpenAIUser)
31
+ class OpenAIUserToOrganizationRel(CartographyRelSchema):
32
+ target_node_label: str = "OpenAIOrganization"
33
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
34
+ {"id": PropertyRef("ORG_ID", set_in_kwargs=True)},
35
+ )
36
+ direction: LinkDirection = LinkDirection.INWARD
37
+ rel_label: str = "RESOURCE"
38
+ properties: OpenAIUserToOrganizationRelProperties = (
39
+ OpenAIUserToOrganizationRelProperties()
40
+ )
41
+
42
+
43
+ @dataclass(frozen=True)
44
+ class OpenAIUserSchema(CartographyNodeSchema):
45
+ label: str = "OpenAIUser"
46
+ properties: OpenAIUserNodeProperties = OpenAIUserNodeProperties()
47
+ sub_resource_relationship: OpenAIUserToOrganizationRel = (
48
+ OpenAIUserToOrganizationRel()
49
+ )
File without changes
@@ -0,0 +1,95 @@
1
+ from dataclasses import dataclass
2
+
3
+ from cartography.models.core.common import PropertyRef
4
+ from cartography.models.core.nodes import CartographyNodeProperties
5
+ from cartography.models.core.nodes import CartographyNodeSchema
6
+ from cartography.models.core.relationships import CartographyRelProperties
7
+ from cartography.models.core.relationships import CartographyRelSchema
8
+ from cartography.models.core.relationships import LinkDirection
9
+ from cartography.models.core.relationships import make_target_node_matcher
10
+ from cartography.models.core.relationships import OtherRelationships
11
+ from cartography.models.core.relationships import TargetNodeMatcher
12
+
13
+
14
+ @dataclass(frozen=True)
15
+ class TailscaleDeviceNodeProperties(CartographyNodeProperties):
16
+ # We use nodeId because the old property `id` is deprecated
17
+ id: PropertyRef = PropertyRef("nodeId")
18
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
19
+ name: PropertyRef = PropertyRef("name")
20
+ hostname: PropertyRef = PropertyRef("hostname")
21
+ client_version: PropertyRef = PropertyRef("clientVersion")
22
+ update_available: PropertyRef = PropertyRef("updateAvailable")
23
+ os: PropertyRef = PropertyRef("os")
24
+ created: PropertyRef = PropertyRef("created")
25
+ last_seen: PropertyRef = PropertyRef("lastSeen")
26
+ key_expiry_disabled: PropertyRef = PropertyRef("keyExpiryDisabled")
27
+ expires: PropertyRef = PropertyRef("expires")
28
+ authorized: PropertyRef = PropertyRef("authorized")
29
+ is_external: PropertyRef = PropertyRef("isExternal")
30
+ node_key: PropertyRef = PropertyRef("nodeKey")
31
+ blocks_incoming_connections: PropertyRef = PropertyRef("blocksIncomingConnections")
32
+ client_connectivity_endpoints: PropertyRef = PropertyRef(
33
+ "clientConnectivity.endpoints"
34
+ )
35
+ client_connectivity_mapping_varies_by_dest_ip: PropertyRef = PropertyRef(
36
+ "clientConnectivity.mappingVariesByDestIP"
37
+ )
38
+ tailnet_lock_error: PropertyRef = PropertyRef("tailnetLockError")
39
+ tailnet_lock_key: PropertyRef = PropertyRef("tailnetLockKey")
40
+ posture_identity_serial_numbers: PropertyRef = PropertyRef(
41
+ "postureIdentity.serialNumbers"
42
+ )
43
+ posture_identity_disabled: PropertyRef = PropertyRef("postureIdentity.disabled")
44
+
45
+
46
+ @dataclass(frozen=True)
47
+ class TailscaleDeviceToTailnetRelProperties(CartographyRelProperties):
48
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
49
+
50
+
51
+ @dataclass(frozen=True)
52
+ # (:TailscaleTailnet)-[:RESOURCE]->(:TailscaleDevice)
53
+ class TailscaleDeviceToTailnetRel(CartographyRelSchema):
54
+ target_node_label: str = "TailscaleTailnet"
55
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
56
+ {"id": PropertyRef("org", set_in_kwargs=True)},
57
+ )
58
+ direction: LinkDirection = LinkDirection.INWARD
59
+ rel_label: str = "RESOURCE"
60
+ properties: TailscaleDeviceToTailnetRelProperties = (
61
+ TailscaleDeviceToTailnetRelProperties()
62
+ )
63
+
64
+
65
+ @dataclass(frozen=True)
66
+ class TailscaleDeviceToUserRelProperties(CartographyRelProperties):
67
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
68
+
69
+
70
+ @dataclass(frozen=True)
71
+ # (:TailscaleUser)-[:OWNS]->(:TailscaleDevice)
72
+ class TailscaleDeviceToUserRel(CartographyRelSchema):
73
+ target_node_label: str = "TailscaleUser"
74
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
75
+ {"login_name": PropertyRef("user")},
76
+ )
77
+ direction: LinkDirection = LinkDirection.INWARD
78
+ rel_label: str = "OWNS"
79
+ properties: TailscaleDeviceToUserRelProperties = (
80
+ TailscaleDeviceToUserRelProperties()
81
+ )
82
+
83
+
84
+ @dataclass(frozen=True)
85
+ class TailscaleDeviceSchema(CartographyNodeSchema):
86
+ label: str = "TailscaleDevice"
87
+ properties: TailscaleDeviceNodeProperties = TailscaleDeviceNodeProperties()
88
+ sub_resource_relationship: TailscaleDeviceToTailnetRel = (
89
+ TailscaleDeviceToTailnetRel()
90
+ )
91
+ other_relationships = OtherRelationships(
92
+ [
93
+ TailscaleDeviceToUserRel(),
94
+ ]
95
+ )
@@ -0,0 +1,86 @@
1
+ from dataclasses import dataclass
2
+
3
+ from cartography.models.core.common import PropertyRef
4
+ from cartography.models.core.nodes import CartographyNodeProperties
5
+ from cartography.models.core.nodes import CartographyNodeSchema
6
+ from cartography.models.core.relationships import CartographyRelProperties
7
+ from cartography.models.core.relationships import CartographyRelSchema
8
+ from cartography.models.core.relationships import LinkDirection
9
+ from cartography.models.core.relationships import make_target_node_matcher
10
+ from cartography.models.core.relationships import OtherRelationships
11
+ from cartography.models.core.relationships import TargetNodeMatcher
12
+
13
+
14
+ @dataclass(frozen=True)
15
+ class TailscaleGroupNodeProperties(CartographyNodeProperties):
16
+ id: PropertyRef = PropertyRef("id")
17
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
18
+ name: PropertyRef = PropertyRef("name")
19
+
20
+
21
+ @dataclass(frozen=True)
22
+ class TailscaleGroupToTailnetRelProperties(CartographyRelProperties):
23
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
24
+
25
+
26
+ @dataclass(frozen=True)
27
+ # (:TailscaleTailnet)-[:RESOURCE]->(:TailscaleGroup)
28
+ class TailscaleGroupToTailnetRel(CartographyRelSchema):
29
+ target_node_label: str = "TailscaleTailnet"
30
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
31
+ {"id": PropertyRef("org", set_in_kwargs=True)},
32
+ )
33
+ direction: LinkDirection = LinkDirection.INWARD
34
+ rel_label: str = "RESOURCE"
35
+ properties: TailscaleGroupToTailnetRelProperties = (
36
+ TailscaleGroupToTailnetRelProperties()
37
+ )
38
+
39
+
40
+ @dataclass(frozen=True)
41
+ class TailscaleGroupToUserRelProperties(CartographyRelProperties):
42
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
43
+
44
+
45
+ @dataclass(frozen=True)
46
+ # (:TailscaleUser)-[:MEMBER_OF]->(:TailscaleGroup)
47
+ class TailscaleGroupToUserRel(CartographyRelSchema):
48
+ target_node_label: str = "TailscaleUser"
49
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
50
+ {"login_name": PropertyRef("members", one_to_many=True)},
51
+ )
52
+ direction: LinkDirection = LinkDirection.INWARD
53
+ rel_label: str = "MEMBER_OF"
54
+ properties: TailscaleGroupToUserRelProperties = TailscaleGroupToUserRelProperties()
55
+
56
+
57
+ @dataclass(frozen=True)
58
+ class TailscaleGroupToGroupRelProperties(CartographyRelProperties):
59
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
60
+
61
+
62
+ @dataclass(frozen=True)
63
+ # (:TailscaleGroup)-[:MEMBER_OF]->(:TailscaleGroup)
64
+ class TailscaleGroupToGroupRel(CartographyRelSchema):
65
+ target_node_label: str = "TailscaleGroup"
66
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
67
+ {"id": PropertyRef("sub_groups", one_to_many=True)},
68
+ )
69
+ direction: LinkDirection = LinkDirection.INWARD
70
+ rel_label: str = "MEMBER_OF"
71
+ properties: TailscaleGroupToGroupRelProperties = (
72
+ TailscaleGroupToGroupRelProperties()
73
+ )
74
+
75
+
76
+ @dataclass(frozen=True)
77
+ class TailscaleGroupSchema(CartographyNodeSchema):
78
+ label: str = "TailscaleGroup"
79
+ properties: TailscaleGroupNodeProperties = TailscaleGroupNodeProperties()
80
+ sub_resource_relationship: TailscaleGroupToTailnetRel = TailscaleGroupToTailnetRel()
81
+ other_relationships = OtherRelationships(
82
+ [
83
+ TailscaleGroupToGroupRel(),
84
+ TailscaleGroupToUserRel(),
85
+ ]
86
+ )
@@ -0,0 +1,58 @@
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 TailscalePostureIntegrationNodeProperties(CartographyNodeProperties):
15
+ id: PropertyRef = PropertyRef("id")
16
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
17
+ provider: PropertyRef = PropertyRef("provider")
18
+ cloud_id: PropertyRef = PropertyRef("cloudId")
19
+ client_id: PropertyRef = PropertyRef("clientId")
20
+ tenant_id: PropertyRef = PropertyRef("tenantId")
21
+ config_updated: PropertyRef = PropertyRef("configUpdated")
22
+ status_last_sync: PropertyRef = PropertyRef("status.lastSync")
23
+ status_error: PropertyRef = PropertyRef("status.error")
24
+ status_provider_host_count: PropertyRef = PropertyRef("status.providerHostCount")
25
+ status_matched_count: PropertyRef = PropertyRef("status.matchedCount")
26
+ status_possible_matched_count: PropertyRef = PropertyRef(
27
+ "status.possibleMatchedCount"
28
+ )
29
+
30
+
31
+ @dataclass(frozen=True)
32
+ class TailscalePostureIntegrationToTailnetRelProperties(CartographyRelProperties):
33
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
34
+
35
+
36
+ @dataclass(frozen=True)
37
+ # (:TailscaleTailnet)-[:RESOURCE]->(:TailscalePostureIntegration)
38
+ class TailscalePostureIntegrationToTailnetRel(CartographyRelSchema):
39
+ target_node_label: str = "TailscaleTailnet"
40
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
41
+ {"id": PropertyRef("org", set_in_kwargs=True)},
42
+ )
43
+ direction: LinkDirection = LinkDirection.INWARD
44
+ rel_label: str = "RESOURCE"
45
+ properties: TailscalePostureIntegrationToTailnetRelProperties = (
46
+ TailscalePostureIntegrationToTailnetRelProperties()
47
+ )
48
+
49
+
50
+ @dataclass(frozen=True)
51
+ class TailscalePostureIntegrationSchema(CartographyNodeSchema):
52
+ label: str = "TailscalePostureIntegration"
53
+ properties: TailscalePostureIntegrationNodeProperties = (
54
+ TailscalePostureIntegrationNodeProperties()
55
+ )
56
+ sub_resource_relationship: TailscalePostureIntegrationToTailnetRel = (
57
+ TailscalePostureIntegrationToTailnetRel()
58
+ )
@@ -0,0 +1,102 @@
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 TailscaleTagNodeProperties(CartographyNodeProperties):
16
+ id: PropertyRef = PropertyRef("id")
17
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
18
+ name: PropertyRef = PropertyRef("name")
19
+
20
+
21
+ @dataclass(frozen=True)
22
+ class TailscaleTagToTailnetRelProperties(CartographyRelProperties):
23
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
24
+
25
+
26
+ @dataclass(frozen=True)
27
+ # (:TailscaleTailnet)-[:RESOURCE]->(:TailscaleTag)
28
+ class TailscaleTagToTailnetRel(CartographyRelSchema):
29
+ target_node_label: str = "TailscaleTailnet"
30
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
31
+ {"id": PropertyRef("org", set_in_kwargs=True)},
32
+ )
33
+ direction: LinkDirection = LinkDirection.INWARD
34
+ rel_label: str = "RESOURCE"
35
+ properties: TailscaleTagToTailnetRelProperties = (
36
+ TailscaleTagToTailnetRelProperties()
37
+ )
38
+
39
+
40
+ @dataclass(frozen=True)
41
+ class TailscaleTagToUserRelProperties(CartographyRelProperties):
42
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
43
+
44
+
45
+ @dataclass(frozen=True)
46
+ # (:TailscaleUser)-[:OWNS]->(:TailscaleTag)
47
+ class TailscaleTagToUserRel(CartographyRelSchema):
48
+ target_node_label: str = "TailscaleUser"
49
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
50
+ {"login_name": PropertyRef("owners", one_to_many=True)},
51
+ )
52
+ direction: LinkDirection = LinkDirection.INWARD
53
+ rel_label: str = "OWNS"
54
+ properties: TailscaleTagToUserRelProperties = TailscaleTagToUserRelProperties()
55
+
56
+
57
+ @dataclass(frozen=True)
58
+ class TailscaleTagToGroupRelProperties(CartographyRelProperties):
59
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
60
+
61
+
62
+ @dataclass(frozen=True)
63
+ # (:TailscaleGroup)-[:OWNS]->(:TailscaleTag)
64
+ class TailscaleTagToGroupRel(CartographyRelSchema):
65
+ target_node_label: str = "TailscaleGroup"
66
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
67
+ {"id": PropertyRef("group_owners", one_to_many=True)},
68
+ )
69
+ direction: LinkDirection = LinkDirection.INWARD
70
+ rel_label: str = "OWNS"
71
+ properties: TailscaleTagToGroupRelProperties = TailscaleTagToGroupRelProperties()
72
+
73
+
74
+ @dataclass(frozen=True)
75
+ class TailscaleTagToDeviceRelProperties(CartographyRelProperties):
76
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
77
+
78
+
79
+ @dataclass(frozen=True)
80
+ # (:TailscaleDevice)-[:TAGGED]->(:TailscaleTag)
81
+ class TailscaleTagToDeviceRel(CartographyRelSchema):
82
+ target_node_label: str = "TailscaleDevice"
83
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
84
+ {"id": PropertyRef("devices", one_to_many=True)},
85
+ )
86
+ direction: LinkDirection = LinkDirection.INWARD
87
+ rel_label: str = "TAGGED"
88
+ properties: TailscaleTagToDeviceRelProperties = TailscaleTagToDeviceRelProperties()
89
+
90
+
91
+ @dataclass(frozen=True)
92
+ class TailscaleTagSchema(CartographyNodeSchema):
93
+ label: str = "TailscaleTag"
94
+ properties: TailscaleTagNodeProperties = TailscaleTagNodeProperties()
95
+ sub_resource_relationship: TailscaleTagToTailnetRel = TailscaleTagToTailnetRel()
96
+ other_relationships = OtherRelationships(
97
+ [
98
+ TailscaleTagToGroupRel(),
99
+ TailscaleTagToUserRel(),
100
+ TailscaleTagToDeviceRel(),
101
+ ]
102
+ )
@@ -0,0 +1,29 @@
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
+
7
+
8
+ @dataclass(frozen=True)
9
+ class TailscaleTailnetNodeProperties(CartographyNodeProperties):
10
+ id: PropertyRef = PropertyRef("org", set_in_kwargs=True)
11
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
12
+ devices_approval_on: PropertyRef = PropertyRef("devicesApprovalOn")
13
+ devices_auto_updates_on: PropertyRef = PropertyRef("devicesAutoUpdatesOn")
14
+ devices_key_duration_days: PropertyRef = PropertyRef("devicesKeyDurationDays")
15
+ users_approval_on: PropertyRef = PropertyRef("usersApprovalOn")
16
+ users_role_allowed_to_join_external_tailnets: PropertyRef = PropertyRef(
17
+ "usersRoleAllowedToJoinExternalTailnets"
18
+ )
19
+ network_flow_logging_on: PropertyRef = PropertyRef("networkFlowLoggingOn")
20
+ regional_routing_on: PropertyRef = PropertyRef("regionalRoutingOn")
21
+ posture_identity_collection_on: PropertyRef = PropertyRef(
22
+ "postureIdentityCollectionOn"
23
+ )
24
+
25
+
26
+ @dataclass(frozen=True)
27
+ class TailscaleTailnetSchema(CartographyNodeSchema):
28
+ label: str = "TailscaleTailnet"
29
+ properties: TailscaleTailnetNodeProperties = TailscaleTailnetNodeProperties()
@@ -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 TailscaleUserNodeProperties(CartographyNodeProperties):
15
+ id: PropertyRef = PropertyRef("id")
16
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
17
+ display_name: PropertyRef = PropertyRef("displayName")
18
+ login_name: PropertyRef = PropertyRef("loginName", extra_index=True)
19
+ profile_pic_url: PropertyRef = PropertyRef("profilePicUrl")
20
+ created: PropertyRef = PropertyRef("created")
21
+ type: PropertyRef = PropertyRef("type")
22
+ role: PropertyRef = PropertyRef("role")
23
+ status: PropertyRef = PropertyRef("status")
24
+ device_count: PropertyRef = PropertyRef("deviceCount")
25
+ last_seen: PropertyRef = PropertyRef("lastSeen")
26
+ currently_connected: PropertyRef = PropertyRef("currentlyConnected")
27
+
28
+
29
+ @dataclass(frozen=True)
30
+ class TailscaleUserToTailnetRelProperties(CartographyRelProperties):
31
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
32
+
33
+
34
+ @dataclass(frozen=True)
35
+ # (:TailscaleTailnet)-[:RESOURCE]->(:TailscaleUser)
36
+ class TailscaleUserToTailnetRel(CartographyRelSchema):
37
+ target_node_label: str = "TailscaleTailnet"
38
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
39
+ {"id": PropertyRef("org", set_in_kwargs=True)},
40
+ )
41
+ direction: LinkDirection = LinkDirection.INWARD
42
+ rel_label: str = "RESOURCE"
43
+ properties: TailscaleUserToTailnetRelProperties = (
44
+ TailscaleUserToTailnetRelProperties()
45
+ )
46
+
47
+
48
+ @dataclass(frozen=True)
49
+ class TailscaleUserSchema(CartographyNodeSchema):
50
+ label: str = "TailscaleUser"
51
+ properties: TailscaleUserNodeProperties = TailscaleUserNodeProperties()
52
+ sub_resource_relationship: TailscaleUserToTailnetRel = TailscaleUserToTailnetRel()
cartography/sync.py CHANGED
@@ -14,9 +14,11 @@ from neo4j import GraphDatabase
14
14
  from statsd import StatsClient
15
15
 
16
16
  import cartography.intel.analysis
17
+ import cartography.intel.anthropic
17
18
  import cartography.intel.aws
18
19
  import cartography.intel.azure
19
20
  import cartography.intel.bigfix
21
+ import cartography.intel.cloudflare
20
22
  import cartography.intel.create_indexes
21
23
  import cartography.intel.crowdstrike
22
24
  import cartography.intel.cve
@@ -31,8 +33,10 @@ import cartography.intel.kubernetes
31
33
  import cartography.intel.lastpass
32
34
  import cartography.intel.oci
33
35
  import cartography.intel.okta
36
+ import cartography.intel.openai
34
37
  import cartography.intel.semgrep
35
38
  import cartography.intel.snipeit
39
+ import cartography.intel.tailscale
36
40
  from cartography.config import Config
37
41
  from cartography.stats import set_stats_client
38
42
  from cartography.util import STATUS_FAILURE
@@ -44,15 +48,18 @@ logger = logging.getLogger(__name__)
44
48
  TOP_LEVEL_MODULES = OrderedDict(
45
49
  { # preserve order so that the default sync always runs `analysis` at the very end
46
50
  "create-indexes": cartography.intel.create_indexes.run,
51
+ "anthropic": cartography.intel.anthropic.start_anthropic_ingestion,
47
52
  "aws": cartography.intel.aws.start_aws_ingestion,
48
53
  "azure": cartography.intel.azure.start_azure_ingestion,
49
54
  "entra": cartography.intel.entra.start_entra_ingestion,
55
+ "cloudflare": cartography.intel.cloudflare.start_cloudflare_ingestion,
50
56
  "crowdstrike": cartography.intel.crowdstrike.start_crowdstrike_ingestion,
51
57
  "gcp": cartography.intel.gcp.start_gcp_ingestion,
52
58
  "gsuite": cartography.intel.gsuite.start_gsuite_ingestion,
53
59
  "cve": cartography.intel.cve.start_cve_ingestion,
54
60
  "oci": cartography.intel.oci.start_oci_ingestion,
55
61
  "okta": cartography.intel.okta.start_okta_ingestion,
62
+ "openai": cartography.intel.openai.start_openai_ingestion,
56
63
  "github": cartography.intel.github.start_github_ingestion,
57
64
  "digitalocean": cartography.intel.digitalocean.start_digitalocean_ingestion,
58
65
  "kandji": cartography.intel.kandji.start_kandji_ingestion,
@@ -62,6 +69,7 @@ TOP_LEVEL_MODULES = OrderedDict(
62
69
  "duo": cartography.intel.duo.start_duo_ingestion,
63
70
  "semgrep": cartography.intel.semgrep.start_semgrep_ingestion,
64
71
  "snipeit": cartography.intel.snipeit.start_snipeit_ingestion,
72
+ "tailscale": cartography.intel.tailscale.start_tailscale_ingestion,
65
73
  "analysis": cartography.intel.analysis.run,
66
74
  }
67
75
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cartography
3
- Version: 0.103.0rc1
3
+ Version: 0.104.0rc2
4
4
  Summary: Explore assets and their relationships across your technical infrastructure.
5
5
  Maintainer: Cartography Contributors
6
6
  License: apache2
@@ -54,6 +54,7 @@ Requires-Dist: crowdstrike-falconpy>=0.5.1
54
54
  Requires-Dist: python-dateutil
55
55
  Requires-Dist: xmltodict
56
56
  Requires-Dist: duo-client
57
+ Requires-Dist: cloudflare<5.0.0,>=4.1.0
57
58
  Dynamic: license-file
58
59
 
59
60
  ![Cartography](docs/root/images/logo-horizontal.png)
@@ -79,11 +80,10 @@ You can learn more about the story behind Cartography in our [presentation at BS
79
80
 
80
81
 
81
82
  ## Supported platforms
82
-
83
- - [Amazon Web Services](https://cartography-cncf.github.io/cartography/modules/aws/index.html) - API Gateway, Config, EC2, ECS, ECR, Elasticsearch, Elastic Kubernetes Service (EKS), DynamoDB, IAM, Inspector, KMS, Lambda, RDS, Redshift, Route53, S3, S3AccountPublicAccessBlock, Secrets Manager, Security Hub, SNS, SQS, SSM, STS, Tags
83
+ - [Amazon Web Services](https://cartography-cncf.github.io/cartography/modules/aws/index.html) - API Gateway, CloudWatch, Config, EC2, ECS, ECR, Elasticsearch, Elastic Kubernetes Service (EKS), DynamoDB, IAM, Inspector, KMS, Lambda, RDS, Redshift, Route53, S3, Secrets Manager(Secret Versions), Security Hub, SQS, SSM, STS, Tags
84
84
  - [Google Cloud Platform](https://cartography-cncf.github.io/cartography/modules/gcp/index.html) - Cloud Resource Manager, Compute, DNS, Storage, Google Kubernetes Engine
85
85
  - [Google GSuite](https://cartography-cncf.github.io/cartography/modules/gsuite/index.html) - users, groups
86
- - [Oracle Cloud Infrastructure](docs/setup/config/oci.md) - IAM
86
+ - [Oracle Cloud Infrastructure](https://cartography-cncf.github.io/cartography/modules/oci/index.html) - IAM
87
87
  - [Okta](https://cartography-cncf.github.io/cartography/modules/okta/index.html) - users, groups, organizations, roles, applications, factors, trusted origins, reply URIs
88
88
  - [GitHub](https://cartography-cncf.github.io/cartography/modules/github/index.html) - repos, branches, users, teams
89
89
  - [DigitalOcean](https://cartography-cncf.github.io/cartography/modules/digitalocean/index.html)
@@ -98,6 +98,10 @@ You can learn more about the story behind Cartography in our [presentation at BS
98
98
  - [Duo](https://cartography-cncf.github.io/cartography/modules/duo/index.html) - Users, Groups, Endpoints
99
99
  - [Kandji](https://cartography-cncf.github.io/cartography/modules/kandji/index.html) - Devices
100
100
  - [SnipeIT](https://cartography-cncf.github.io/cartography/modules/snipeit/index.html) - Users, Assets
101
+ - [Tailscale](https://cartography-cncf.github.io/cartography/modules/tailscale/index.html) - Tailnet, Users, Devices, Groups, Tags, PostureIntegrations
102
+ - [Cloudflare](https://cartography-cncf.github.io/cartography/modules/cloudflare/index.html) - Account, Role, Member, Zone, DNSRecord
103
+ - [OpenAI](https://cartography-cncf.github.io/cartography/modules/openai/index.html) - Organization, AdminApiKey, User, Project, ServiceAccount, ApiKey
104
+ - [Anthropic](https://cartography-cncf.github.io/cartography/modules/anthropic/index.html) - Organization, ApiKey, User, Workspace
101
105
 
102
106
 
103
107
  ## Philosophy