Repository navigation
Expand file tree
/
Copy pathMultiFactorAuthenticationGaps.workbook
More file actions
572 lines (572 loc) · 36.2 KB
/
Copy pathMultiFactorAuthenticationGaps.workbook
File metadata and controls
572 lines (572 loc) · 36.2 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
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
{
"version": "Notebook/1.0",
"items": [
{
"type": 1,
"content": {
"json": "# Multi-Factor Authentication Gaps for Tenants using Conditional Access\r\n\r\nUse this workbook to identify sign-ins and apps that are not protected by multi-factor authentication requirements.\r\n\r\nTo find the application names corresponding to the application IDs seen in this workbook, see - [Application IDs for commonly used Microsoft Applications](https://docs.microsoft.com/en-us/troubleshoot/azure/active-directory/verify-first-party-apps-sign-in#application-ids-for-commonly-used-microsoft-applications)"
},
"name": "text - 7"
},
{
"type": 9,
"content": {
"version": "KqlParameterItem/1.0",
"parameters": [
{
"id": "1795c5d2-7fb6-4326-b965-f50b73f6151e",
"version": "KqlParameterItem/1.0",
"name": "timeRange",
"label": "Time Range",
"type": 4,
"description": "Please set a time range to view sign-ins",
"isRequired": true,
"value": {
"durationMs": 1209600000
},
"typeSettings": {
"selectableValues": [
{
"durationMs": 1800000
},
{
"durationMs": 3600000
},
{
"durationMs": 14400000
},
{
"durationMs": 43200000
},
{
"durationMs": 86400000
},
{
"durationMs": 172800000
},
{
"durationMs": 259200000
},
{
"durationMs": 604800000
},
{
"durationMs": 1209600000
},
{
"durationMs": 2592000000
},
{
"durationMs": 5184000000
},
{
"durationMs": 7776000000
}
],
"allowCustom": true
},
"timeContext": {
"durationMs": 86400000
}
},
{
"id": "4cfc7982-f6f1-4570-937a-6f19cf1a45ec",
"version": "KqlParameterItem/1.0",
"name": "Workspace",
"type": 5,
"isRequired": true,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"value": [
"value::all"
],
"typeSettings": {
"resourceTypeFilter": {
"microsoft.operationalinsights/workspaces": true
},
"additionalResourceOptions": [
"value::all"
],
"showDefault": false
},
"timeContext": {
"durationMs": 604800000
}
},
{
"id": "3157f4af-c193-4d76-9f26-f71c93d6c392",
"version": "KqlParameterItem/1.0",
"name": "FilterDQ",
"type": 10,
"isRequired": true,
"query": "{\"version\":\"1.0.0\",\"content\":\"[\\\"Yes\\\", \\\"No\\\"]\",\"transformers\":null}",
"value": "Yes",
"typeSettings": {
"additionalResourceOptions": []
},
"queryType": 8,
"label": "Filter Graph Requests"
},
{
"id": "44a14eb3-f106-4b86-ab2f-dbc9d68173f1",
"version": "KqlParameterItem/1.0",
"name": "Apps",
"type": 2,
"isRequired": true,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"query": "SigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity != \"00000002-0000-0000-c000-000000000000\") or (\"{FilterDQ}\" != \"Yes\")\r\n| where AuthenticationRequirement == \"singleFactorAuthentication\"\r\n| summarize SingleFactorCount=countif(AuthenticationRequirement == \"singleFactorAuthentication\") by AppDisplayName\r\n| order by SingleFactorCount desc, AppDisplayName asc\r\n| project Value = AppDisplayName, Label = strcat(AppDisplayName, ' - ', SingleFactorCount, ' single factor sign-ins'), Selected = false\r\n",
"crossComponentResources": [
"{Workspace}"
],
"value": [
"value::all"
],
"typeSettings": {
"additionalResourceOptions": [
"value::all"
],
"selectAllValue": "*",
"showDefault": false
},
"timeContext": {
"durationMs": 0
},
"timeContextFromParameter": "timeRange",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces"
},
{
"id": "e19de9c8-90a7-4023-9019-74d01441827a",
"version": "KqlParameterItem/1.0",
"name": "FilterLegacy",
"label": "Legacy Authentication",
"type": 2,
"isRequired": true,
"typeSettings": {
"additionalResourceOptions": [],
"showDefault": false
},
"jsonData": "[\"All\", \"Only Legacy Authentications\", \"Not Legacy Authentications\"]",
"timeContext": {
"durationMs": 1209600000
},
"timeContextFromParameter": "timeRange",
"value": "All"
},
{
"id": "00bcb57b-3073-43ae-9247-46e710e90132",
"version": "KqlParameterItem/1.0",
"name": "DeviceState",
"label": "Device State",
"type": 2,
"isRequired": true,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"query": "SigninLogs\r\n| where ResultType == 0\r\n| where AADTenantId == ResourceTenantId\r\n| extend deviceState = case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"])\r\n| distinct deviceState",
"value": [
"value::all"
],
"typeSettings": {
"additionalResourceOptions": [
"value::all"
],
"selectAllValue": "*"
},
"timeContext": {
"durationMs": 0
},
"timeContextFromParameter": "timeRange",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces"
},
{
"id": "9860a0e6-23f9-4738-9b75-20e94805b343",
"version": "KqlParameterItem/1.0",
"name": "TrustedLocation",
"label": "Trusted Location",
"type": 2,
"description": "Filter based on trusted location",
"isRequired": true,
"query": "{\"version\":\"1.0.0\",\"content\":\"[\\\"All\\\", \\\"Only Trusted Locations\\\", \\\"Not Trusted Locations\\\"]\",\"transformers\":null}",
"typeSettings": {
"additionalResourceOptions": [],
"showDefault": false
},
"timeContext": {
"durationMs": 1209600000
},
"timeContextFromParameter": "timeRange",
"queryType": 8,
"value": "All"
},
{
"id": "efe68cc3-eb8f-461c-afb0-72ede23dea14",
"version": "KqlParameterItem/1.0",
"name": "Users",
"label": "Scope to users",
"type": 2,
"description": "Scope the workbook for selected users",
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"query": "SigninLogs\r\n| where AADTenantId == ResourceTenantId\r\n| distinct UserDisplayName",
"typeSettings": {
"additionalResourceOptions": [
"value::all"
],
"selectAllValue": "*",
"showDefault": false
},
"defaultValue": "value::all",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"value": [
"value::all"
]
}
],
"style": "pills",
"queryType": 8
},
"customWidth": "100",
"name": "parameters - 2"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 1,
"content": {
"json": "## Summary"
},
"name": "text - 1"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "SigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity !in (\"00000002-0000-0000-c000-000000000000\", \"00000003-0000-0000-c000-000000000000\")) or (\"{FilterDQ}\" != \"Yes\")\r\n| where UserDisplayName in ({Users}) or '*' in ({Users})\r\n| where AppDisplayName in ({Apps}) or '*' in ({Apps})\r\n| where '*' in ({DeviceState}) or case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"]) in ({DeviceState})\r\n| where (\"{TrustedLocation}\" == \"Only Trusted Locations\" and NetworkLocationDetails contains \"trustedNamedLocation\") or (\"{TrustedLocation}\" != \"Only Trusted Locations\")\r\n| where (\"{FilterLegacy}\" == \"Only Legacy Authentications\" and (ClientAppUsed != \"Browser\" and ClientAppUsed != \"Mobile Apps and Desktop clients\")) or (\"{FilterLegacy}\" != \"Only Legacy Authentications\")\r\n| summarize Title=\"All SignIns\", Metric = count(), Type = \"sessions\", Order = 1\r\n| union\r\n(SigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity !in (\"00000002-0000-0000-c000-000000000000\", \"00000003-0000-0000-c000-000000000000\")) or (\"{FilterDQ}\" != \"Yes\")\r\n| where UserDisplayName in ({Users}) or '*' in ({Users})\r\n| where AppDisplayName in ({Apps}) or '*' in ({Apps})\r\n| where '*' in ({DeviceState}) or case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"]) in ({DeviceState})\r\n| where (\"{FilterLegacy}\" == \"Only Legacy Authentications\" and (ClientAppUsed != \"Browser\" and ClientAppUsed != \"Mobile Apps and Desktop clients\")) or (\"{FilterLegacy}\" != \"Only Legacy Authentications\")\r\n| where (\"{TrustedLocation}\" == \"Only Trusted Locations\" and NetworkLocationDetails contains \"trustedNamedLocation\") or (\"{TrustedLocation}\" != \"Only Trusted Locations\")\r\n| where AuthenticationRequirement == \"multiFactorAuthentication\"\r\n| summarize Title=\"Protected by MFA\", Metric = count(), Type = \"sessions\", Order = 2)| union\r\n(SigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity !in (\"00000002-0000-0000-c000-000000000000\", \"00000003-0000-0000-c000-000000000000\")) or (\"{FilterDQ}\" != \"Yes\")\r\n| where UserDisplayName in ({Users}) or '*' in ({Users})\r\n| where AppDisplayName in ({Apps}) or '*' in ({Apps})\r\n| where '*' in ({DeviceState}) or case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"]) in ({DeviceState})\r\n| where (\"{FilterLegacy}\" == \"Only Legacy Authentications\" and (ClientAppUsed != \"Browser\" and ClientAppUsed != \"Mobile Apps and Desktop clients\")) or (\"{FilterLegacy}\" != \"Only Legacy Authentications\")\r\n| where (\"{TrustedLocation}\" == \"Only Trusted Locations\" and NetworkLocationDetails contains \"trustedNamedLocation\") or (\"{TrustedLocation}\" != \"Only Trusted Locations\")\r\n| where AuthenticationRequirement != \"multiFactorAuthentication\"\r\n| summarize Title=\"Not Protected by MFA\", Metric = count(), Type = \"sessions\", Order = 3)",
"size": 4,
"timeContextFromParameter": "timeRange",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"crossComponentResources": [
"{Workspace}"
],
"visualization": "tiles",
"tileSettings": {
"titleContent": {
"columnMatch": "Title",
"formatter": 1
},
"leftContent": {
"columnMatch": "Metric",
"formatter": 12,
"formatOptions": {
"palette": "blue"
}
},
"secondaryContent": {
"columnMatch": "Type",
"formatter": 1
},
"showBorder": false,
"sortCriteriaField": "Order",
"sortOrderField": 1,
"size": "auto"
}
},
"name": "query - 11"
}
]
},
"name": "SummaryGroup"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "let top9Apps = SigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where UserDisplayName in ({Users}) or '*' in ({Users})\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity !in (\"00000002-0000-0000-c000-000000000000\", \"00000003-0000-0000-c000-000000000000\")) or (\"{FilterDQ}\" != \"Yes\")\r\n| where AppDisplayName in ({Apps}) or '*' in ({Apps})\r\n| where '*' in ({DeviceState}) or case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"]) in ({DeviceState})\r\n| where (\"{FilterLegacy}\" == \"Only Legacy Authentications\" and (ClientAppUsed != \"Browser\" and ClientAppUsed != \"Mobile Apps and Desktop clients\")) or (\"{FilterLegacy}\" != \"Only Legacy Authentications\")\r\n| where (\"{TrustedLocation}\" == \"Only Trusted Locations\" and NetworkLocationDetails contains \"trustedNamedLocation\") or (\"{TrustedLocation}\" != \"Only Trusted Locations\")\r\n| project UserDisplayName, AppDisplayName, AuthenticationRequirement\r\n| summarize SingleFactorUsers=dcountif(UserDisplayName, AuthenticationRequirement == \"singleFactorAuthentication\") by AppDisplayName\r\n| where SingleFactorUsers > 0\r\n| sort by SingleFactorUsers desc, AppDisplayName asc\r\n| limit 9\r\n| project AppDisplayName;\r\nSigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where UserDisplayName in ({Users}) or '*' in ({Users})\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity !in (\"00000002-0000-0000-c000-000000000000\", \"00000003-0000-0000-c000-000000000000\")) or (\"{FilterDQ}\" != \"Yes\")\r\n| where '*' in ({DeviceState}) or case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"]) in ({DeviceState})\r\n| where (\"{FilterLegacy}\" == \"Only Legacy Authentications\" and (ClientAppUsed != \"Browser\" and ClientAppUsed != \"Mobile Apps and Desktop clients\")) or (\"{FilterLegacy}\" != \"Only Legacy Authentications\")\r\n| where (\"{TrustedLocation}\" == \"Only Trusted Locations\" and NetworkLocationDetails contains \"trustedNamedLocation\") or (\"{TrustedLocation}\" != \"Only Trusted Locations\")\r\n| where AppDisplayName in ({Apps}) or '*' in ({Apps})\r\n| project UserDisplayName, AppDisplayName, AuthenticationRequirement, CorrelationId\r\n| extend AppDisplayName=iff(AppDisplayName in (top9Apps), AppDisplayName, \"All Other Apps\"), rank=iff(AppDisplayName in (top9Apps), 1, 10)\r\n| summarize SingleFactorUsers=dcountif(UserDisplayName, AuthenticationRequirement == \"singleFactorAuthentication\"), MultiFactorUsers=dcountif(UserDisplayName, AuthenticationRequirement != \"singleFactorAuthentication\") by AppDisplayName, rank\r\n| where SingleFactorUsers > 0\r\n| sort by rank asc, SingleFactorUsers desc\r\n| project AppDisplayName, SingleFactorUsers",
"size": 0,
"title": "Number of users signing-in not protected by multi-factor authentication requirement by application",
"timeContextFromParameter": "timeRange",
"exportFieldName": "AppDisplayName",
"exportParameterName": "apps",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"crossComponentResources": [
"{Workspace}"
],
"visualization": "categoricalbar",
"chartSettings": {
"showLegend": true
}
},
"customWidth": "50",
"name": "numberOfUsersNotProtectedByApplication",
"styleSettings": {
"maxWidth": "50%"
}
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "let top9Apps = SigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where UserDisplayName in ({Users}) or '*' in ({Users})\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity !in (\"00000002-0000-0000-c000-000000000000\", \"00000003-0000-0000-c000-000000000000\")) or (\"{FilterDQ}\" != \"Yes\")\r\n| where AppDisplayName in ({Apps}) or '*' in ({Apps})\r\n| where '*' in ({DeviceState}) or case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"]) in ({DeviceState})\r\n| where (\"{FilterLegacy}\" == \"Only Legacy Authentications\" and (ClientAppUsed != \"Browser\" and ClientAppUsed != \"Mobile Apps and Desktop clients\")) or (\"{FilterLegacy}\" != \"Only Legacy Authentications\")\r\n| where (\"{TrustedLocation}\" == \"Only Trusted Locations\" and NetworkLocationDetails contains \"trustedNamedLocation\") or (\"{TrustedLocation}\" != \"Only Trusted Locations\")\r\n| project UserDisplayName, AppDisplayName, AuthenticationRequirement\r\n| summarize SingleFactorUsers=dcountif(UserDisplayName, AuthenticationRequirement == \"singleFactorAuthentication\") by AppDisplayName\r\n| where SingleFactorUsers > 0\r\n| sort by SingleFactorUsers desc, AppDisplayName asc\r\n| limit 9\r\n| project AppDisplayName;\r\nSigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where UserDisplayName in ({Users}) or '*' in ({Users})\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity !in (\"00000002-0000-0000-c000-000000000000\", \"00000003-0000-0000-c000-000000000000\")) or (\"{FilterDQ}\" != \"Yes\")\r\n| where AppDisplayName in ({Apps}) or '*' in ({Apps})\r\n| where '*' in ({DeviceState}) or case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"]) in ({DeviceState})\r\n| where (\"{FilterLegacy}\" == \"Only Legacy Authentications\" and (ClientAppUsed != \"Browser\" and ClientAppUsed != \"Mobile Apps and Desktop clients\")) or (\"{FilterLegacy}\" != \"Only Legacy Authentications\")\r\n| where (\"{TrustedLocation}\" == \"Only Trusted Locations\" and NetworkLocationDetails contains \"trustedNamedLocation\") or (\"{TrustedLocation}\" != \"Only Trusted Locations\")\r\n| project UserDisplayName, AppDisplayName, AuthenticationRequirement, CorrelationId\r\n| extend AppDisplayName=iff(AppDisplayName in (top9Apps), AppDisplayName, \"All Other Apps\"), rank=iff(AppDisplayName in (top9Apps), 1, 10)\r\n| summarize SingleFactorUsers=dcountif(UserDisplayName, AuthenticationRequirement == \"singleFactorAuthentication\"), MultiFactorUsers=dcountif(UserDisplayName, AuthenticationRequirement != \"singleFactorAuthentication\") by AppDisplayName, rank\r\n| where SingleFactorUsers > 0\r\n| sort by rank asc, SingleFactorUsers desc\r\n| extend SingleFactorUsersPercent=SingleFactorUsers*1.0/(SingleFactorUsers + MultiFactorUsers)\r\n| project AppDisplayName, SingleFactorUsersPercent",
"size": 0,
"title": "Percent of users signing-in not protected by multi-factor authentication requirement by application",
"timeContextFromParameter": "timeRange",
"exportFieldName": "AppDisplayName",
"exportParameterName": "Apps",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"crossComponentResources": [
"{Workspace}"
],
"visualization": "categoricalbar",
"chartSettings": {
"xAxis": "AppDisplayName",
"showLegend": true,
"ySettings": {
"numberFormatSettings": {
"unit": 0,
"options": {
"style": "percent",
"useGrouping": false,
"maximumFractionDigits": 0
}
}
}
}
},
"customWidth": "50",
"name": "percentOfUsersNotProtectedByApplication",
"styleSettings": {
"margin": "0px",
"padding": "0px"
}
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "SigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where '*' in ({Users}) or UserDisplayName in ({Users})\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity !in (\"00000002-0000-0000-c000-000000000000\", \"00000003-0000-0000-c000-000000000000\")) or (\"{FilterDQ}\" != \"Yes\")\r\n| where AppDisplayName in ({Apps}) or '*' in ({Apps})\r\n| where '*' in ({DeviceState}) or case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"]) in ({DeviceState})\r\n| where (\"{FilterLegacy}\" == \"Only Legacy Authentications\" and (ClientAppUsed != \"Browser\" and ClientAppUsed != \"Mobile Apps and Desktop clients\")) or (\"{FilterLegacy}\" != \"Only Legacy Authentications\")\r\n| where (\"{TrustedLocation}\" == \"Only Trusted Locations\" and NetworkLocationDetails contains \"trustedNamedLocation\") or (\"{TrustedLocation}\" != \"Only Trusted Locations\")\r\n| extend UserDisplayName = strcat(UserDisplayName, \" (\", UserPrincipalName, \")\")\r\n| project UserDisplayName, UserType, AppDisplayName, AuthenticationRequirement\r\n| where AuthenticationRequirement == \"singleFactorAuthentication\"\r\n| summarize NotMfaCount=count() by AppDisplayName, UserDisplayName, UserType\r\n| order by NotMfaCount desc",
"size": 0,
"showAnalytics": true,
"title": "Select an application and user to learn more",
"noDataMessage": "There were no single factor authentication sign-ins in this time frame",
"noDataMessageStyle": 3,
"timeContextFromParameter": "timeRange",
"exportedParameters": [
{
"fieldName": "AppDisplayName",
"parameterName": "App"
},
{
"fieldName": "UserDisplayName",
"parameterName": "User",
"parameterType": 1
}
],
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"crossComponentResources": [
"{Workspace}"
],
"visualization": "table",
"gridSettings": {
"formatters": [
{
"columnMatch": "AppDisplayName",
"formatter": 5
},
{
"columnMatch": "count_",
"formatter": 5
}
],
"rowLimit": 10000,
"filter": true,
"hierarchySettings": {
"treeType": 1,
"groupBy": [
"AppDisplayName"
]
},
"sortBy": [
{
"itemKey": "UserDisplayName",
"sortOrder": 1
}
]
},
"sortBy": [
{
"itemKey": "UserDisplayName",
"sortOrder": 1
}
]
},
"customWidth": "50",
"name": "query - 3"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "SigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where UserDisplayName in ({Users}) or '*' in ({Users})\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity !in (\"00000002-0000-0000-c000-000000000000\", \"00000003-0000-0000-c000-000000000000\")) or (\"{FilterDQ}\" != \"Yes\")\r\n| where AppDisplayName in ({Apps}) or '*' in ({Apps})\r\n| where '*' in ({DeviceState}) or case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"]) in ({DeviceState})\r\n| where (\"{FilterLegacy}\" == \"Only Legacy Authentications\" and (ClientAppUsed != \"Browser\" and ClientAppUsed != \"Mobile Apps and Desktop clients\")) or (\"{FilterLegacy}\" != \"Only Legacy Authentications\")\r\n| where (\"{TrustedLocation}\" == \"Only Trusted Locations\" and NetworkLocationDetails contains \"trustedNamedLocation\") or (\"{TrustedLocation}\" != \"Only Trusted Locations\")\r\n| extend UserDisplayName = strcat(UserDisplayName, \" (\", UserPrincipalName, \")\")\r\n| project UserDisplayName, UserType, AppDisplayName, AuthenticationRequirement, AuthenticationMethodsUsed, AuthenticationDetails, AuthenticationProcessingDetails\r\n| where AuthenticationRequirement == \"singleFactorAuthentication\"\r\n| summarize Count = count() by UserDisplayName, UserType\r\n| sort by Count desc",
"size": 0,
"title": "Signins not protected by multi-factor auth requirement by user (top 10000)",
"timeContextFromParameter": "timeRange",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"crossComponentResources": [
"{Workspace}"
],
"gridSettings": {
"rowLimit": 10000,
"filter": true,
"sortBy": [
{
"itemKey": "Count",
"sortOrder": 2
}
]
},
"sortBy": [
{
"itemKey": "Count",
"sortOrder": 2
}
]
},
"customWidth": "50",
"name": "query - 4"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "SigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where UserDisplayName in ({Users}) or '*' in ({Users})\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity !in (\"00000002-0000-0000-c000-000000000000\", \"00000003-0000-0000-c000-000000000000\")) or (\"{FilterDQ}\" != \"Yes\")\r\n| where AppDisplayName in ({Apps}) or '*' in ({Apps})\r\n| where '*' in ({DeviceState}) or case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"]) in ({DeviceState})\r\n| where (\"{FilterLegacy}\" == \"Only Legacy Authentications\" and (ClientAppUsed != \"Browser\" and ClientAppUsed != \"Mobile Apps and Desktop clients\")) or (\"{FilterLegacy}\" != \"Only Legacy Authentications\")\r\n| where (\"{TrustedLocation}\" == \"Only Trusted Locations\" and NetworkLocationDetails contains \"trustedNamedLocation\") or (\"{TrustedLocation}\" != \"Only Trusted Locations\")\r\n| extend UserDisplayName = strcat(UserDisplayName, \" (\", UserPrincipalName, \")\")\r\n| project UserDisplayName, UserType, AppDisplayName, AuthenticationRequirement, AuthenticationMethodsUsed, AuthenticationDetails, AuthenticationProcessingDetails\r\n| summarize singleFactor = dcountif(UserDisplayName, AuthenticationRequirement == \"singleFactorAuthentication\"), allAuths = count() by UserDisplayName, UserType\r\n| extend NotMfaAuthsPercentage = todouble(100 * singleFactor/allAuths)\r\n| project UserDisplayName, UserType, NotMfaAuthsPercentage\r\n| top 10 by NotMfaAuthsPercentage",
"size": 0,
"title": "Top users with high percentage of auths not protected by multi-factor authentication requirements",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"crossComponentResources": [
"{Workspace}"
],
"gridSettings": {
"rowLimit": 10000,
"filter": true
},
"sortBy": []
},
"customWidth": "50",
"name": "query - 2"
},
{
"type": 1,
"content": {
"json": "------------"
},
"name": "text - 10"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "SigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where UserDisplayName in ({Users}) or '*' in ({Users})\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity !in (\"00000002-0000-0000-c000-000000000000\", \"00000003-0000-0000-c000-000000000000\")) or (\"{FilterDQ}\" != \"Yes\")\r\n| where AppDisplayName in ({Apps}) or '*' in ({Apps})\r\n| where '*' in ({DeviceState}) or case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"]) in ({DeviceState})\r\n| where (\"{FilterLegacy}\" == \"Only Legacy Authentications\" and (ClientAppUsed != \"Browser\" and ClientAppUsed != \"Mobile Apps and Desktop clients\")) or (\"{FilterLegacy}\" != \"Only Legacy Authentications\")\r\n| where (\"{TrustedLocation}\" == \"Only Trusted Locations\" and NetworkLocationDetails contains \"trustedNamedLocation\") or (\"{TrustedLocation}\" != \"Only Trusted Locations\")\r\n| project DeviceDetail, AuthenticationRequirement\r\n| where AuthenticationRequirement == \"singleFactorAuthentication\"\r\n| extend Os=tostring(DeviceDetail.operatingSystem)\r\n| where isnotempty(Os)\r\n| summarize Count = count() by Os\r\n| order by Count desc",
"size": 3,
"title": "Number of signins not protected by multi-factor authentication requirement by operating system",
"timeContextFromParameter": "timeRange",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"crossComponentResources": [
"{Workspace}"
],
"visualization": "categoricalbar"
},
"customWidth": "50",
"name": "query - 7",
"styleSettings": {
"maxWidth": "50%"
}
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "SigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where UserDisplayName in ({Users}) or '*' in ({Users})\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity !in (\"00000002-0000-0000-c000-000000000000\", \"00000003-0000-0000-c000-000000000000\")) or (\"{FilterDQ}\" != \"Yes\")\r\n| where AppDisplayName in ({Apps}) or '*' in ({Apps})\r\n| where '*' in ({DeviceState}) or case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"]) in ({DeviceState})\r\n| where (\"{FilterLegacy}\" == \"Only Legacy Authentications\" and (ClientAppUsed != \"Browser\" and ClientAppUsed != \"Mobile Apps and Desktop clients\")) or (\"{FilterLegacy}\" != \"Only Legacy Authentications\")\r\n| where (\"{TrustedLocation}\" == \"Only Trusted Locations\" and NetworkLocationDetails contains \"trustedNamedLocation\") or (\"{TrustedLocation}\" != \"Only Trusted Locations\")\r\n| project DeviceDetail, AuthenticationRequirement\r\n| extend Os=tostring(DeviceDetail.operatingSystem)\r\n| summarize NotMfaCount = countif(AuthenticationRequirement == \"singleFactorAuthentication\"), Total=count() by Os\r\n| extend percent=(NotMfaCount*1.0)/Total\r\n| where NotMfaCount > 0\r\n| order by NotMfaCount desc\r\n| project Os, percent",
"size": 3,
"title": "Percent of signins not protected by multi-factor authentication requirement by operating system",
"timeContextFromParameter": "timeRange",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"crossComponentResources": [
"{Workspace}"
],
"visualization": "categoricalbar",
"chartSettings": {
"yAxis": [
"percent"
],
"ySettings": {
"numberFormatSettings": {
"unit": 0,
"options": {
"style": "percent",
"useGrouping": false,
"maximumFractionDigits": 0
}
}
}
}
},
"customWidth": "50",
"name": "query - 5 - Copy",
"styleSettings": {
"maxWidth": "50%"
}
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "SigninLogs\r\n| where ResultType == 0 // Filter to sign-ins that are successful. No interrupts\r\n| where AADTenantId == ResourceTenantId // Filter out cross tenant resource access.\r\n| where array_length(ConditionalAccessPolicies) != 0 //bootstrap\r\n| where UserDisplayName in ({Users}) or '*' in ({Users})\r\n| where (\"{FilterDQ}\" == \"Yes\" and ResourceIdentity !in (\"00000002-0000-0000-c000-000000000000\", \"00000003-0000-0000-c000-000000000000\")) or (\"{FilterDQ}\" != \"Yes\")\r\n| where AppDisplayName in ({Apps}) or '*' in ({Apps})\r\n| where '*' in ({DeviceState}) or case(DeviceDetail[\"trustType\"] == \"\", \"Unmanaged\", DeviceDetail[\"trustType\"]) in ({DeviceState})\r\n| where (\"{FilterLegacy}\" == \"Only Legacy Authentications\" and (ClientAppUsed != \"Browser\" and ClientAppUsed != \"Mobile Apps and Desktop clients\")) or (\"{FilterLegacy}\" != \"Only Legacy Authentications\")\r\n| where (\"{TrustedLocation}\" == \"Only Trusted Locations\" and NetworkLocationDetails contains \"trustedNamedLocation\") or (\"{TrustedLocation}\" != \"Only Trusted Locations\")\r\n| project LocationDetails, AuthenticationRequirement\r\n| where AuthenticationRequirement == \"singleFactorAuthentication\"\r\n| summarize Count = count() by tostring(LocationDetails.countryOrRegion)",
"size": 2,
"title": "Number of sign-ins not protected by multi-factor authentication requirement by location",
"timeContextFromParameter": "timeRange",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"crossComponentResources": [
"{Workspace}"
],
"visualization": "map",
"mapSettings": {
"locInfo": "CountryRegion",
"locInfoColumn": "LocationDetails_countryOrRegion",
"sizeSettings": "Count",
"sizeAggregation": "Sum",
"legendMetric": "Count",
"legendAggregation": "Sum",
"itemColorSettings": {
"nodeColorField": "Count",
"colorAggregation": "Sum",
"type": "heatmap",
"heatmapPalette": "greenRed"
}
}
},
"customWidth": "50",
"name": "query - 6"
}
],
"$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"
}