cartography 0.106.0rc2__py3-none-any.whl → 0.107.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.

Files changed (92) hide show
  1. cartography/_version.py +2 -2
  2. cartography/cli.py +131 -2
  3. cartography/config.py +42 -0
  4. cartography/driftdetect/cli.py +3 -2
  5. cartography/intel/airbyte/__init__.py +105 -0
  6. cartography/intel/airbyte/connections.py +120 -0
  7. cartography/intel/airbyte/destinations.py +81 -0
  8. cartography/intel/airbyte/organizations.py +59 -0
  9. cartography/intel/airbyte/sources.py +78 -0
  10. cartography/intel/airbyte/tags.py +64 -0
  11. cartography/intel/airbyte/users.py +106 -0
  12. cartography/intel/airbyte/util.py +122 -0
  13. cartography/intel/airbyte/workspaces.py +63 -0
  14. cartography/intel/aws/__init__.py +1 -0
  15. cartography/intel/aws/cloudtrail_management_events.py +364 -0
  16. cartography/intel/aws/cloudwatch.py +77 -0
  17. cartography/intel/aws/codebuild.py +132 -0
  18. cartography/intel/aws/ec2/subnets.py +1 -1
  19. cartography/intel/aws/ecs.py +17 -0
  20. cartography/intel/aws/inspector.py +77 -48
  21. cartography/intel/aws/resources.py +4 -0
  22. cartography/intel/aws/sns.py +62 -2
  23. cartography/intel/entra/users.py +84 -42
  24. cartography/intel/scaleway/__init__.py +127 -0
  25. cartography/intel/scaleway/iam/__init__.py +0 -0
  26. cartography/intel/scaleway/iam/apikeys.py +71 -0
  27. cartography/intel/scaleway/iam/applications.py +71 -0
  28. cartography/intel/scaleway/iam/groups.py +71 -0
  29. cartography/intel/scaleway/iam/users.py +71 -0
  30. cartography/intel/scaleway/instances/__init__.py +0 -0
  31. cartography/intel/scaleway/instances/flexibleips.py +86 -0
  32. cartography/intel/scaleway/instances/instances.py +92 -0
  33. cartography/intel/scaleway/projects.py +79 -0
  34. cartography/intel/scaleway/storage/__init__.py +0 -0
  35. cartography/intel/scaleway/storage/snapshots.py +86 -0
  36. cartography/intel/scaleway/storage/volumes.py +84 -0
  37. cartography/intel/scaleway/utils.py +37 -0
  38. cartography/intel/sentinelone/__init__.py +69 -0
  39. cartography/intel/sentinelone/account.py +140 -0
  40. cartography/intel/sentinelone/agent.py +139 -0
  41. cartography/intel/sentinelone/api.py +113 -0
  42. cartography/intel/sentinelone/application.py +248 -0
  43. cartography/intel/sentinelone/utils.py +28 -0
  44. cartography/models/airbyte/__init__.py +0 -0
  45. cartography/models/airbyte/connection.py +138 -0
  46. cartography/models/airbyte/destination.py +75 -0
  47. cartography/models/airbyte/organization.py +19 -0
  48. cartography/models/airbyte/source.py +75 -0
  49. cartography/models/airbyte/stream.py +74 -0
  50. cartography/models/airbyte/tag.py +69 -0
  51. cartography/models/airbyte/user.py +111 -0
  52. cartography/models/airbyte/workspace.py +46 -0
  53. cartography/models/aws/cloudtrail/management_events.py +64 -0
  54. cartography/models/aws/cloudwatch/log_metric_filter.py +79 -0
  55. cartography/models/aws/codebuild/__init__.py +0 -0
  56. cartography/models/aws/codebuild/project.py +49 -0
  57. cartography/models/aws/ec2/networkinterfaces.py +2 -0
  58. cartography/models/aws/ec2/subnet_instance.py +2 -0
  59. cartography/models/aws/ec2/subnet_networkinterface.py +2 -0
  60. cartography/models/aws/ecs/containers.py +19 -0
  61. cartography/models/aws/ecs/task_definitions.py +38 -0
  62. cartography/models/aws/ecs/tasks.py +24 -1
  63. cartography/models/aws/inspector/findings.py +37 -0
  64. cartography/models/aws/inspector/packages.py +1 -31
  65. cartography/models/aws/sns/topic_subscription.py +74 -0
  66. cartography/models/entra/user.py +17 -51
  67. cartography/models/scaleway/__init__.py +0 -0
  68. cartography/models/scaleway/iam/__init__.py +0 -0
  69. cartography/models/scaleway/iam/apikey.py +96 -0
  70. cartography/models/scaleway/iam/application.py +52 -0
  71. cartography/models/scaleway/iam/group.py +95 -0
  72. cartography/models/scaleway/iam/user.py +60 -0
  73. cartography/models/scaleway/instance/__init__.py +0 -0
  74. cartography/models/scaleway/instance/flexibleip.py +52 -0
  75. cartography/models/scaleway/instance/instance.py +118 -0
  76. cartography/models/scaleway/organization.py +19 -0
  77. cartography/models/scaleway/project.py +48 -0
  78. cartography/models/scaleway/storage/__init__.py +0 -0
  79. cartography/models/scaleway/storage/snapshot.py +78 -0
  80. cartography/models/scaleway/storage/volume.py +51 -0
  81. cartography/models/sentinelone/__init__.py +1 -0
  82. cartography/models/sentinelone/account.py +40 -0
  83. cartography/models/sentinelone/agent.py +50 -0
  84. cartography/models/sentinelone/application.py +44 -0
  85. cartography/models/sentinelone/application_version.py +96 -0
  86. cartography/sync.py +11 -4
  87. {cartography-0.106.0rc2.dist-info → cartography-0.107.0.dist-info}/METADATA +20 -16
  88. {cartography-0.106.0rc2.dist-info → cartography-0.107.0.dist-info}/RECORD +92 -28
  89. {cartography-0.106.0rc2.dist-info → cartography-0.107.0.dist-info}/WHEEL +0 -0
  90. {cartography-0.106.0rc2.dist-info → cartography-0.107.0.dist-info}/entry_points.txt +0 -0
  91. {cartography-0.106.0rc2.dist-info → cartography-0.107.0.dist-info}/licenses/LICENSE +0 -0
  92. {cartography-0.106.0rc2.dist-info → cartography-0.107.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,118 @@
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 ScalewayInstanceProperties(CartographyNodeProperties):
16
+ id: PropertyRef = PropertyRef("id")
17
+ name: PropertyRef = PropertyRef("name")
18
+ tags: PropertyRef = PropertyRef("tags")
19
+ commercial_type: PropertyRef = PropertyRef("commercial_type")
20
+ creation_date: PropertyRef = PropertyRef("creation_date")
21
+ dynamic_ip_required: PropertyRef = PropertyRef("dynamic_ip_required")
22
+ routed_ip_enabled: PropertyRef = PropertyRef("routed_ip_enabled")
23
+ enable_ipv6: PropertyRef = PropertyRef("enable_ipv6")
24
+ hostname: PropertyRef = PropertyRef("hostname")
25
+ private_ip: PropertyRef = PropertyRef("private_ip")
26
+ mac_address: PropertyRef = PropertyRef("mac_address")
27
+ modification_date: PropertyRef = PropertyRef("modification_date")
28
+ state: PropertyRef = PropertyRef("state")
29
+ location_cluster_id: PropertyRef = PropertyRef("location.cluster_id")
30
+ location_hypervisor_id: PropertyRef = PropertyRef("location.hypervisor_id")
31
+ location_node_id: PropertyRef = PropertyRef("location.node_id")
32
+ location_platform_id: PropertyRef = PropertyRef("location.platform_id")
33
+ ipv6_address: PropertyRef = PropertyRef("ipv6.address")
34
+ ipv6_gateway: PropertyRef = PropertyRef("ipv6.gateway")
35
+ ipv6_netmask: PropertyRef = PropertyRef("ipv6.netmask")
36
+ boot_type: PropertyRef = PropertyRef("boot_type")
37
+ state_detail: PropertyRef = PropertyRef("state_detail")
38
+ arch: PropertyRef = PropertyRef("arch")
39
+ private_nics: PropertyRef = PropertyRef("private_nics")
40
+ zone: PropertyRef = PropertyRef("zone")
41
+ end_of_service: PropertyRef = PropertyRef("end_of_service")
42
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
43
+
44
+
45
+ @dataclass(frozen=True)
46
+ class ScalewayInstanceToVolumeProperties(CartographyRelProperties):
47
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
48
+
49
+
50
+ @dataclass(frozen=True)
51
+ # (:ScalewayVolume)<-[:MOUNTS]-(:ScalewayInstance)
52
+ class ScalewayInstanceToVolumeRel(CartographyRelSchema):
53
+ target_node_label: str = "ScalewayVolume"
54
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
55
+ {"id": PropertyRef("volumes_id", one_to_many=True)},
56
+ )
57
+ direction: LinkDirection = LinkDirection.OUTWARD
58
+ rel_label: str = "MOUNTS"
59
+ properties: ScalewayInstanceToVolumeProperties = (
60
+ ScalewayInstanceToVolumeProperties()
61
+ )
62
+
63
+
64
+ @dataclass(frozen=True)
65
+ class ScalewayInstanceToFlexibleIpProperties(CartographyRelProperties):
66
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
67
+
68
+
69
+ @dataclass(frozen=True)
70
+ # (:ScalewayFlexibleIp)-[:IDENTIFIES]->(:ScalewayInstance)
71
+ class ScalewayInstanceToFlexibleIpRel(CartographyRelSchema):
72
+ target_node_label: str = "ScalewayFlexibleIp"
73
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
74
+ {"id": PropertyRef("public_ips", one_to_many=True)},
75
+ )
76
+ direction: LinkDirection = LinkDirection.INWARD
77
+ rel_label: str = "IDENTIFIES"
78
+ properties: ScalewayInstanceToFlexibleIpProperties = (
79
+ ScalewayInstanceToFlexibleIpProperties()
80
+ )
81
+
82
+
83
+ # TODO: Link to Image with image.id
84
+ # TODO: Link to SecurityGroup with security_group.id
85
+ # TODO: Link to PlacementGroup with placement_group.id
86
+
87
+
88
+ @dataclass(frozen=True)
89
+ class ScalewayInstanceToProjectRelProperties(CartographyRelProperties):
90
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
91
+
92
+
93
+ @dataclass(frozen=True)
94
+ # (:ScalewayProject)-[:RESOURCE]->(:ScalewayInstance)
95
+ class ScalewayInstanceToProjectRel(CartographyRelSchema):
96
+ target_node_label: str = "ScalewayProject"
97
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
98
+ {"id": PropertyRef("PROJECT_ID", set_in_kwargs=True)},
99
+ )
100
+ direction: LinkDirection = LinkDirection.INWARD
101
+ rel_label: str = "RESOURCE"
102
+ properties: ScalewayInstanceToProjectRelProperties = (
103
+ ScalewayInstanceToProjectRelProperties()
104
+ )
105
+
106
+
107
+ @dataclass(frozen=True)
108
+ class ScalewayInstanceSchema(CartographyNodeSchema):
109
+ label: str = "ScalewayInstance"
110
+ properties: ScalewayInstanceProperties = ScalewayInstanceProperties()
111
+ sub_resource_relationship: ScalewayInstanceToProjectRel = (
112
+ ScalewayInstanceToProjectRel()
113
+ )
114
+ other_relationships: OtherRelationships = OtherRelationships(
115
+ [
116
+ ScalewayInstanceToVolumeRel(),
117
+ ]
118
+ )
@@ -0,0 +1,19 @@
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 ScalewayOrganizationNodeProperties(CartographyNodeProperties):
10
+ id: PropertyRef = PropertyRef("id")
11
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
12
+
13
+
14
+ @dataclass(frozen=True)
15
+ class ScalewayOrganizationSchema(CartographyNodeSchema):
16
+ label: str = "ScalewayOrganization"
17
+ properties: ScalewayOrganizationNodeProperties = (
18
+ ScalewayOrganizationNodeProperties()
19
+ )
@@ -0,0 +1,48 @@
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 ScalewayProjectNodeProperties(CartographyNodeProperties):
15
+ id: PropertyRef = PropertyRef("id")
16
+ name: PropertyRef = PropertyRef("name")
17
+ created_at: PropertyRef = PropertyRef("created_at")
18
+ updated_at: PropertyRef = PropertyRef("updated_at")
19
+ description: PropertyRef = PropertyRef("description")
20
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
21
+
22
+
23
+ @dataclass(frozen=True)
24
+ class ScalewayProjectToOrganizationRelProperties(CartographyRelProperties):
25
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
26
+
27
+
28
+ @dataclass(frozen=True)
29
+ # (:ScalewayOrganization)-[:RESOURCE]->(:ScalewayProject)
30
+ class ScalewayProjectToOrganizationRel(CartographyRelSchema):
31
+ target_node_label: str = "ScalewayOrganization"
32
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
33
+ {"id": PropertyRef("ORG_ID", set_in_kwargs=True)},
34
+ )
35
+ direction: LinkDirection = LinkDirection.INWARD
36
+ rel_label: str = "RESOURCE"
37
+ properties: ScalewayProjectToOrganizationRelProperties = (
38
+ ScalewayProjectToOrganizationRelProperties()
39
+ )
40
+
41
+
42
+ @dataclass(frozen=True)
43
+ class ScalewayProjectSchema(CartographyNodeSchema):
44
+ label: str = "ScalewayProject"
45
+ properties: ScalewayProjectNodeProperties = ScalewayProjectNodeProperties()
46
+ sub_resource_relationship: ScalewayProjectToOrganizationRel = (
47
+ ScalewayProjectToOrganizationRel()
48
+ )
File without changes
@@ -0,0 +1,78 @@
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 ScalewayVolumeSnapshotNodeProperties(CartographyNodeProperties):
16
+ id: PropertyRef = PropertyRef("id")
17
+ name: PropertyRef = PropertyRef("name")
18
+ tags: PropertyRef = PropertyRef("tags")
19
+ volume_type: PropertyRef = PropertyRef("volume_type")
20
+ size: PropertyRef = PropertyRef("size")
21
+ state: PropertyRef = PropertyRef("state")
22
+ creation_date: PropertyRef = PropertyRef("creation_date")
23
+ modification_date: PropertyRef = PropertyRef("modification_date")
24
+ error_reason: PropertyRef = PropertyRef("error_reason")
25
+ zone: PropertyRef = PropertyRef("zone")
26
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
27
+
28
+
29
+ @dataclass(frozen=True)
30
+ class ScalewayVolumeSnapshotToProjectRelProperties(CartographyRelProperties):
31
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
32
+
33
+
34
+ @dataclass(frozen=True)
35
+ # (:ScalewayProject)-[:RESOURCE]->(:ScalewayVolumeSnapshot)
36
+ class ScalewayVolumeSnapshotToProjectRel(CartographyRelSchema):
37
+ target_node_label: str = "ScalewayProject"
38
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
39
+ {"id": PropertyRef("PROJECT_ID", set_in_kwargs=True)},
40
+ )
41
+ direction: LinkDirection = LinkDirection.INWARD
42
+ rel_label: str = "RESOURCE"
43
+ properties: ScalewayVolumeSnapshotToProjectRelProperties = (
44
+ ScalewayVolumeSnapshotToProjectRelProperties()
45
+ )
46
+
47
+
48
+ @dataclass(frozen=True)
49
+ class ScalewayVolumeSnapshotToInstanceVolumeProperties(CartographyRelProperties):
50
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
51
+
52
+
53
+ @dataclass(frozen=True)
54
+ # (:ScalewayVolume)-[:HAS]->(:ScalewayVolumeSnapshot)
55
+ class ScalewayVolumeSnapshotToInstanceVolumeRel(CartographyRelSchema):
56
+ target_node_label: str = "ScalewayVolume"
57
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
58
+ {"id": PropertyRef("base_volume.id")},
59
+ )
60
+ direction: LinkDirection = LinkDirection.INWARD
61
+ rel_label: str = "HAS"
62
+ properties: ScalewayVolumeSnapshotToInstanceVolumeProperties = (
63
+ ScalewayVolumeSnapshotToInstanceVolumeProperties()
64
+ )
65
+
66
+
67
+ @dataclass(frozen=True)
68
+ class ScalewayVolumeSnapshotSchema(CartographyNodeSchema):
69
+ label: str = "ScalewayVolumeSnapshot"
70
+ properties: ScalewayVolumeSnapshotNodeProperties = (
71
+ ScalewayVolumeSnapshotNodeProperties()
72
+ )
73
+ sub_resource_relationship: ScalewayVolumeSnapshotToProjectRel = (
74
+ ScalewayVolumeSnapshotToProjectRel()
75
+ )
76
+ other_relationships: OtherRelationships = OtherRelationships(
77
+ rels=[ScalewayVolumeSnapshotToInstanceVolumeRel()],
78
+ )
@@ -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 ScalewayVolumeNodeProperties(CartographyNodeProperties):
15
+ id: PropertyRef = PropertyRef("id")
16
+ name: PropertyRef = PropertyRef("name")
17
+ export_uri: PropertyRef = PropertyRef("export_uri")
18
+ size: PropertyRef = PropertyRef("size")
19
+ volume_type: PropertyRef = PropertyRef("volume_type")
20
+ creation_date: PropertyRef = PropertyRef("creation_date")
21
+ modification_date: PropertyRef = PropertyRef("modification_date")
22
+ tags: PropertyRef = PropertyRef("tags")
23
+ state: PropertyRef = PropertyRef("state")
24
+ zone: PropertyRef = PropertyRef("zone")
25
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
26
+
27
+
28
+ @dataclass(frozen=True)
29
+ class ScalewayVolumeToProjectRelProperties(CartographyRelProperties):
30
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
31
+
32
+
33
+ @dataclass(frozen=True)
34
+ # (:ScalewayProject)-[:RESOURCE]->(:ScalewayVolume)
35
+ class ScalewayVolumeToProjectRel(CartographyRelSchema):
36
+ target_node_label: str = "ScalewayProject"
37
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
38
+ {"id": PropertyRef("PROJECT_ID", set_in_kwargs=True)},
39
+ )
40
+ direction: LinkDirection = LinkDirection.INWARD
41
+ rel_label: str = "RESOURCE"
42
+ properties: ScalewayVolumeToProjectRelProperties = (
43
+ ScalewayVolumeToProjectRelProperties()
44
+ )
45
+
46
+
47
+ @dataclass(frozen=True)
48
+ class ScalewayVolumeSchema(CartographyNodeSchema):
49
+ label: str = "ScalewayVolume"
50
+ properties: ScalewayVolumeNodeProperties = ScalewayVolumeNodeProperties()
51
+ sub_resource_relationship: ScalewayVolumeToProjectRel = ScalewayVolumeToProjectRel()
@@ -0,0 +1 @@
1
+ # SentinelOne data models
@@ -0,0 +1,40 @@
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 S1AccountNodeProperties(CartographyNodeProperties):
10
+ """
11
+ Properties for SentinelOne Account nodes
12
+ """
13
+
14
+ # Required unique identifier
15
+ id: PropertyRef = PropertyRef("id")
16
+
17
+ # Automatic fields (set by cartography)
18
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
19
+
20
+ # Business fields from SentinelOne API
21
+ name: PropertyRef = PropertyRef("name", extra_index=True)
22
+ account_type: PropertyRef = PropertyRef("account_type")
23
+ active_agents: PropertyRef = PropertyRef("active_agents")
24
+ created_at: PropertyRef = PropertyRef("created_at")
25
+ expiration: PropertyRef = PropertyRef("expiration")
26
+ number_of_sites: PropertyRef = PropertyRef("number_of_sites")
27
+ state: PropertyRef = PropertyRef("state")
28
+
29
+
30
+ @dataclass(frozen=True)
31
+ class S1AccountSchema(CartographyNodeSchema):
32
+ """
33
+ Schema for SentinelOne Account nodes
34
+ """
35
+
36
+ label: str = "S1Account"
37
+ properties: S1AccountNodeProperties = S1AccountNodeProperties()
38
+
39
+ # S1Account is a top-level tenant-like entity, so no sub_resource_relationship
40
+ sub_resource_relationship: None = None
@@ -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 S1AgentNodeProperties(CartographyNodeProperties):
15
+ id: PropertyRef = PropertyRef("id", extra_index=True)
16
+ uuid: PropertyRef = PropertyRef("uuid", extra_index=True)
17
+ computer_name: PropertyRef = PropertyRef("computer_name", extra_index=True)
18
+ firewall_enabled: PropertyRef = PropertyRef("firewall_enabled")
19
+ os_name: PropertyRef = PropertyRef("os_name")
20
+ os_revision: PropertyRef = PropertyRef("os_revision")
21
+ domain: PropertyRef = PropertyRef("domain")
22
+ last_active: PropertyRef = PropertyRef("last_active")
23
+ last_successful_scan: PropertyRef = PropertyRef("last_successful_scan")
24
+ scan_status: PropertyRef = PropertyRef("scan_status")
25
+ serial_number: PropertyRef = PropertyRef("serial_number", extra_index=True)
26
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
27
+
28
+
29
+ @dataclass(frozen=True)
30
+ class S1AgentToAccountRelProperties(CartographyRelProperties):
31
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
32
+
33
+
34
+ @dataclass(frozen=True)
35
+ # (:S1Agent)<-[:RESOURCE]-(:S1Account)
36
+ class S1AgentToAccount(CartographyRelSchema):
37
+ target_node_label: str = "S1Account"
38
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
39
+ {"id": PropertyRef("S1_ACCOUNT_ID", set_in_kwargs=True)},
40
+ )
41
+ direction: LinkDirection = LinkDirection.INWARD
42
+ rel_label: str = "RESOURCE"
43
+ properties: S1AgentToAccountRelProperties = S1AgentToAccountRelProperties()
44
+
45
+
46
+ @dataclass(frozen=True)
47
+ class S1AgentSchema(CartographyNodeSchema):
48
+ label: str = "S1Agent"
49
+ properties: S1AgentNodeProperties = S1AgentNodeProperties()
50
+ sub_resource_relationship: S1AgentToAccount = S1AgentToAccount()
@@ -0,0 +1,44 @@
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 S1ApplicationNodeProperties(CartographyNodeProperties):
15
+ id: PropertyRef = PropertyRef("id")
16
+ name: PropertyRef = PropertyRef("name")
17
+ vendor: PropertyRef = PropertyRef("vendor")
18
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
19
+
20
+
21
+ @dataclass(frozen=True)
22
+ class S1ApplicationToAccountRelProperties(CartographyRelProperties):
23
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
24
+
25
+
26
+ @dataclass(frozen=True)
27
+ # (:S1Application)<-[:RESOURCE]-(:S1Account)
28
+ class S1ApplicationToAccount(CartographyRelSchema):
29
+ target_node_label: str = "S1Account"
30
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
31
+ {"id": PropertyRef("S1_ACCOUNT_ID", set_in_kwargs=True)},
32
+ )
33
+ direction: LinkDirection = LinkDirection.INWARD
34
+ rel_label: str = "RESOURCE"
35
+ properties: S1ApplicationToAccountRelProperties = (
36
+ S1ApplicationToAccountRelProperties()
37
+ )
38
+
39
+
40
+ @dataclass(frozen=True)
41
+ class S1ApplicationSchema(CartographyNodeSchema):
42
+ label: str = "S1Application"
43
+ properties: S1ApplicationNodeProperties = S1ApplicationNodeProperties()
44
+ sub_resource_relationship: S1ApplicationToAccount = S1ApplicationToAccount()
@@ -0,0 +1,96 @@
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 S1ApplicationVersionNodeProperties(CartographyNodeProperties):
16
+ id: PropertyRef = PropertyRef("id", extra_index=True)
17
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
18
+ application_name: PropertyRef = PropertyRef("application_name")
19
+ application_vendor: PropertyRef = PropertyRef("application_vendor")
20
+ version: PropertyRef = PropertyRef("version")
21
+
22
+
23
+ @dataclass(frozen=True)
24
+ class S1ApplicationVersionToAccountRelProperties(CartographyRelProperties):
25
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
26
+
27
+
28
+ @dataclass(frozen=True)
29
+ # (:S1ApplicationVersion)<-[:RESOURCE]-(:S1Account)
30
+ class S1ApplicationVersionToAccount(CartographyRelSchema):
31
+ target_node_label: str = "S1Account"
32
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
33
+ {"id": PropertyRef("S1_ACCOUNT_ID", set_in_kwargs=True)},
34
+ )
35
+ direction: LinkDirection = LinkDirection.INWARD
36
+ rel_label: str = "RESOURCE"
37
+ properties: S1ApplicationVersionToAccountRelProperties = (
38
+ S1ApplicationVersionToAccountRelProperties()
39
+ )
40
+
41
+
42
+ @dataclass(frozen=True)
43
+ class S1AgentToApplicationVersionRelProperties(CartographyRelProperties):
44
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
45
+ installeddatetime: PropertyRef = PropertyRef("installed_dt")
46
+ installationpath: PropertyRef = PropertyRef("installation_path")
47
+
48
+
49
+ @dataclass(frozen=True)
50
+ # (:S1Agent)-[:HAS_INSTALLED]->(:S1ApplicationVersion)
51
+ class S1AgentToS1ApplicationVersion(CartographyRelSchema):
52
+ target_node_label: str = "S1Agent"
53
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
54
+ {"uuid": PropertyRef("agent_uuid")},
55
+ )
56
+ direction: LinkDirection = LinkDirection.INWARD
57
+ rel_label: str = "HAS_INSTALLED"
58
+ properties: S1AgentToApplicationVersionRelProperties = (
59
+ S1AgentToApplicationVersionRelProperties()
60
+ )
61
+
62
+
63
+ @dataclass(frozen=True)
64
+ class S1ApplicationVersionToApplicationRelProperties(CartographyRelProperties):
65
+ lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True)
66
+
67
+
68
+ @dataclass(frozen=True)
69
+ # (:S1ApplicationVersion)<-[:VERSION]-(:S1Application)
70
+ class S1ApplicationVersionToApplication(CartographyRelSchema):
71
+ target_node_label: str = "S1Application"
72
+ target_node_matcher: TargetNodeMatcher = make_target_node_matcher(
73
+ {"id": PropertyRef("application_id")},
74
+ )
75
+ direction: LinkDirection = LinkDirection.INWARD
76
+ rel_label: str = "VERSION"
77
+ properties: S1ApplicationVersionToApplicationRelProperties = (
78
+ S1ApplicationVersionToApplicationRelProperties()
79
+ )
80
+
81
+
82
+ @dataclass(frozen=True)
83
+ class S1ApplicationVersionSchema(CartographyNodeSchema):
84
+ label: str = "S1ApplicationVersion"
85
+ properties: S1ApplicationVersionNodeProperties = (
86
+ S1ApplicationVersionNodeProperties()
87
+ )
88
+ sub_resource_relationship: S1ApplicationVersionToAccount = (
89
+ S1ApplicationVersionToAccount()
90
+ )
91
+ other_relationships: OtherRelationships = OtherRelationships(
92
+ [
93
+ S1AgentToS1ApplicationVersion(),
94
+ S1ApplicationVersionToApplication(),
95
+ ],
96
+ )
cartography/sync.py CHANGED
@@ -13,6 +13,7 @@ import neo4j.exceptions
13
13
  from neo4j import GraphDatabase
14
14
  from statsd import StatsClient
15
15
 
16
+ import cartography.intel.airbyte
16
17
  import cartography.intel.analysis
17
18
  import cartography.intel.anthropic
18
19
  import cartography.intel.aws
@@ -28,13 +29,17 @@ import cartography.intel.entra
28
29
  import cartography.intel.gcp
29
30
  import cartography.intel.github
30
31
  import cartography.intel.gsuite
32
+ import cartography.intel.jamf
31
33
  import cartography.intel.kandji
32
34
  import cartography.intel.kubernetes
33
35
  import cartography.intel.lastpass
34
36
  import cartography.intel.oci
35
37
  import cartography.intel.okta
36
38
  import cartography.intel.openai
39
+ import cartography.intel.pagerduty
40
+ import cartography.intel.scaleway
37
41
  import cartography.intel.semgrep
42
+ import cartography.intel.sentinelone
38
43
  import cartography.intel.snipeit
39
44
  import cartography.intel.tailscale
40
45
  import cartography.intel.trivy
@@ -49,6 +54,7 @@ logger = logging.getLogger(__name__)
49
54
  TOP_LEVEL_MODULES = OrderedDict(
50
55
  { # preserve order so that the default sync always runs `analysis` at the very end
51
56
  "create-indexes": cartography.intel.create_indexes.run,
57
+ "airbyte": cartography.intel.airbyte.start_airbyte_ingestion,
52
58
  "anthropic": cartography.intel.anthropic.start_anthropic_ingestion,
53
59
  "aws": cartography.intel.aws.start_aws_ingestion,
54
60
  "azure": cartography.intel.azure.start_azure_ingestion,
@@ -68,10 +74,15 @@ TOP_LEVEL_MODULES = OrderedDict(
68
74
  "lastpass": cartography.intel.lastpass.start_lastpass_ingestion,
69
75
  "bigfix": cartography.intel.bigfix.start_bigfix_ingestion,
70
76
  "duo": cartography.intel.duo.start_duo_ingestion,
77
+ "scaleway": cartography.intel.scaleway.start_scaleway_ingestion,
71
78
  "semgrep": cartography.intel.semgrep.start_semgrep_ingestion,
72
79
  "snipeit": cartography.intel.snipeit.start_snipeit_ingestion,
73
80
  "tailscale": cartography.intel.tailscale.start_tailscale_ingestion,
81
+ "jamf": cartography.intel.jamf.start_jamf_ingestion,
82
+ "pagerduty": cartography.intel.pagerduty.start_pagerduty_ingestion,
74
83
  "trivy": cartography.intel.trivy.start_trivy_ingestion,
84
+ "sentinelone": cartography.intel.sentinelone.start_sentinelone_ingestion,
85
+ # Analysis should be the last stage
75
86
  "analysis": cartography.intel.analysis.run,
76
87
  }
77
88
  )
@@ -203,10 +214,6 @@ class Sync:
203
214
  return available_modules
204
215
 
205
216
 
206
- # Used to avoid repeatedly calling Sync.list_intel_modules()
207
- TOP_LEVEL_MODULES = Sync.list_intel_modules()
208
-
209
-
210
217
  def run_with_config(sync: Sync, config: Union[Config, argparse.Namespace]) -> int:
211
218
  """
212
219
  Execute the cartography.sync.Sync.run method with parameters built from the given configuration object.