forked from wagov/WASOCAutomationPlaybook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCollatedDeployment.json
5329 lines (5329 loc) · 351 KB
/
CollatedDeployment.json
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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"existingWorkspaceName": {
"type": "string",
"metadata": {
"description": "The name of the Sentinel workspace where the automation rule will be deployed"
}
}
},
"resources": [
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "dd2d345e-f6c2-44d9-91ba-6aa502710690",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - Dynamics 365 - User Bulk Retrieval Outside Normal Activity",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','59a1c412-43aa-4405-89bc-bd5358c4341d')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Extract relevant values from incident entities",
"description": "<div>Values such as the <strong>UserId, IPs</strong> and <strong>UserAgents</strong> will likely be relevant in developing an accurate conclusion.</div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Enrich UserIPAddress",
"description": "<div><strong>The enrichment services listed are only suggestions, there are many other potential sources. The suggested sources are not required to be used.</strong></div><ul><li>Is this IP known to your organisation?</li><li>Is the IP in from a location you would expect to see from your users?</li><li>Do threat intelligence sources list the IP as known to be malicious? (suggested sources: AbuseIPDB, VirusTotal)</li></ul><div><strong>\ufeff</strong></div>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Review UserId account sign-ins for suspicious activity",
"description": null
}
},
{
"order": 4,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Confirm if suspicious activity is expected and approved",
"description": "<ul><li>Is this activity expected and approved?</li><li>Confirm if user's are responsible for the bulk retrieval and/or suspicious logins (It is recommended not to contact the user directly to avoid a scenario of a threat actor with control of the account replying with incorrect information. A common method is to instead contact the user's manager).</li></ul>"
}
},
{
"order": 5,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Remediate (if required)",
"description": "<div><strong>If there was unauthorised logins or rule creation, possible actions may include:</strong></div><ul><li>Reset user credentials.</li><li>Revoke active sessions.</li><li>Review account activity across relevant services after the breach occurred and remediate as required.</li></ul>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "a54af85c-f18c-4d76-9034-87efab0b4b1d",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - User agent search for log4j exploitation attempt",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','0cb768af-eb6b-4774-970e-a52dd3f337be')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Review alert details",
"description": "<div>Access the alert in KQL by selecting the 'Alerts' under the 'Evidence' heading.</div><div><img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAcCAYAAACdz7SqAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgA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ZuVYaNC/yM8tJs6J+WMEj0H6/n42n3Ao4fTA4P0Kgz2lCThi93Agp6c7hmPrYMayLQ1NFBhBc66/re7NeQTNJtKrHeHEwdicIKSO2CGEtgmKPQ9GpkAbRlEZNtuJgFR0W8h0LpiDbc2mh1O4p5craDEuaT+R9/K/4C2+ImlxxiJc4AAAAASUVORK5CYII=\"></div><div>An instance of the Log Analytics workspace will appear with a query to show the alert.</div><div><br></div><div><br></div><div><br></div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Investigate",
"description": "<ul><li>Extract the entity details from the alert.</li><li>Check all the activities that are associated with the identified entities, such as UserAgent and IP address(s).</li><li>Use the following KQL as a template</li></ul><pre spellcheck=\"false\">AzureDiagnostics\n|where TimeGenerated between (todatetime('yyyy-mm-ddT00:00:00.000Z')..todatetime('yyyy-mm-ddT00:00:00.000Z'))\n|where * has \"0.0.0.0\"\n</pre><div><br></div><ul><li>This will show any activity related to the incident including request Uri, message details, hostnames, etc.</li><li>Examine the UserAgent information which is under \u201cdetails_data_s\u201d field.</li><li>Perform a lookup on the IP address(s) noted via a tool to determine if it is malicious.</li></ul><div> Following tools can be useful in this scenario.</div><div> o VirusTotal</div><div> o AbuseIPDB</div><div> o IPQualityScore</div><div><br></div>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Close or Escalate",
"description": "<ul><li>If the IP address is malicious or the UserAgent is not known, follow the standard operating procedures for handling suspicious activities, such as</li></ul><div> o Confirming with the relevant teams if the activity is approved/expected.</div><div> o Blocking any IP addresses that are found malicious.</div><div> o If found malicious, revoking any active sessions.</div><div><br></div>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "e71fd4cf-9e08-4404-a2e7-9f6b314f9db2",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - Rare RDP Connections",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','8fffceed-6f16-42ac-aff2-3d2c02a9c732')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Gather Entity details",
"description": "<div><span style=\"background-color: rgb(255, 255, 255);\">Check the entities to gather details of the devices/hostnames, IP address(s) and account names involved in the RDP activity. </span></div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Check the IP address of the source ",
"description": "<ul><li>Use IP database to verify the IP address or to determine if it is malicious. </li></ul><div><br></div><div><br></div><div><br></div><pre spellcheck=\"false\">SecurityEvent \n|where TimeGenerated between ((todatetime('2022-11-14T23:25:10.3951708Z')-5m)..(todatetime('2022-11-28T23:25:10.3951708Z')+5m)) \n|where * has \"<accountName>\" and * has \"<hostName>\" and * has \"<IP address>\" \n|summarize count(), make_set(IpAddress) by Computer, TargetUserName, TargetServerName, Process, Activity \n</pre>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Check the source and activity ",
"description": "<ul><li>If the IP address is local and account name is known or identifiable, verify with the account user of the activity. </li><li>If the activity is a successful logon event and source is unknown, escalate the incident for further investigation. </li></ul><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><ul><li>Following KQL can be used to identify the user's details.</li></ul><pre spellcheck=\"false\">IdentityInfo\n|where * has \"<accountName>\"\n</pre>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "e7141384-de23-411b-bc95-4cc8378cfa25",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - Attempts to sign in to disabled accounts",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','37f068ad-9155-4afe-a1fd-09a377aadf81')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Query and review each account's recent sign-in activity",
"description": "<div><strong>Using the previously recorded accounts, use a KQL query to investigate the account's recent sign-in activity.</strong></div><div>An example query template (read each line to understand what it does):</div><pre spellcheck=\"false\">SigninLogs //Replace with AADNonInteractiveUserSignInLogs to see automatic sign ins (Applications)\n| where TimeGenerated > ago(1d) // Change lookback time as required \n| where UserPrincipalName in (\"[UPN]\") // For use when filtering by users (comma seperated list)\n//| where IPAddress in (\"[IP]\")//Pivot on IP\n| where ResultType !in (\"50126\", \"50053\", \"530031\") // Remove login attempts with incorrect credentials or auto blocked IPs\n| extend AuthStep_1 = tostring(parse_json(AuthenticationDetails)[0].authenticationMethod) // Used to discover password authentication attempts\n| extend AuthSuccess_1 = tostring(parse_json(AuthenticationDetails)[0].succeeded) // Used to determine if password authentication succeeded\n| where (AuthStep_1 in (\"Password\") and AuthSuccess_1 in (\"true\")) or ResultType in (\"0\", \"53003\", \"50076\") // Only show logins that succeeded or had correct credentials \n| summarize count() by TimeGenerated, UserPrincipalName, IPAddress, Location, ResultType, ResultDescription\n| sort by TimeGenerated desc\n</pre><div>Note: Sign-ins that failed on CAP or MFA suggests first stage authentication (such as password) was successful and <em>may</em> be an indication of compromised credentials.</div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Determine if attempts are malicious",
"description": "<div>Based on the results from the previous query, determine if the attempts are from a malicious actor or from an application (like Teams or Outlook) on the device that the user of the disabled account was signed in on. If the attempts are malicious, pivot on the IP to determine if there are any successful sign ins from said IP.</div>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Remediate (if necessary)",
"description": "<div><strong>If there was unauthorised logins, possible actions may include:</strong></div><div><strong><span class=\"ql-cursor\">\ufeff</span></strong></div><ul><li>Reset user credentials.</li><li>Revoke active sessions.</li><li>Review account activity across relevant services after the breach occurred.</li></ul><div><br></div>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "65b75d97-0be9-4047-a2c4-482a0939024c",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - User login from different countries within 3 hours (Uses Authentication Normalization)",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','b279d270-77fb-4915-838d-b8f1ecbd9f88')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Review the incident entities and extract account(s)",
"description": "<div>Access the alert in KQL by selecting the 'Alerts' under the 'Evidence' heading</div><div><img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAA1CAYAAAAK0RhzAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAANqADAAQAAAABAAAANQAAAAC041R0AAAGMUlEQVRoBe1Ze2xTVRj/FYbrClvZ6B48JSgT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9JhS5gi/fUYsb2Slx0hu7aK5q8OG+VYsLx0S92/HvFG1PZaIWEgRFbZy61wmwciO2n7dHq1JX3wtd1qLKHDpSuCjSMhdexbWV25GQZ8fhkM94+bsMbD2ZAa8dz4M9mvHPChhZvAEtyzVg3y8JtNxyyYvIII0rLW1h3DLC5faD3vPWH6jGJ1f3x4pEoq2nFRnYYW+NoQ+5wI/YtHaXR9ehqIcbo7GLnT3Y8f28qnpoyFFfcfhz5L/Kx2lfnr2LRpzWYNsaExyaZ8ep3DTjwVzPvxTcsfWL/JbgY4Ok3J+Hh24Zw/dTRJjxwy2C2kW7HrB2VmJiZyHYx6UhMiH2vKMTY9/+0wOnxYzljayhzxVljTdh66grm3Rp+nF1UasUKBv7N+fLu/kKjhM9/d2LRHfIhKzH2xfLRweFe8209Cu9M4XVdviozeM+oJD4oNDCxihCw935sQsIAA5bureXtVLKYOFHlhoOBJaBqqWhqQ7nNgU/OOoLq4cmdzcwfL7MUzFTdjEhJwPrZFizbV4vX2XeBd/Oz8FC2tr2qaNhtZ4thWbKiibndwb+bsfLuVIxLG8SVxNjGw43YfcaBNTOGhZSkuCAmNy/IDNErD2mm0IEgvfr8ccvCTLw0k22oWZwt3FWNCy+PR7aFHUnolG5jbDcbeSPz9e0Fw/HK3PTgtewuM4jJrkL6D3+24/RFN3/DJjeMtPYp5QjouToPt7W5/Nj7GztbTByAojnp3KShxaeY6kq7Zez9sibu7+SKanlxWhp3tz/qPSGz45Msvj4758T0bZXcnEZ75yMj+P1ANoyhtQCrp6eBZsvNR234dfU4PPPlJT6JUAGKvfvGJPGyen+EvrborZTsyYVpOUhNCne9rvU1SwEQaNMg2YFoA0DrJTHXrWh8bemWsW4r1jCIFEsapkjuAmC0WY5lLXsRvcCQiFQTfzZ9Flh0V9Tw3/jjJ7xHfZaxfmDhZMe3pp+x+OYnvHfyziNc3+s1/wOFTJjvAbfM2gAAAABJRU5ErkJggg==\"></div><div>An instance of the Log Analytics workspace will appear with a query to show the alert.</div><div><br></div><div>To list all users in the alert:</div><pre spellcheck=\"false\">SecurityAlert\n| summarize arg_max(TimeGenerated, *) by SystemAlertId\n| where SystemAlertId in(\"[SystemAlertId]\")\n| mv-expand todynamic(Entities)\n| project UserPrincipalName = tostring(Entities.DisplayName)\n</pre><div>Temporarily store the accounts listed (such as in a text file)</div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Query and review each account's recent sign-in activity",
"description": "<div><strong>Using the previously recorded accounts, use a KQL query to investigate the account's recent sign-in activity.</strong></div><div>An example query template (read each line to understand what it does):</div><pre spellcheck=\"false\">SigninLogs \n| where TimeGenerated > ago(1d) // Change lookback time as required \n| where UserPrincipalName in (\"[UPN]\") // For use when filtering by users (comma seperated list)\n| where ResultType !in (\"50126\", \"50053\", \"530031\") // Remove login attempts with incorrect credentials or auto blocked IPs\n| extend AuthStep_1 = tostring(parse_json(AuthenticationDetails)[0].authenticationMethod) // Used to discover password authentication attempts\n| extend AuthSuccess_1 = tostring(parse_json(AuthenticationDetails)[0].succeeded) // Used to determine if password authentication succeeded\n| where (AuthStep_1 in (\"Password\") and AuthSuccess_1 in (\"true\")) or ResultType in (\"0\", \"53003\", \"50076\") // Only show logins that succeeded or had correct credentials \n| summarize count() by TimeGenerated, UserPrincipalName, IPAddress, Location, ResultType, ResultDescription\n| sort by TimeGenerated desc\n</pre><div>Note: Sign-ins that failed on CAP or MFA suggests first stage authentication (such as password) was successful and <em>may</em> be an indication of compromised credentials.</div>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Identify suspicious sign-in activity",
"description": "<div><strong>Identify suspicious activity by looking for anomalies such as:</strong></div><ul><li>Activity from an unexpected country or region (Refer to TimeGenerated and Location values).</li><li>Unfamiliar IP address.</li><li>Impossible travel.</li><li>Single factor/legacy auth sign-ins should be considered suspicious.</li></ul>"
}
},
{
"order": 4,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Confirm if suspicious activity is expected and approved",
"description": "<div><strong>Confirm if the user is using a VPN or travelling.</strong></div><div>It is recommended not to contact the user directly to avoid a scenario of a threat actor with control of the account replying with incorrect information. A common method is to instead contact the user's manager.</div>"
}
},
{
"order": 5,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Remediate (if required)",
"description": "<div><strong>If there was unauthorised logins, possible actions may include:</strong></div><ul><li>Reset user credentials.</li><li>Revoke active sessions.</li><li>Review account activity across relevant services after the breach occurred.</li></ul>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "bb1e441a-01d9-4bb8-99f5-d7c4184fdc4e",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - Azure AD Role Management Permission Grant",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','5f7b1037-32b5-4efc-b1ee-840a9d976fa8')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Confirm that the service principal should be allowed \"Role Management\" rights",
"description": null
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Remediate (if necessary)",
"description": "<div>Remediation could include:</div><div><br></div><div><br></div><div><br></div><ul><li>Revoking \"Role Management\" privileges for the affected service principal.</li><li>Further investigate how the service principle got compromised</li></ul>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "fa308ec2-3cd1-4839-8cd0-e351820c0ae9",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - M2131_RecommendedDatatableUnhealthy",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','1b522e9d-ab3e-4cbe-9e2b-975d826b4bd2')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Assess Data Table",
"description": "<div>Check whether the listed unhealthy data tables are meant to be seen in current Sentinel environment.</div><ul><li>If the data table(s) are not currently being ingested by design, this rule may become noisy.</li></ul><div> </div><div><br></div><div><br></div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Assess Connectors",
"description": "<div>Check on Data Connector status for the relevant Data Table.</div><ul><li>A list can be found here: <a href=\"https://learn.microsoft.com/en-gb/azure/sentinel/data-connectors-reference#microsoft\" rel=\"noopener noreferrer\" target=\"_blank\">Find your Microsoft Sentinel data connector | Microsoft Learn</a></li></ul><div><br></div><div>If not already configured, Data Connector Health can be monitored, see the following links:</div><ul><li><a href=\"https://learn.microsoft.com/en-us/azure/sentinel/enable-monitoring\" rel=\"noopener noreferrer\" target=\"_blank\">Turn on auditing and health monitoring in Microsoft Sentinel | Microsoft Learn</a></li><li><a href=\"https://learn.microsoft.com/en-us/azure/sentinel/monitor-data-connector-health\" rel=\"noopener noreferrer\" target=\"_blank\">Monitor the health of your Microsoft Sentinel data connectors | Microsoft Learn</a></li></ul>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Assess Context",
"description": "<div>If Data Connectors are meant to be connected but weren't, check the timeframe they were down and any Azure Activity logs at that time. These can be found by going to:</div><ul><li>Sentinel > Settings > Workspace Settings > Activity Log</li></ul>"
}
},
{
"order": 4,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Escalate Issue",
"description": "<div>If the activity looks to be unknown/unplanned/suspicious, escalate issue as per standard operating procedures.</div>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "9c1d6580-cc84-43d5-a48e-dff56becea6e",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - Account Created and Deleted in Short Timeframe",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','672d0101-ce9f-4fa1-8650-4b46d057273b')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Investigate Alert",
"description": "<div>Access the alert in KQL by selecting the 'Alerts' under the 'Evidence' heading</div><div><img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAA1CAYAAAAK0RhzAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAANqADAAQAAAABAAAANQAAAAC041R0AAAGMUlEQVRoBe1Ze2xTVRj/FYbrClvZ6B48JSgTxTEhKshLcAhi9gdzEnkoPtAoMQGDATL9AzSKwcT4B0YeahANguh0aAjTQICAOFQQNahM3YvB1q2sLVu73q7tPN+5u93t2tudWwjrln3b7bn3O995/M7v+84591xDOxP0QUngmHYZ+hy0AX0OUQegfmC9jdl+xnobY/KsqNXrp3vBSqAxo/e7ohap8aqP7opRer3pcANeO9I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2nFRnYYW+NoQ+5wI/YtHaXR9ehqIcbo7GLnT3Y8f28qnpoyFFfcfhz5L/Kx2lfnr2LRpzWYNsaExyaZ8ep3DTjwVzPvxTcsfWL/JbgY4Ok3J+Hh24Zw/dTRJjxwy2C2kW7HrB2VmJiZyHYx6UhMiH2vKMTY9/+0wOnxYzljayhzxVljTdh66grm3Rp+nF1UasUKBv7N+fLu/kKjhM9/d2LRHfIhKzH2xfLRweFe8209Cu9M4XVdviozeM+oJD4oNDCxihCw935sQsIAA5bureXtVLKYOFHlhoOBJaBqqWhqQ7nNgU/OOoLq4cmdzcwfL7MUzFTdjEhJwPrZFizbV4vX2XeBd/Oz8FC2tr2qaNhtZ4thWbKiibndwb+bsfLuVIxLG8SVxNjGw43YfcaBNTOGhZSkuCAmNy/IDNErD2mm0IEgvfr8ccvCTLw0k22oWZwt3FWNCy+PR7aFHUnolG5jbDcbeSPz9e0Fw/HK3PTgtewuM4jJrkL6D3+24/RFN3/DJjeMtPYp5QjouToPt7W5/Nj7GztbTByAojnp3KShxaeY6kq7Zez9sibu7+SKanlxWhp3tz/qPSGz45Msvj4758T0bZXcnEZ75yMj+P1ANoyhtQCrp6eBZsvNR234dfU4PPPlJT6JUAGKvfvGJPGyen+EvrborZTsyYVpOUhNCne9rvU1SwEQaNMg2YFoA0DrJTHXrWh8bemWsW4r1jCIFEsapkjuAmC0WY5lLXsRvcCQiFQTfzZ9Flh0V9Tw3/jjJ7xHfZaxfmDhZMe3pp+x+OYnvHfyziNc3+s1/wOFTJjvAbfM2gAAAABJRU5ErkJggg==\"></div><div>An instance of the Log Analytics workspace will appear with a query to show the alert.</div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Check entity details and activity",
"description": "<ul><li>Grab the entity details involved in the account creation/deletion.</li><li>Use the following KQL to look at the activity more specifically.</li></ul><pre spellcheck=\"false\">AuditLogs\n|where TimeGenerated between ((todatetime('<startTime>')-5m)..(todatetime('endTime')+5m))\n|where OperationName has_any(\"Delete user\",\"Add user\", \"Update user\")\n|where * has \"<displayName or accountName>\"\n|extend CreatedByUser = tostring(InitiatedBy.user.userPrincipalName), CreatedByIPAddress = tostring(InitiatedBy.user.ipAddress)\n|extend CreatedByApp = tostring(InitiatedBy.app.displayName)\n|extend UserPrincipalName = tostring(TargetResources[0].userPrincipalName)\n</pre>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Check IP address",
"description": "<ul><li>If the accounts were updated by a user, perform a check on the IP address to determine if they are clean.</li><li>If the IP address is malicious or is from outside of Australia, verify with the account user. (Note: IP addresses of Microsoft or similar services will likely have IP addresses outside of Australia)</li><li>If the IP address is found to be malicious or the changes were not approved by an admin, escalate the incident for further investigation.</li></ul>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "8fdb0d11-b9e2-403f-b9e6-d3ce71f058e0",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - Multiple users email forwarded to same destination",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','e3dc0ad0-9331-4187-96f2-05419110d635')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Extract relevant values from incident entities",
"description": "<div>Values such as the <strong>UserId</strong>, <strong>DestinationMailAddress, ClientIP</strong> will likely be relevant in developing an accurate conclusion.</div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Enrich ClientIP",
"description": "<div><strong>The enrichment services listed are only suggestions, there are many other potential sources. The suggested sources are not required to be used.</strong></div><ul><li>Is this IP known to your organisation?</li><li>Is the IP in from a location you would expect to see from your users?</li><li>Do threat intelligence sources list the IP as known to be malicious? (suggested sources: AbuseIPDB, VirusTotal)</li></ul><div><strong>\ufeff</strong></div>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Review UserId account sign-ins for suspicious activity",
"description": null
}
},
{
"order": 4,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Confirm if suspicious activity is expected and approved",
"description": "<ul><li>Is the <strong>DestinationMailAddress</strong> an inbox you would expect to see with this behaviour?</li><li>Confirm if user's are responsible for the creation of the forwarding rules and/or suspicious logins (It is recommended not to contact the user directly to avoid a scenario of a threat actor with control of the account replying with incorrect information. A common method is to instead contact the user's manager).</li></ul><div><br></div><div><br></div><div><br></div>"
}
},
{
"order": 5,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Remediate (if required)",
"description": "<div><strong>If there was unauthorised logins or rule creation, possible actions may include:</strong></div><ul><li>Reset user credentials.</li><li>Revoke active sessions.</li><li>Review inbox rules, removing rules where necessary.</li><li>Review account activity across relevant services after the breach occurred.</li></ul>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "9eeda985-ec49-435d-b699-c0bccedf224f",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - Potential Fodhelper UAC Bypass (ASIM Version)",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','d4eaff60-318e-4b64-a96c-bf276011df91')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Extract relevant values from incident entities",
"description": "<div>Values such as the <strong>Account</strong>, <strong>Dvc</strong>, <strong>Computer</strong>, <strong>CommandLine</strong>, <strong>ProcessName</strong>, <strong>ObjectName</strong>, <strong>ObjectValueName</strong> will likely be relevant in developing an accurate conclusion.</div><div><br></div><div>Further, due to the ASIM rule, Microsoft Parsers will allow you to search using specific schemas (this rule uses the ASIM Registry Schema and the ASMIN Process Schema): <a href=\"https://learn.microsoft.com/en-us/azure/sentinel/normalization-about-schemas\" rel=\"noopener noreferrer\" target=\"_blank\">Advanced Security Information Model (ASIM) schemas | Microsoft Learn</a></div><div><br></div><div>Information on using ASIM parsers: <a href=\"https://learn.microsoft.com/en-us/azure/sentinel/normalization-about-parsers\" rel=\"noopener noreferrer\" target=\"_blank\">Use Advanced Security Information Model (ASIM) parsers | Microsoft Learn</a></div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Confirm if suspicious activity is expected and approved",
"description": "<ul><li>Which application/user was used in the incident and is this normal behaviour?</li><li>Was there suspicious activity leading up to the incident?</li><li>Is this expected and approved behaviour in your organisation?</li></ul>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Remediate (if required)",
"description": "<div><strong>Follow Standard Operating Procedures for remediation, some actions may include:</strong></div><ul><li>Run antivirus scan</li><li>Review responsible account/device's recent sign-ins and activities</li><li>Isolate device</li><li>Disable responsible account</li><li>Stop and quarantine the responsible file(s)</li><li>Search for similar behaviour in other devices across your organisation</li></ul>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "3d13152b-88e7-430a-8843-63eda3d33b05",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - Non Domain Controller Active Directory Replication",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','bdf26b6f-5671-4120-a769-fdf4276d453d')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Review Alert Details",
"description": "<div>Access the alert in KQL by selecting the 'Alerts' under the 'Evidence' heading.</div><div><br></div><div><img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAFjElEQVRYhc2YW2xURRjHf3POnt09bXfbbYF2F1tFsdoUUrSmEHkoaqIhUWlM1Grw8qTxwWjU+GC8EmOCxvjgJTwYr4kxRE1QUaOIEFAgqUoEsSgVqKHaC9vL3s5tzviwBam72y5YC/9ks5nJZL7f+c83c745QjkTiuR+EJxTCpD8ETZ2QvBso0xVAKHnoc45sGLy55gCQJvaLAQTGoSq5ohmUkqCl5nSNRVMApEE3LAHtH+trZj8qROTzSLY8G744gbQObkJizimQ0ViFqOWofCCgq4iOabAd05xTLH3T4vXdo3x6zEbw9Toaq3ipqUR4lXG7ID5TjlggIDjOZ/Nv0xwaMTjo30ZGkJhYsEorqt4e3eOz3tzXNtcQUNU45al1WXFT6VSRCKRssZqRXuFYPthm+e+nGDnQUX7vBoao2FaGgxaG4K01lZhSpN3dlk89tlx/hgvfOITklLS09NDV1cXGzZsKAuqNBiQc30ujIVpjBpIpUg7ktuuCLOq2WDC9jENjUvqTOorDcYsWTLAunXrWLVqFZs2baK/v/+/g2kCsq5kwvbIuh4ZVxI0QAjIuB5px2PccXGkj1bifeb7Pi0tLaxfv57Kyko0rWS4AhXPMfKnQc6ThDQNBNiuwlfgKUXGlaAJHAkICAVKZYSgu7sbyD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O/VNe3RDivOkBVSCeoCw4Ohlg0L8gl80JnCOZDrNLk31VWXUVhblyWCE9pxyP/TKcLaF9onmwvKlHlAoW3/qJgSkJ2oOjg/03WUEHXVDAdyA3ARy1zRDQpJQssKuKYD/bEHBGdohk/QxUZdDYUQEkofcM/axLn6sfhvwGl5SRe9N2vGQAAAABJRU5ErkJggg==\"></div><div>An instance of the Log Analytics workspace will appear with a query to show the alert.</div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Close or Escalate",
"description": "<ul><li>Confirm if the IP address(s), domains, and account names are known to the organisation.</li><li>If the actions or the entities are acting outside of the normal operating hours or if the entity details are unknown, then it should be escalated and further investigated.</li><li>Use the following KQL as a guide.</li></ul><div><br></div><pre spellcheck=\"false\">SecurityAlert\n|summarize arg_max(TimeGenerated, *) by SystemAlertId\n|where SystemAlertId in(\"<alertID>\") \n|project Entities\n|extend Entities = todynamic(Entities)\n|mv-expand Entities\n|evaluate bag_unpack(Entities)\n</pre>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "6c9fdffa-1834-4121-81fe-3c510abfd5f3",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - Network Port Sweep from External Network (ASIM Network Session schema)",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','65305b9c-7fd2-400c-ad14-e4cf993efac5')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": " Extract and investigate entities",
"description": "<div><strong>Double check the external entities via enrichment</strong></div><div><br></div><div>Confirm whether the IP (and port) appears malicious with tools such as:</div><ul><li><a href=\"https://www.abuseipdb.com/\" rel=\"noopener noreferrer\" target=\"_blank\">Abuse IP DB</a></li><li><a href=\"https://www.ip2location.com/demo\" rel=\"noopener noreferrer\" target=\"_blank\">IP2Location</a></li><li><a href=\"https://ipinfo.io/\" rel=\"noopener noreferrer\" target=\"_blank\">IP Info</a></li><li><a href=\"https://www.virustotal.com/gui/home/search\" rel=\"noopener noreferrer\" target=\"_blank\">VirusTotal</a></li></ul><div><br></div><div>Further, due to the ASIM rule, Microsoft Parsers will allow you to search using specific schemas (this rule uses the ASIM Network Session Schema): <a href=\"https://learn.microsoft.com/en-us/azure/sentinel/normalization-about-schemas\" rel=\"noopener noreferrer\" target=\"_blank\">Advanced Security Information Model (ASIM) schemas | Microsoft Learn</a></div><div><br></div><div>Information on using ASIM parsers: <a href=\"https://learn.microsoft.com/en-us/azure/sentinel/normalization-about-parsers\" rel=\"noopener noreferrer\" target=\"_blank\">Use Advanced Security Information Model (ASIM) parsers | Microsoft Learn</a></div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Review related network activity and assess need for remediation",
"description": "<div><strong>Review activity relating to the suspicious IP and port activity, this could include:</strong></div><ul><li>Sign-in activity</li><li>Device connections</li><li>Firewall logs</li></ul><div><br></div><div>To scope the recorded interactions involved with the external IP address you can use the \"search\" command in KQL:</div><pre spellcheck=\"false\">search \"<INSERT IP>\"\n| summarize count() by $table\n</pre>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Remediation (if required)",
"description": "<div><strong>Follow remediation Standard Operative Procedures, actions may include:</strong></div><ul><li>Blocking/sink holing the IP/domain at the gateway/firewall level</li><li>Isolating and scanning device</li><li>Other actions as required</li></ul>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "ee6194f3-34cd-490a-8c17-cf57c8e9689c",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - Successful logon from IP and failure from a different IP",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','3d411de5-bba0-4c82-8d5d-992fb947539d')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Review the alert and extract IPs",
"description": "<div>Assign the incident to yourself and then open the alert in the \"Logs\" section by clicking the following Icon:</div><div><br></div><div><img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAAxCAYAAAB6d+FmAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAANaADAAQAAAABAAAAMQAAAAAS+akwAAAHV0lEQVRoBe1aaWxUVRT+Zqazz3ShLV0opWURCmFpIS4tS9QCCYvxh4rBxBQT4i8M8QdxScBG4w+jCTESidWYaFwgMSSKsSFFIUURqlCUpZWlQGuhnWE608501jf1nDtMOy2dea9TalvgJNO33HvPPd89557lvqr6iBByA0EPJjVpdIAuQ0BIEX/PfgCcfmtSY8K0tcCaWoFBPbmRDC/9A1DDr8vEe3tPairiKOIt9uI3AI0pXuv4vT+3G/Db486fGNSCVwF9ZtzB49Zw6YuEoO5D84ujimabHzUNTvx1wyd6FE3RYtPCVCwvMkOfoooz6v97ndj8hsjR6griw18dONbig5UiuE4V2W/XOyTsandg9lQXtj6cgYoZ47sPZUFJ4T4cbHLj9dpOFJiNkCQVphss0GnU0KgiWgn3pSAtrEPHrSB2/t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41O8IJwJnK3SZH366Wk9bdrvaI+0pHrPtriEfFquMDPgOspfWJaOs0oMvwOdwiXHQGECIDDG8kRvznjokDtg8sn4RnKE3lhjlzxiCSZAzjHwWRJESinV8Khix68UJqGMKmtoc2H5xZKlNAOLgIv0HngzkOdMHHdRUH458sevL06B9ecAbx31E6xTIXCDB1MOhWBCaPVyfvRL4C8VtsBM7236NRUp1EOOQpQsubHhyeNN/yw94aweXEaFuUZcJP2z6l27x0Lufd3B2zUb1v5FFSVpQvBfyGtsoO54ghiJhWNLy1Nx5alGZiRocWKYhM2EU8/lTA/NvVgOZ0XbivPxMYSyx28R/JCVlM84bdnqJYiL/dZQxfayExYIw1tXjw+yzxorvqWXtwkU3uTtMV77AqZHGcbGyiNKkjXYtVMs1gUHsQa4Uy+iMDx+eFaqtn2nujCJTo7rFqWPojvSB9kQd2isoLNaFVxBECeNQUzyYROU87HQsdSrlUrkt5XaLWZeM9lGjViEVL1amTQfSzxMQETlzbvr8/FSVqor8mBVNd1YvfGPFHHxfZXei8L6sD5blhJoN0bcqGjyZkOE8iPTzhw6t/IWXp0snXzLNhz3EF7ByhM1+FEqxcZtw9fOC+MzQ3NpKk2qqQ57gXIGppI+5Wkeb7fQyGii9w9F6fJkCyoz/90Yv08K3JIQ1EqLzShttmNsx1+FJB5Rb0gfyT47u9urPzkqij7H5tuwDtrcsQhE50KiGuUx3pagOo6G5l2N36oKsCL+9pAeIRZbiHzK6aPDsmSSvzLQWP18F/nN9OHrSS+T3WRt6RTaKTqE680n28w8SkVW2KHO4g0GmMiLSak7+YC3f8M7hLzdX5g+Qd3GdXT0L0TjxmXLVFibefRnrwbNMD1bnCbIDwSa6q9DtBaJ4ioMWKEEv93TmJQR56P4TR5bu9J83sAarIY4D2pqUjw7b5EwYx+k5kMWXTov0wg+A9Ps+wukvFomgAAAABJRU5ErkJggg==\"></div><div><br></div><div>Then extract the username and IP in the Entities section.</div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Query and review the account's sign in ativity",
"description": "<div>Using the information from before use KQL to view the users sign in activity.</div><div><br></div><div>You can use the following template.</div><pre spellcheck=\"false\">SigninLogs \n| where TimeGenerated > ago(1d) // Change lookback time as required \n| where UserPrincipalName in (\"[UPN]\") // For use when filtering by users (comma seperated list)\n| where ResultType !in (\"50126\", \"50053\", \"530031\") // Remove login attempts with incorrect credentials or auto blocked IPs\n| extend AuthStep_1 = tostring(parse_json(AuthenticationDetails)[0].authenticationMethod) // Used to discover password authentication attempts\n| extend AuthSuccess_1 = tostring(parse_json(AuthenticationDetails)[0].succeeded) // Used to determine if password authentication succeeded\n| where (AuthStep_1 in (\"Password\") and AuthSuccess_1 in (\"true\")) or ResultType in (\"0\", \"53003\", \"50076\") // Only show logins that succeeded or had correct credentials \n| summarize count() by TimeGenerated, UserPrincipalName, IPAddress, Location, ResultType, ResultDescription\n| sort by TimeGenerated desc\n</pre>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Investigate using the results from the query.",
"description": "<div>Using the results look at the following:</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><ul><li><strong>Why did it fail. </strong>If the attempt failed due to to Conditional Access or MFA it would imply that the password was correct meaning that if the sign in was malicious then the user's password was compromised.</li><li>If it did fail on CA, was there any successful attempts from new IPs. A potential attacker could be using a VPN to bypass CA.</li><li>Did the UserAgent change from a mobile phone to a desktop and vice versa. This would indicate that the user is transitioning between devices that are on different networks.</li><li>The time between the sign ins. If the failure occurred soon after the success it would be more suspicious than if it occurred later when the user had time to go home or leave the network that they were on.</li><li>Does the IP that failed have reports of abuse.</li><li>Is the sign in from out of country.</li></ul>"
}
},
{
"order": 4,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Remediate if necessary and close the ticket.",
"description": "<div>Should you determine that the user's account was compromised then:</div><ul><li>Reset the user's password</li><li>Revoke all sessions.</li><li>Review account activity across all relevant services after the breach. (Check what applications they signed in to)</li></ul>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "6518525a-4f4b-44c4-a560-81cc93d7f0f8",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - (Preview) TI map IP entity to DNS Events (ASIM DNS schema)",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','8eee3d7e-24d5-46f7-aace-5931f3193220')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Confirm whether TI mapping is a true positive",
"description": "<div><strong>Double check the mapped TI IP via enrichment</strong></div><div><br></div><div>Confirm whether the IP is malicious with tools such as:</div><ul><li><a href=\"https://www.abuseipdb.com/\" rel=\"noopener noreferrer\" target=\"_blank\">Abuse IP DB</a></li><li><a href=\"https://www.ip2location.com/demo\" rel=\"noopener noreferrer\" target=\"_blank\">IP2Location</a></li><li><a href=\"https://ipinfo.io/\" rel=\"noopener noreferrer\" target=\"_blank\">IP Info</a></li><li><a href=\"https://www.virustotal.com/gui/home/search\" rel=\"noopener noreferrer\" target=\"_blank\">VirusTotal</a></li></ul><div><br></div><div>If IP appears potentially malicious continue on, otherwise note as False Positive.</div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Check on records involving IP Address",
"description": "<div>To scope the recorded interactions involved with the IP address you can use the \"search\" command in KQL:</div><pre spellcheck=\"false\">search \"<INSERT IP>\"\n| summarize count() by $table\n</pre><div><br></div><div>e.g.</div><pre class=\"ql-syntax\" spellcheck=\"false\">search \"1.1.1.1\"\n| summarize count() by $table\n</pre><div><br></div><div>The results will display which tables have recorded instances of the string entered.</div>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Check on actions involving IP Address",
"description": "<div><strong>Using the above tables drill down into each of the log tables to view related events for malicious activity</strong></div><div><br></div><div>For example, if the above results listed a series of events in the DnsEvents table, you can check what the DNS A requests were resolving to, or the DeviceNetworkEvents can be checked to determine what processes, command line arguments, and devices are involved. CommonSecurityLog can also be a good point to check traffic flows and whether security tools have allowed or denied traffic to the IP address.</div><div><br></div><div>The search command can be used again to gain the full scope of relevance and then exclusions can be made where necessary.</div><div><br></div><div>e.g.</div><pre spellcheck=\"false\">DeviceNetworkEvents\n|search \"1.1.1.1\"\n</pre><div><br></div><div>Further, due to the ASIM rule, Microsoft Parsers will allow you to search using specific schemas (this rule uses the ASIM DNS Schema): <a href=\"https://learn.microsoft.com/en-us/azure/sentinel/normalization-about-schemas\" rel=\"noopener noreferrer\" target=\"_blank\">Advanced Security Information Model (ASIM) schemas | Microsoft Learn</a></div><div><br></div><div>Information on using ASIM parsers: <a href=\"https://learn.microsoft.com/en-us/azure/sentinel/normalization-about-parsers\" rel=\"noopener noreferrer\" target=\"_blank\">Use Advanced Security Information Model (ASIM) parsers | Microsoft Learn</a></div>"
}
},
{
"order": 4,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Determine need for containment and remediation",
"description": "<div>If malicious activity has occurred and was not stopped by any form of security solution(s) such as firewall, XDR, or security tooling, follow standard operating procedures for containment and remediation.</div><div><br></div><div>These would commonly involve:</div><ul><li>Isolate and scan affected devices</li><li>Reimage/restore affected devices</li><li>Reset affected credentials</li><li>Revoke active sessions</li><li>Other actions as required</li></ul>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "82dd22b6-40d0-4d06-8d50-27604a3bdb3f",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - MFA Rejected by User",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','462cdb73-b7b6-40e5-8b5d-bdc0096e019e')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Review the incident entities and extract account(s)",
"description": "<div>Access the alert in KQL by selecting the 'Alerts' under the 'Evidence' heading</div><div><img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAA1CAYAAAAK0RhzAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAANqADAAQAAAABAAAANQAAAAC041R0AAAGMUlEQVRoBe1Ze2xTVRj/FYbrClvZ6B48JSgTxTEhKshLcAhi9gdzEnkoPtAoMQGDATL9AzSKwcT4B0YeahANguh0aAjTQICAOFQQNahM3YvB1q2sLVu73q7tPN+5u93t2tudWwjrln3b7bn3O995/M7v+84591xDOxP0QUngmHYZ+hy0AX0OUQegfmC9jdl+xnobY/KsqNXrp3vBSqAxo/e7ohap8aqP7opRer3pcANeO9IYtJgzbjA25qWD0ngQ3cAUQLmWZKyYMDKIod4tYcmeOtyelRAXAA18r6gRgOiYPI5VuDD3gyrkWlI4EAKlJVYGsN7thZxKaH9ropappt7tdqO0tBR5eXkwm82adjxDo+9CkwcBmz/GwoAl80vd0gTGEF2KZJoSuQ3ZZ7F7Kisqfr8fJSUlyMnJQWFhIaqrq0WLhtkJAaNSNPEH2E+gI1WeixYMwaJcY8R8PYvFyZMnkZ2djYKCAlRUVFCT1yTCwLz+ADxsRCWfn6eejpRaD7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ureXtVLKYOFHlhoOBJaBqqWhqQ7nNgU/OOoLq4cmdzcwfL7MUzFTdjEhJwPrZFizbV4vX2XeBd/Oz8FC2tr2qaNhtZ4thWbKiibndwb+bsfLuVIxLG8SVxNjGw43YfcaBNTOGhZSkuCAmNy/IDNErD2mm0IEgvfr8ccvCTLw0k22oWZwt3FWNCy+PR7aFHUnolG5jbDcbeSPz9e0Fw/HK3PTgtewuM4jJrkL6D3+24/RFN3/DJjeMtPYp5QjouToPt7W5/Nj7GztbTByAojnp3KShxaeY6kq7Zez9sibu7+SKanlxWhp3tz/qPSGz45Msvj4758T0bZXcnEZ75yMj+P1ANoyhtQCrp6eBZsvNR234dfU4PPPlJT6JUAGKvfvGJPGyen+EvrborZTsyYVpOUhNCne9rvU1SwEQaNMg2YFoA0DrJTHXrWh8bemWsW4r1jCIFEsapkjuAmC0WY5lLXsRvcCQiFQTfzZ9Flh0V9Tw3/jjJ7xHfZaxfmDhZMe3pp+x+OYnvHfyziNc3+s1/wOFTJjvAbfM2gAAAABJRU5ErkJggg==\"></div><div>An instance of the Log Analytics workspace will appear with a query to show the alert.</div><div><br></div><div>To list all users in the alert:</div><pre spellcheck=\"false\">SecurityAlert\n| summarize arg_max(TimeGenerated, *) by SystemAlertId\n| where SystemAlertId in(\"[SystemAlertId]\")\n| mv-expand todynamic(Entities)\n| project UserPrincipalName = tostring(Entities.DisplayName)\n</pre><div>Temporarily store the accounts listed (such as in a text file)</div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Query and review each account's recent sign-in activity",
"description": "<div><strong>Using the previously recorded accounts, use a KQL query to investigate the account's recent sign-in activity.</strong></div><div>An example query template (read each line to understand what it does):</div><pre spellcheck=\"false\">SigninLogs \n| where TimeGenerated > ago(1d) // Change lookback time as required \n| where UserPrincipalName in (\"[UPN]\") // For use when filtering by users (comma seperated list)\n| where ResultType !in (\"50126\", \"50053\", \"530031\") // Remove login attempts with incorrect credentials or auto blocked IPs\n| extend AuthStep_1 = tostring(parse_json(AuthenticationDetails)[0].authenticationMethod) // Used to discover password authentication attempts\n| extend AuthSuccess_1 = tostring(parse_json(AuthenticationDetails)[0].succeeded) // Used to determine if password authentication succeeded\n| where (AuthStep_1 in (\"Password\") and AuthSuccess_1 in (\"true\")) or ResultType in (\"0\", \"53003\", \"50076\") // Only show logins that succeeded or had correct credentials \n| summarize count() by TimeGenerated, UserPrincipalName, IPAddress, Location, ResultType, ResultDescription\n| sort by TimeGenerated desc\n</pre><div>Note: Sign-ins that failed on CAP or MFA suggests first stage authentication (such as password) was successful and <em>may</em> be an indication of compromised credentials.</div>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Identify suspicious sign-in activity",
"description": "<div><strong>Identify suspicious activity by looking for anomalies such as:</strong></div><ul><li>Activity from an unexpected country or region (Refer to TimeGenerated and Location values).</li><li>Unfamiliar IP address.</li><li>Impossible travel.</li><li>Single factor/legacy auth sign-ins should be considered suspicious.</li></ul>"
}
},
{
"order": 4,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Confirm if suspicious activity is expected and approved",
"description": "<div><strong>Confirm why user rejected MFA prompt</strong></div><div>If the user rejected the MFA prompt due to it being unexpected, it may be an indication that there was an unauthorised login attempt for the user's account the passed first stage authentication (such as password) and should be remediated.</div>"
}
},
{
"order": 5,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Remediate (if required)",
"description": "<div><strong>If there was an unauthorised login attempt, possible actions may include:</strong></div><ul><li>Reset user credentials.</li><li>Revoke active sessions.</li><li>Review account activity across relevant services after the breach occurred.</li></ul>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "f9f19e34-c20d-4597-aaf1-962290324be0",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - Admin promotion after Role Management Application Permission Grant",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','b0292e04-95de-42d6-a024-68b43aba754b')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Confirm that the account/object should be part of any \"Admin\" group",
"description": null
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Confirm that the service principal should be allowed \"Role Management\" rights",
"description": null
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Remediate (if necessary)",
"description": "<div>Remediation could include:</div><ul><li>Removing the account/object that was added to the \"Admin\" group.</li><li>Revoking \"Role Management\" privileges for the affected service principal.</li><li>Further investigate how the service principle got compromised</li></ul>"
}
}
]
}
},
{
"type": "Microsoft.SecurityInsights/automationRules",
"name": "f81a5b5c-54c9-4031-81dd-28fc432f2765",
"scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('existingWorkspaceName'))]",
"apiVersion": "2022-12-01-preview",
"properties": {
"displayName": "AddTasks - User Accounts - Sign in Failure due to CA Spikes",
"order": 100,
"triggeringLogic": {
"isEnabled": true,
"expirationTimeUtc": null,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"[resourceId('Microsoft.OperationalInsights/workspaces/providers/alertRules',parameters('existingWorkspaceName'),'Microsoft.SecurityInsights','50c7012f-80c5-4f73-87ea-e06298d767e4')]"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Review the incident entities and extract account(s)",
"description": "<div>Access the alert in KQL by selecting the 'Alerts' under the 'Evidence' heading</div><div><br></div><div><img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAA1CAYAAAAK0RhzAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAANqADAAQAAAABAAAANQAAAAC041R0AAAGMUlEQVRoBe1Ze2xTVRj/FYbrClvZ6B48JSgTxTEhKshLcAhi9gdzEnkoPtAoMQGDATL9AzSKwcT4B0YeahANguh0aAjTQICAOFQQNahM3YvB1q2sLVu73q7tPN+5u93t2tudWwjrln3b7bn3O995/M7v+84591xDOxP0QUngmHYZ+hy0AX0OUQegfmC9jdl+xnobY/KsqNXrp3vBSqAxo/e7ohap8aqP7opRer3pcANeO9IYtJgzbjA25qWD0ngQ3cAUQLmWZKyYMDKIod4tYcmeOtyelRAXAA18r6gRgOiYPI5VuDD3gyrkWlI4EAKlJVYGsN7thZxKaH9ropappt7tdqO0tBR5eXkwm82adjxDo+9CkwcBmz/GwoAl80vd0gTGEF2KZJoSuQ3ZZ7F7Kisqfr8fJSUlyMnJQWFhIaqrq0WLhtkJAaNSNPEH2E+gI1WeixYMwaJcY8R8PYvFyZMnkZ2djYKCAlRUVFCT1yTCwLz+ADxsRCWfn6eejpRaD7A3H+VZnU96USkvL+eAVq1aJVokql2nD0U1A9oYXRIDZ2B/Mn8GxpLcceq/5Ken9pB8YlhU8vPz4XQ6kZKSguLiYjQ0NIgWjWgnDoyBknzMESO8ugUYIGKT41Tl63mHzcjIiNjBWJXCwBo9XpgGDVS1ozAnxx4xJiNTTAw8HntqXRMG5mN+RXEkU0YgZGBnayWcrfV25HXqr7b54ZDaFJQ3PBUCtmleBt9lWIw3MTxK4LCU/a/cr4oFjkvOp5jsKbZoFIVnRdou1bo8PM6IOYo3iqsdj6bj2anJwWeuZ/mXWzx8B3LDqepoUBgYsWZr9cLhbYOXxZMUCPC0rMaDH6p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tQCrp6eBZsvNR234dfU4PPPlJT6JUAGKvfvGJPGyen+EvrborZTsyYVpOUhNCne9rvU1SwEQaNMg2YFoA0DrJTHXrWh8bemWsW4r1jCIFEsapkjuAmC0WY5lLXsRvcCQiFQTfzZ9Flh0V9Tw3/jjJ7xHfZaxfmDhZMe3pp+x+OYnvHfyziNc3+s1/wOFTJjvAbfM2gAAAABJRU5ErkJggg==\"></div><div><br></div><div>An instance of the Log Analytics workspace will appear with a query to show the alert.</div>"
}
},
{
"order": 2,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Query and review each account's recent sign-in activity",
"description": "<div><strong>Using the previously recorded accounts, use a KQL query to investigate the account's recent sign-in activity.</strong></div><div><br></div><div>An example query template (read each line to understand what it does):</div><pre spellcheck=\"false\">SigninLogs \n| where TimeGenerated > ago(1d) // Change lookback time as required \n| where UserPrincipalName in (\"[UPN]\") // For use when filtering by users (comma seperated list)\n| where ResultType !in (\"50126\", \"50053\", \"530031\") // Remove login attempts with incorrect credentials or auto blocked IPs\n| extend AuthStep_1 = tostring(parse_json(AuthenticationDetails)[0].authenticationMethod) // Used to discover password authentication attempts\n| extend AuthSuccess_1 = tostring(parse_json(AuthenticationDetails)[0].succeeded) // Used to determine if password authentication succeeded\n| where (AuthStep_1 in (\"Password\") and AuthSuccess_1 in (\"true\")) or ResultType in (\"0\", \"53003\", \"50076\") // Only show logins that succeeded or had correct credentials \n| summarize count() by TimeGenerated, UserPrincipalName, IPAddress, Location, ResultType, ResultDescription\n| sort by TimeGenerated desc\n</pre><div><strong>Note: Sign-ins that failed on CAP or MFA suggests first stage authentication (such as password) was successful and <em>may</em> be an indication of compromised credentials.</strong></div>"
}
},
{
"order": 3,
"actionType": "AddIncidentTask",
"actionConfiguration": {
"title": "Identify suspicious sign-in activity",
"description": "<div>Using the results from the previous step, check to see if there are successful log ins from a new IP as the attacker could have used a VPN to bypass conditional access.</div>"
}
},
{