-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathyyy_d_Disable_Event_Logging.json
More file actions
321 lines (321 loc) · 16 KB
/
yyy_d_Disable_Event_Logging.json
File metadata and controls
321 lines (321 loc) · 16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
{
"flows": [
{
"name": "yyy_d_Disable_Event_Logging",
"nodes": [
{
"id": "d5108168-3c00-4dd3-91a0-c429c5db96b8",
"name": "Disable_Event_Logging",
"kind": "eventType",
"isLeaf": false,
"eventType": "eventType-23",
"warnings": [],
"description": "",
"isExplainable": true,
"x": 0,
"y": 0,
"vertices": [],
"isEditable": false,
"isStepImplementable": true,
"executionDependsOn": [],
"outputtedNode": false,
"contentItemIdentifier": {
"kind": "EventTypeContentKind",
"id": "eventType-23"
},
"categoryKind": "FetchData",
"linkToTrigger": true,
"iconTitle": "Fetch Data: Disable_Event_Logging",
"usedByEventTypes": []
},
{
"id": "77ebed55-81a2-4ed7-9aa0-30ecc1662cf8",
"name": "Key_Columns",
"kind": "augmentation",
"lql": "`select lhub_ts, src_machine,Security_ID, Account_Name, Account_Domain, Logon_ID, Category, Subcategory, Subcategory_GUID, Changes from Disable_Event_Logging`",
"operator": "SELECT",
"isLeaf": false,
"warnings": [],
"description": "",
"isExplainable": true,
"x": 0,
"y": 112,
"vertices": [],
"isEditable": false,
"isStepImplementable": true,
"executionDependsOn": [],
"outputtedNode": false,
"formType": "LQLEditor",
"categoryKind": "Code",
"iconTitle": "Code: SQL",
"usedByEventTypes": []
},
{
"id": "c45bc093-1e26-4fac-ba4a-3eb09fe41e9b",
"name": "Final_Output",
"kind": "augmentation",
"lql": "`select * from LogicHub_MDR_Format_Alert_for_Sumo`",
"operator": "SELECT",
"isLeaf": false,
"warnings": [],
"description": "",
"isExplainable": true,
"x": 0,
"y": 506,
"vertices": [],
"isEditable": false,
"isStepImplementable": true,
"executionDependsOn": [],
"outputtedNode": true,
"formType": "LQLEditor",
"categoryKind": "Code",
"iconTitle": "Code: SQL",
"usedByEventTypes": []
},
{
"id": "93633196-3ffb-4db2-9543-fc24ff6babed",
"name": "Output",
"kind": "output",
"warnings": [],
"description": "",
"nodes": [
"c45bc093-1e26-4fac-ba4a-3eb09fe41e9b"
],
"isExplainable": true,
"x": 0,
"y": 618,
"vertices": [],
"isEditable": false,
"isStepImplementable": true,
"executionDependsOn": [],
"outputtedNode": false,
"categoryKind": "Unknown",
"iconTitle": "Unknown",
"usedByEventTypes": []
},
{
"id": "89a15546-d7f2-4f43-b47c-e4eb28793a1d",
"name": "Create_Output",
"kind": "augmentation",
"lql": "`select lhub_ts AS alert_time, \n\"LH00170\" AS alert_id, \n\"Disable Event Logging\" AS alert_title, \n\"Indicator Blocking\" AS technique, \n\"Defense Evasion\" AS tactic, \n1 as fidelity_score,\n2 as risk_score,\n2 as lhub_score,\nTO_JSON(STRUCT(Security_ID, Logon_ID, Category, Subcategory, Subcategory_GUID, Changes)) AS additional_data, \nAccount_Name as src_user, \" \" AS src_ip, \n'' AS dest_ip, \nsrc_machine AS src_machine_name, \n'' AS dest_machine_name from Key_Columns`",
"operator": "SELECT",
"isLeaf": false,
"warnings": [],
"description": "",
"isExplainable": true,
"x": 0,
"y": 224,
"vertices": [],
"isEditable": false,
"isStepImplementable": true,
"executionDependsOn": [],
"outputtedNode": false,
"formType": "LQLEditor",
"categoryKind": "Code",
"iconTitle": "Code: SQL",
"usedByEventTypes": []
},
{
"id": "63f000b9-9cbf-4c7b-bc82-f4f78d7eef0e",
"name": "LogicHub_MDR_Format_Alert_for_Sumo",
"kind": "step",
"inputs": [
"89a15546-d7f2-4f43-b47c-e4eb28793a1d"
],
"isLeaf": false,
"warnings": [],
"description": "Format event output to send to SumoLogic destination",
"isExplainable": true,
"x": 0,
"y": 336,
"vertices": [],
"title": "LogicHub MDR: Format Alert for Sumo",
"moduleId": "logichub.mdr.format_alert_for_sumo",
"moduleVersion": {
"majorVersion": 1,
"minorVersion": 31,
"patchVersion": 0,
"contentResourceVersionBranch": "Local"
},
"moduleParameters": {
"parent0": "Create_Output"
},
"stepParams": {
"kind": "module",
"title": "LogicHub MDR: Format Alert for Sumo"
},
"isEditable": true,
"isStepImplementable": false,
"executionDependsOn": [],
"contentMetadata": {
"id": "logichub.mdr.format_alert_for_sumo",
"name": "LogicHub MDR: Format Alert for Sumo",
"latestAvailableVersion": {
"majorVersion": 1,
"minorVersion": 31,
"patchVersion": 0,
"contentResourceVersionBranch": "Local"
}
},
"outputtedNode": false,
"contentItemIdentifier": {
"kind": "ModuleContentKind",
"id": "logichub.mdr.format_alert_for_sumo"
},
"categoryKind": "Module",
"iconTitle": "Module: LogicHub MDR: Format Alert for Sumo",
"usedByEventTypes": []
}
],
"oldId": "flow-1030",
"listNames": [],
"dependentCommands": [],
"resourceFormatVersion": 2,
"fileDataSeq": []
}
],
"baselines": [],
"eventTypes": [
{
"id": "eventType-23",
"data": {
"name": "Disable_Event_Logging",
"query": "_sourceCategory=server/windows/events* event_id=\"4719\" AND (\"removed\")\n| parse \"Computer = \\\"*\\\";\" as src_machine\n| parse \"Security ID:\\t\\t*\\r\\n\" as Security_ID nodrop\n| parse \"Account Name:\\t\\t*\\r\\n\" as Account_Name nodrop\n| parse \"Account Domain:\\t\\t*\\r\\n\" as Account_Domain nodrop\n| parse \"Logon ID:\\t\\t*\\r\\n\" as Logon_ID nodrop\n| parse \"Category:\\t\\t*\\r\\n\" as Category nodrop\n| parse \"Subcategory:\\t\\t*\\r\\n\" as Subcategory nodrop\n| parse \"Subcategory GUID:\\t*\\r\\n\" as Subcategory_GUID nodrop\n| parse \"Changes:\\t\\t*\\\";\" as Changes nodrop",
"keyColumns": "lhub_ts,_blockid,_collector,_collectorid,_format,_messagecount,_messageid,_messagetime,_raw,_receipttime,_size,_source,_sourcecategory,_sourcehost,_sourceid,_sourcename,_view,category,event_id,msg_summary,src_machine,_some_matched,security_id,account_name,account_domain,logon_id,subcategory,subcategory_guid,changes",
"connection": "connection-2",
"connectionTypeEntities": {
"entities": [
{
"connectionType": {
"connectionType": "sumologic",
"value": "query"
},
"connectionTypeDetail": {
"query": "_sourceCategory=server/windows/events* event_id=\"4719\" AND (\"removed\")\n| parse \"Computer = \\\"*\\\";\" as src_machine\n| parse \"Security ID:\\t\\t*\\r\\n\" as Security_ID nodrop\n| parse \"Account Name:\\t\\t*\\r\\n\" as Account_Name nodrop\n| parse \"Account Domain:\\t\\t*\\r\\n\" as Account_Domain nodrop\n| parse \"Logon ID:\\t\\t*\\r\\n\" as Logon_ID nodrop\n| parse \"Category:\\t\\t*\\r\\n\" as Category nodrop\n| parse \"Subcategory:\\t\\t*\\r\\n\" as Subcategory nodrop\n| parse \"Subcategory GUID:\\t*\\r\\n\" as Subcategory_GUID nodrop\n| parse \"Changes:\\t\\t*\\\";\" as Changes nodrop",
"connection": "connection-2"
}
}
]
},
"defaultConnectionType": {
"connectionType": "sumologic",
"value": "query"
}
}
}
],
"connections": [
{
"id": "connection-2",
"data": {
"connectionType": "sumologic",
"name": "SumoLogic",
"isActive": false,
"account": "",
"secret": "",
"url": "https://api.us2.sumologic.com/api/v1"
}
}
],
"modules": [
{
"id": "logichub.mdr.format_alert_for_sumo",
"name": "LogicHub MDR: Format Alert for Sumo",
"description": "Format event output to send to a SumoLogic destination",
"templateNodes": [
{
"name": "alert_output_for_sumo",
"templateLQL": "`SELECT \n/* always include lhub_score in the final output */\nlhub_score,\n\n/* format the final JSON output */\nTO_JSON(STRUCT(\n\n/* Required/Standard fields first */\nlhub_score, alert_time,\nlh_batch_end, lh_batch_id, lh_hostname, lh_alert_id,\nalert_id, alert_type, technique, tactic, risk_score, fidelity_score,\n\n/* All other fields EXCEPT additional_data */\nattack_chain, dest_ip, dest_machine_name, dest_machine_fqdn, dest_nt_domain, dest_port, dest_user, src_ip, src_machine_name, src_machine_fqdn, src_nt_domain, src_port, src_user,\n\n/* place additional_data last so it will be at the bottom of the JSON formatted output */\nadditional_data)) AS alert_output\nFROM validate_required_input`",
"isOutput": true
},
{
"name": "ensure_defined_fields_exist",
"templateLQL": "ensureTableHasColumns(comment_ensure_table_has_columns, \"lhub_score, lhub_ts, alert_title, alert_time, alert_id, alert_type, technique, tactic, risk_score, fidelity_score, additional_data, attack_chain, dest_ip, dest_machine_name, dest_machine_fqdn, dest_nt_domain, dest_port, dest_user, src_ip, src_machine_name, src_machine_fqdn, src_nt_domain, src_port, src_user\")",
"isOutput": false
},
{
"name": "final_columns",
"templateLQL": "`SELECT \n/* Required/standard fields first */\nlh__new_score AS lhub_score,\nlh__new_ts AS lhub_ts,\nlh__new_ts AS alert_time,\nlh_batch_end, lh_batch_id, lh_hostname, lh_alert_id,\nalert_id,\n\n/* Legacy support for \"alert_title\" which is now called \"alert_type\" */\nCOALESCEEMPTY(alert_type, alert_title) AS alert_type,\n\ntechnique, tactic, risk_score, fidelity_score,\n\n/* All other supported fields */\nadditional_data, attack_chain, dest_ip, dest_machine_name, dest_machine_fqdn, dest_nt_domain, dest_port, dest_user, src_ip, src_machine_name, src_machine_fqdn, src_nt_domain, src_port, src_user\n\nFROM calculate_new_score_and_time`",
"isOutput": false
},
{
"name": "add_batch_metadata",
"templateLQL": "addExecutionMetadata(ensure_defined_fields_exist)",
"isOutput": false
},
{
"name": "calculate_new_score_and_time",
"templateLQL": "`SELECT \n/* If lhub_score = 0, keep it 0, otherwise use the greater of the original value or risk times fidelity */\nCASE DOUBLE(lhub_score) WHEN 0 THEN DOUBLE(lhub_score) ELSE GREATEST(risk_score * fidelity_score, DOUBLE(lhub_score)) END AS lh__new_score,\n\n/* For timestamp, look first for alert_time, then lhub_ts, then batch end time */\nCASE\n WHEN BIGINT(alert_time) IS NOT NULL THEN BIGINT(alert_time)\n WHEN BIGINT(lhub_ts) IS NOT NULL THEN BIGINT(lhub_ts) ELSE BIGINT(GET_JSON_OBJECT(lhub_execution_metadata, \"$.interval_end_millis\"))\nEND AS lh__new_ts,\n\nREGEXP_EXTRACT(GET_JSON_OBJECT(lhub_execution_metadata, \"$.batch_url\"), '://(.*?)/') AS lh_hostname,\nREGEXP_EXTRACT(GET_JSON_OBJECT(lhub_execution_metadata, \"$.batch_url\"), '(batch-\\\\d+)$') AS lh_batch_id,\nBIGINT(GET_JSON_OBJECT(lhub_execution_metadata, \"$.interval_end_millis\")) AS lh_batch_end,\n\n/* Generate a unique (mostly) event ID from the batch number + lhub_id */\nBIGINT(PRINTF('%s%s', REGEXP_EXTRACT(GET_JSON_OBJECT(lhub_execution_metadata, \"$.batch_url\"), 'batch-(\\\\d+)$'), lhub_id)) AS lh_alert_id,\n*\nFROM add_batch_metadata`",
"isOutput": false
},
{
"name": "comment_ensure_table_has_columns",
"templateLQL": "`\n/* Since some columns are only conditionally required, there has to be a step to explicitly check for values in those fields anyway, so to keep it simple, all possible fields are protected in ensureTableHasColumns, and some are validated later to ensure that they have a value.\n\nFields supported but not part of the final JSON schema:\n- lhub_score - can be used to override final score\n- lhub_ts - when available, used to calculate alert_time\n- alert_title - legacy support, but since renamed to alert_type\n\nNot expected from input but allowed when available:\n- alert_time: calculated from lhub_ts or batch time, but if this is available then we'll accept it as truth\n\nAfter that, ALL SUPPORTED FIELDS from supported schema\nhttps://logichub.atlassian.net/wiki/spaces/CON/pages/797671425/Output+Schema+for+LogicHub+Content\n*/\n\nselect * from %%%parent0%%%`",
"isOutput": false
},
{
"name": "check_for_required_fields",
"templateLQL": "`/*\nOnce all calculations are done, verify that all the required fields have values.\nNote that some fields allow empty strings for the time being, as long as they aren't null. This is just to allow us to transition into this new alert schema while we figure it all out.\n*/\n\nSELECT *,\nCASE\n /* array_sort will put nulls at the end, so this is a quick way to check all required inputs at once */\n WHEN ELEMENT_AT(ARRAY_SORT(ARRAY(alert_id, alert_type, technique, tactic, risk_score, fidelity_score)), -1) IS NULL THEN 'One or more required inputs is missing or null. Required fields: alert_id, alert_type, technique, tactic, risk_score, fidelity_score'\n WHEN TRIM(alert_id) = '' THEN 'alert_id cannot be empty'\n WHEN TRIM(alert_type) = '' THEN 'alert_type cannot be empty'\n WHEN risk_score NOT IN (1, 2, 3) THEN PRINTF('Invalid value for risk_score (%s). Acceptable values are from 1 (low), 2 (medium) and 3 (high).', risk_score)\n WHEN fidelity_score NOT IN (1, 2, 3) THEN PRINTF('Invalid value for fidelity_score (%s). Acceptable values are from 1 (low), 2 (medium) and 3 (high).', fidelity_score)\n WHEN FLOAT(lhub_score) IS NULL THEN 'Unable to calculate lhub_score from provided columns'\n WHEN lhub_score > 10 OR lhub_score < 0 THEN PRINTF('Invalid value for lhub_score (%s). Acceptable values are from 0-10.', lhub_score)\nEND AS error\n\nFROM final_columns`",
"isOutput": false
},
{
"name": "validate_required_input",
"templateLQL": "forceFail(check_for_required_fields, \"error\")",
"isOutput": false
}
],
"steps": [
{
"name": "Module Parameters",
"description": "",
"inputs": [
{
"id": "parent0",
"description": "Parent node",
"label": "Parent Node",
"dataType": "node",
"inputType": "columnSelect",
"dependsOn": "",
"columnTemplating": false
}
],
"isVariadic": false
}
],
"isPublished": true,
"author": "chad@logichub.com",
"categories": [],
"isEditable": true,
"integrations": [],
"innerModules": [],
"tags": [],
"moduleVersion": {
"majorVersion": 1,
"minorVersion": 31,
"patchVersion": 0,
"contentResourceVersionBranch": "Local"
},
"isDataSource": "No",
"resourceFormatVersion": 3,
"weight": 0
}
],
"annotations": [],
"filters": [],
"ruleSets": [],
"integrationInstances": [],
"customLists": [],
"streams": [],
"dashboards": [],
"images": [],
"codeBlobs": {},
"customListsData": {},
"executionScripts": [],
"userForms": [],
"flowNodeReferences": [],
"destinations": [],
"fileResources": [],
"fileDataSeq": [],
"eventModels": [],
"version": 1
}