Skip to content

Commit 7925f0d

Browse files
committed
Add KQL query for ZeroFox CCF
1 parent d9c14bc commit 7925f0d

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

Solutions/ZeroFox/Data Connectors/Alerts/ZeroFoxAlerts_ConnectorDefinition.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
{
4848
"type": "IsConnectedQuery",
4949
"value": [
50-
"ZeroFoxAlertPoller_CL\n | summarize LastLogReceived = max(TimeGenerated)\n | project IsConnected = LastLogReceived > ago(3d)",
5150
"ZeroFoxAlertPoller_CL\n | summarize LastLogReceived = max(TimeGenerated)\n | project IsConnected = LastLogReceived > ago(3d)"
5251
]
5352
}

Solutions/ZeroFox/Data Connectors/Alerts/ZeroFoxAlerts_DCR.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"properties": {
77
"dataCollectionEndpointId": "{{dataCollectionEndpointId}}",
88
"streamDeclarations": {
9-
"Custom-ZeroFoxAlertsPoller_CL": {
9+
"Custom-ZeroFoxAlertPoller_CL": {
1010
"columns": [
1111
{
1212
"name": "alert_type",
@@ -162,12 +162,12 @@
162162
"dataFlows": [
163163
{
164164
"streams": [
165-
"Custom-ZeroFoxAlertsPoller_CL"
165+
"Custom-ZeroFoxAlertPoller_CL"
166166
],
167167
"destinations": [
168168
"clv2ws1"
169169
],
170-
"transformKql": "source\n| extend TimeGenerated = now()",
170+
"transformKql": "source\n| extend \n entity_id_d = toint(entity.id),\n entity_name_s = tostring(entity.name),\n entity_image_s = tostring(entity.image),\n entity_labels_s = tostring(entity.labels),\n entity_entity_group_id_d = toint(entity.entity_group_id),\n entity_entity_group_name_s = tostring(entity.entity_group_name),\n entity_term_s = tostring(entity.term),\n entity_account_s = tostring(entity.account),\n entity_email_receiver_id_s = tostring(entity.email_receiver_id),\n perpetrator_name_s = tostring(perpetrator.name),\n perpetrator_display_name_s = tostring(perpetrator.display_name),\n perpetrator_id_d = toint(perpetrator.id),\n perpetrator_url_s = tostring(perpetrator.url),\n perpetrator_content_s = tostring(perpetrator.content),\n perpetrator_type_s = tostring(perpetrator.type),\n perpetrator_timestamp_t = todatetime(perpetrator.timestamp),\n perpetrator_network_s = tostring(perpetrator.network),\n asset_id_d = toint(asset.id),\n asset_name_s = tostring(asset.name),\n asset_image_s = tostring(asset.image),\n asset_labels_s = tostring(asset.labels),\n asset_entity_group_id_d = toint(asset.entity_group_id),\n asset_entity_group_name_s = tostring(asset.entity_group_name),\n id_d = toint(id),\n Severity = toint(severity),\n rule_group_id_d = toint(rule_group_id),\n reviewed_b = tobool(reviewed),\n escalated_b = tobool(escalated),\n rule_id_d = toint(rule_id),\n last_modified_t = last_modified\n | project-rename \n TimeGenerated = last_modified,\n alert_type_s = alert_type,\n logs_s = logs,\n offending_content_url_s = offending_content_url,\n asset_term_s = asset_term,\n assignee_s = assignee,\n content_created_at_t = content_created_at,\n entered_by_s = entered_by,\n metadata_s = metadata,\n status_s = status,\n rule_name_s = rule_name,\n protected_locations_s = protected_locations,\n darkweb_term_s = darkweb_term,\n business_network_s = business_network,\n network_s = network,\n protected_social_object_s = protected_social_object,\n notes_s = notes,\n reviews_s = reviews,\n tags_s = tags\n| project TimeGenerated, alert_type_s, logs_s, offending_content_url_s, asset_term_s, assignee_s, entity_id_d, entity_name_s, entity_image_s, entity_labels_s, entity_entity_group_id_d, entity_entity_group_name_s, entity_term_s, content_created_at_t, id_d, Severity, perpetrator_name_s, perpetrator_display_name_s, perpetrator_id_d, perpetrator_url_s, perpetrator_content_s, perpetrator_type_s, perpetrator_timestamp_t, perpetrator_network_s, rule_group_id_d, asset_id_d, asset_name_s, asset_image_s, asset_labels_s, asset_entity_group_id_d, asset_entity_group_name_s, entered_by_s, metadata_s, status_s, rule_name_s, last_modified_t, protected_locations_s, darkweb_term_s, business_network_s, reviewed_b, escalated_b, network_s, protected_social_object_s, notes_s, reviews_s, rule_id_d, entity_account_s, entity_email_receiver_id_s, tags_s",
171171
"outputStream": "Custom-ZeroFoxAlertPoller_CL"
172172
}
173173
]

Solutions/ZeroFox/Package/mainTemplate.json

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@
835835
"resources": [
836836
{
837837
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/',variables('_dataConnectorContentIdConnectorDefinition2'))]",
838-
"apiVersion": "2022-09-01-preview",
838+
"apiVersion": "2025-09-01",
839839
"type": "Microsoft.OperationalInsights/workspaces/providers/dataConnectorDefinitions",
840840
"location": "[parameters('workspace-location')]",
841841
"kind": "Customizable",
@@ -877,7 +877,6 @@
877877
{
878878
"type": "IsConnectedQuery",
879879
"value": [
880-
"ZeroFoxAlertPoller_CL\n | summarize LastLogReceived = max(TimeGenerated)\n | project IsConnected = LastLogReceived > ago(3d)",
881880
"ZeroFoxAlertPoller_CL\n | summarize LastLogReceived = max(TimeGenerated)\n | project IsConnected = LastLogReceived > ago(3d)"
882881
]
883882
}
@@ -975,14 +974,14 @@
975974
},
976975
{
977976
"name": "AlertsDCR",
978-
"apiVersion": "2022-06-01",
977+
"apiVersion": "2024-03-11",
979978
"type": "Microsoft.Insights/dataCollectionRules",
980979
"location": "[parameters('workspace-location')]",
981980
"kind": "[variables('blanks')]",
982981
"properties": {
983982
"dataCollectionEndpointId": "[variables('dataCollectionEndpointId2')]",
984983
"streamDeclarations": {
985-
"Custom-ZeroFoxAlertsPoller_CL": {
984+
"Custom-ZeroFoxAlertPoller_CL": {
986985
"columns": [
987986
{
988987
"name": "alert_type",
@@ -1138,20 +1137,20 @@
11381137
"dataFlows": [
11391138
{
11401139
"streams": [
1141-
"Custom-ZeroFoxAlertsPoller_CL"
1140+
"Custom-ZeroFoxAlertPoller_CL"
11421141
],
11431142
"destinations": [
11441143
"clv2ws1"
11451144
],
1146-
"transformKql": "source\n| extend TimeGenerated = now()",
1145+
"transformKql": "source\n| extend \n entity_id_d = toint(entity.id),\n entity_name_s = tostring(entity.name),\n entity_image_s = tostring(entity.image),\n entity_labels_s = tostring(entity.labels),\n entity_entity_group_id_d = toint(entity.entity_group_id),\n entity_entity_group_name_s = tostring(entity.entity_group_name),\n entity_term_s = tostring(entity.term),\n entity_account_s = tostring(entity.account),\n entity_email_receiver_id_s = tostring(entity.email_receiver_id),\n perpetrator_name_s = tostring(perpetrator.name),\n perpetrator_display_name_s = tostring(perpetrator.display_name),\n perpetrator_id_d = toint(perpetrator.id),\n perpetrator_url_s = tostring(perpetrator.url),\n perpetrator_content_s = tostring(perpetrator.content),\n perpetrator_type_s = tostring(perpetrator.type),\n perpetrator_timestamp_t = todatetime(perpetrator.timestamp),\n perpetrator_network_s = tostring(perpetrator.network),\n asset_id_d = toint(asset.id),\n asset_name_s = tostring(asset.name),\n asset_image_s = tostring(asset.image),\n asset_labels_s = tostring(asset.labels),\n asset_entity_group_id_d = toint(asset.entity_group_id),\n asset_entity_group_name_s = tostring(asset.entity_group_name),\n id_d = toint(id),\n Severity = toint(severity),\n rule_group_id_d = toint(rule_group_id),\n reviewed_b = tobool(reviewed),\n escalated_b = tobool(escalated),\n rule_id_d = toint(rule_id),\n last_modified_t = last_modified\n | project-rename \n TimeGenerated = last_modified,\n alert_type_s = alert_type,\n logs_s = logs,\n offending_content_url_s = offending_content_url,\n asset_term_s = asset_term,\n assignee_s = assignee,\n content_created_at_t = content_created_at,\n entered_by_s = entered_by,\n metadata_s = metadata,\n status_s = status,\n rule_name_s = rule_name,\n protected_locations_s = protected_locations,\n darkweb_term_s = darkweb_term,\n business_network_s = business_network,\n network_s = network,\n protected_social_object_s = protected_social_object,\n notes_s = notes,\n reviews_s = reviews,\n tags_s = tags\n| project TimeGenerated, alert_type_s, logs_s, offending_content_url_s, asset_term_s, assignee_s, entity_id_d, entity_name_s, entity_image_s, entity_labels_s, entity_entity_group_id_d, entity_entity_group_name_s, entity_term_s, content_created_at_t, id_d, Severity, perpetrator_name_s, perpetrator_display_name_s, perpetrator_id_d, perpetrator_url_s, perpetrator_content_s, perpetrator_type_s, perpetrator_timestamp_t, perpetrator_network_s, rule_group_id_d, asset_id_d, asset_name_s, asset_image_s, asset_labels_s, asset_entity_group_id_d, asset_entity_group_name_s, entered_by_s, metadata_s, status_s, rule_name_s, last_modified_t, protected_locations_s, darkweb_term_s, business_network_s, reviewed_b, escalated_b, network_s, protected_social_object_s, notes_s, reviews_s, rule_id_d, entity_account_s, entity_email_receiver_id_s, tags_s",
11471146
"outputStream": "Custom-ZeroFoxAlertPoller_CL"
11481147
}
11491148
]
11501149
}
11511150
},
11521151
{
11531152
"name": "ZeroFoxAlertPoller_CL",
1154-
"apiVersion": "2022-10-01",
1153+
"apiVersion": "2025-07-01",
11551154
"type": "Microsoft.OperationalInsights/workspaces/tables",
11561155
"location": "[parameters('workspace-location')]",
11571156
"kind": null,
@@ -1426,7 +1425,7 @@
14261425
},
14271426
{
14281427
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/',variables('_dataConnectorContentIdConnectorDefinition2'))]",
1429-
"apiVersion": "2022-09-01-preview",
1428+
"apiVersion": "2025-09-01",
14301429
"type": "Microsoft.OperationalInsights/workspaces/providers/dataConnectorDefinitions",
14311430
"location": "[parameters('workspace-location')]",
14321431
"kind": "Customizable",
@@ -1468,7 +1467,6 @@
14681467
{
14691468
"type": "IsConnectedQuery",
14701469
"value": [
1471-
"ZeroFoxAlertPoller_CL\n | summarize LastLogReceived = max(TimeGenerated)\n | project IsConnected = LastLogReceived > ago(3d)",
14721470
"ZeroFoxAlertPoller_CL\n | summarize LastLogReceived = max(TimeGenerated)\n | project IsConnected = LastLogReceived > ago(3d)"
14731471
]
14741472
}
@@ -1642,7 +1640,7 @@
16421640
},
16431641
{
16441642
"name": "[[concat(parameters('innerWorkspace'),'/Microsoft.SecurityInsights/', 'ZeroFoxAlertsPoller', parameters('guidValue'))]",
1645-
"apiVersion": "2023-02-01-preview",
1643+
"apiVersion": "2025-09-01",
16461644
"type": "Microsoft.OperationalInsights/workspaces/providers/dataConnectors",
16471645
"location": "[parameters('workspace-location')]",
16481646
"kind": "RestApiPoller",
@@ -1760,8 +1758,8 @@
17601758
"entityType": "Account",
17611759
"fieldMappings": [
17621760
{
1763-
"columnName": "entity_name_s",
1764-
"identifier": "FullName"
1761+
"identifier": "FullName",
1762+
"columnName": "entity_name_s"
17651763
}
17661764
]
17671765
}
@@ -1870,8 +1868,8 @@
18701868
"entityType": "Account",
18711869
"fieldMappings": [
18721870
{
1873-
"columnName": "entity_name_s",
1874-
"identifier": "FullName"
1871+
"identifier": "FullName",
1872+
"columnName": "entity_name_s"
18751873
}
18761874
]
18771875
}
@@ -1980,8 +1978,8 @@
19801978
"entityType": "Account",
19811979
"fieldMappings": [
19821980
{
1983-
"columnName": "entity_name_s",
1984-
"identifier": "FullName"
1981+
"identifier": "FullName",
1982+
"columnName": "entity_name_s"
19851983
}
19861984
]
19871985
}
@@ -2090,8 +2088,8 @@
20902088
"entityType": "Account",
20912089
"fieldMappings": [
20922090
{
2093-
"columnName": "entity_name_s",
2094-
"identifier": "FullName"
2091+
"identifier": "FullName",
2092+
"columnName": "entity_name_s"
20952093
}
20962094
]
20972095
}

0 commit comments

Comments
 (0)