-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathmondoo-okta-security.mql.yaml
1938 lines (1762 loc) · 99.7 KB
/
mondoo-okta-security.mql.yaml
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
# Copyright (c) Mondoo, Inc.
# SPDX-License-Identifier: BUSL-1.1
policies:
- uid: mondoo-okta-security
name: Mondoo Okta Organization Security
version: 2.1.0
license: BUSL-1.1
tags:
mondoo.com/category: security
mondoo.com/platform: okta-org,saas
authors:
- name: Mondoo, Inc
email: [email protected]
docs:
desc: |
# Overview
The Mondoo Okta Organization Security policy provides security recommendations for Okta organizations. This policy supports scanning of Okta organizations as well as Terraform projects using the [Okta Terraform provider](https://registry.terraform.io/providers/okta/okta/latest/docs) from the HashiCorp Terraform Registry.
### cnspec Okta provider
This policy uses the `okta` provider to authenticate with Okta's API in order to remotely scan an Okta organization. Additional information on the `okta` provider can be found by running this command:
```bash
cnspec scan okta --help
```
## Configuring the Okta provider
The `okta` provider for cnspec requires an API token to authenticate and run scans.
### Create an API token
To create an API token, see [Create an API token](https://developer.okta.com/docs/guides/create-an-api-token/main/) on Okta's documentation site.
### Configure a OKTA_TOKEN environment variable
You supply your API token to cnspec using the `OKTA_TOKEN` environment variable.
#### Linux / macOS
```bash
export OKTA_TOKEN=<OKTA_TOKEN>
```
#### Windows
```powershell
$Env:OKTA_TOKEN = "<OKTA_TOKEN>"
```
## Scan an Okta organization
To scan the configuration of an Okta organization all together:
```bash
cnspec scan okta --organization DOMAIN.okta.com --token $OKTA_TOKEN -f okta-security-healthinsights.mql.yaml
```
## Scan Terraform HCL code managing Okta with the Terraform provider for Okta
```
cnspec scan terraform /path/to/terraform -f okta-security-healthinsights.mql.yaml
```
## Scan Terraform plan file Okta with the Terraform provider for Okta
Generate a Terraform plan.json file to scan:
```
terraform plan -out plan.tfplan
terraform show -json plan.tfplan > tfplan.json
```
Scan Terraform plan file
```
cnspec scan terraform plan /path/to/plan.json -f okta-security-healthinsights.mql.yaml
```
## Scan Terraform state file Okta with the Terraform provider for Okta
Generate a Terraform state.json file to scan:
```
terraform show -json > tfstate.json
```
Scan Terraform state file:
```
cnspec scan terraform state /path/to/tfstate.json -f okta-security-healthinsights.mql.yaml
```
## Join the community!
Our goal is to build policies that are simple to deploy, accurate, and actionable.
If you have any suggestions for how to improve this policy, or if you need support, [join the community](https://github.com/orgs/mondoohq/discussions) in GitHub Discussions."
groups:
- title: Okta Organization Security - HealthInsight Tasks and Recommendations
checks:
- uid: mondoo-okta-security-limit-super-admins
- uid: mondoo-okta-security-threatinsight-block-suspicious-ip-addresses
- uid: mondoo-okta-security-okta-mfa-access
- uid: mondoo-okta-security-disable-weaker-mfa-factors-in-factor-enrollment-policies
- uid: mondoo-okta-security-enable-okta-verify-with-push-for-mfa
- uid: mondoo-okta-security-okta-enforce-session-lifetime
- uid: mondoo-okta-security-enable-suspicious-activity-reporting
- uid: mondoo-okta-security-sign-on-notifications-for-end-users
- uid: mondoo-okta-security-factor-enrollment-notifications
- uid: mondoo-okta-security-factor-reset-notifications-for-end-users
- uid: mondoo-okta-security-password-changed-notifications-for-end-users
- uid: mondoo-okta-security-okta-auth-openid-saml
- uid: mondoo-okta-security-password-settings-minimum-length
- uid: mondoo-okta-security-password-settings-min-lowercase
- uid: mondoo-okta-security-password-settings-min-number
- uid: mondoo-okta-security-password-settings-min-symbols
- uid: mondoo-okta-security-password-settings-min-age
- uid: mondoo-okta-security-password-settings-exclude-username
- uid: mondoo-okta-security-password-settings-exclude-first-name
- uid: mondoo-okta-security-password-settings-exclude-last-name
- uid: mondoo-okta-security-password-settings-dictionary-lookup
- uid: mondoo-okta-security-password-settings-max-age
- uid: mondoo-okta-security-password-settings-expire-warning
- uid: mondoo-okta-security-password-settings-history-count
- uid: mondoo-okta-security-password-settings-max-lockout-attempts
- uid: mondoo-okta-security-password-settings-password-auto-unlock-minutes
- uid: mondoo-okta-security-password-settings-password-show-lockout-failures
- uid: mondoo-okta-security-password-settings-password-email-recovery
- uid: mondoo-okta-security-password-settings-password-sms-recovery
- uid: mondoo-okta-security-password-settings-password-question-recovery
scoring_system: highest impact
queries:
- uid: mondoo-okta-security-limit-super-admins
title: Limit the number of super admins
impact: 100
props:
- uid: mondooOktaSecurityMaxOktaSuperAdmins
title: Maximum number of Okta Super Admins
mql: return 15
docs:
desc: |
Admin roles allow you to control user access to a range of Okta functions. You can assign more than one role to an individual admin if their job requires them to perform actions that span multiple roles. This role can create other admins, assign or remove permissions, and perform all other admin activities. The super admin has the highest permissions of all admin roles.
## Okta Recommends
Limit the number of super admins only to users who require super admin access. An org shouldn't have more than:
- 50 percent of admins have super admin privileges
- 15 super admins
All other admins should only have the permissions as required for their role.
Plan for a recurring assessment of all admin privileges to ensure that these best practices are met.
refs:
- url: https://help.okta.com/en-us/Content/Topics/Security/healthinsight/healthinsight-security-task-recomendations.htm
title: HealthInsight tasks and recommendations
- url: https://help.okta.com/en-us/Content/Topics/Security/network/network-zones.htm
title: Network Zones
- url: https://help.okta.com/en-us/Content/Topics/Security/threat-insight/configure-threatinsight.htm
title: Configure Okta ThreatInsight
- url: https://help.okta.com/en-us/Content/Topics/Security/Administrators.htm
title: Administrators
- url: https://help.okta.com/en-us/Content/Topics/Security/administrators-super-admin.htm
title: Super Administrators
variants:
- uid: mondoo-okta-security-limit-super-admins-api
- uid: mondoo-okta-security-limit-super-admins-api
title: Limit the number of super admins
impact: 100
filters: asset.platform == "okta-org"
mql: okta.groups.where(roles.one(type =="SUPER_ADMIN")).all(members.length < props.mondooOktaSecurityMaxOktaSuperAdmins )
docs:
remediation:
- id: console
desc: |
### Change admin privileges to a user or an Okta group
1. In the Admin Console, go to **Security > Administrators**.
2. Under **Admin Roles**, select the Super filter to display only super administrators.
3. Next to each user entry, select **Edit**. The Edit Administrator window is displayed.
4. From the list of administrator roles, assign a role other than super admin to the user.
5. Select **Update Administrator**.
- uid: mondoo-okta-security-threatinsight-block-suspicious-ip-addresses
title: Enable Okta ThreatInsight to block suspicious IP addresses
impact: 100
docs:
desc: |
Configure network blocklisting to deny access from known malicious IP addresses or locations from your Okta org.
Admins can block access to their Okta org to IP addresses coming from network zones, IP zones, and dynamic zones. Network zones contain a list of IP addresses, and dynamic zones contain a list of locations, ASNs, or IP types. Okta doesn't allow blocklisted IP addresses to access any of your org's URLs. Okta blocks these requests before any type of policy evaluation occurs.
### Okta recommends
Block any known untrusted IP addresses, locations, or proxy servers to limit access to your org. If your org uses IP Trust for network zones, Okta also recommends blocking any IP addresses that are identified as a Tor anonymizer proxy. Only add IP addresses or locations that aren't associated with legitimate user activity.
### Security impact
Moderate
## User impact
Low
Legitimate users within your org see no change in behavior. Clients connecting from blocked network zones see a 403 (access denied) error.
variants:
- uid: mondoo-okta-security-threatinsight-block-suspicious-ip-addresses-terraform-hcl
- uid: mondoo-okta-security-threatinsight-block-suspicious-ip-addresses-terraform-plan
- uid: mondoo-okta-security-threatinsight-block-suspicious-ip-addresses-terraform-state
- uid: mondoo-okta-security-threatinsight-block-suspicious-ip-addresses-api
- uid: mondoo-okta-security-threatinsight-block-suspicious-ip-addresses-api
title: Enable Okta ThreatInsight to block suspicious IP addresses
impact: 100
filters: asset.platform == "okta-org"
mql: |
okta.networks.any( usage == "BLOCKLIST" && gateways.length > 0 )
docs:
remediation:
- id: console
desc: |
### Block specific IP addresses
Block specific IP addresses to deny access to your Okta org.
1. In the Admin Console, go to SecurityNetworks.
2. In the list of zones, select Edit for the BlockedIpZone network zone.
3. Select Block access from IPs matching conditions listed in this zone.
4. Select Save.
### Block IP addresses in a dynamic zone
Block IP addresses in a dynamic zone from accessing your Okta org.
1. In the Admin Console, go to SecurityNetworks.
2. Select Add Zone > Dynamic Zone.
3. Define a location or proxy type.
4. Select Block access from IPs matching conditions listed in this zone.
5. Select Save.
### Block Tor anonymizer proxy IP addresses
Block IP addresses identified as a Tor anonymizer proxy from accessing your Okta org.
1. In the Admin Console, go to SecurityNetworks.
2. Select Add Zone > Dynamic Zone.
3. Select Tor anonymizer proxy for IP Type.
4. Select Block access from IPs matching conditions listed in this zone.
5. Select Save.
- uid: mondoo-okta-security-threatinsight-block-suspicious-ip-addresses-terraform-hcl
title: Enable Okta ThreatInsight to block suspicious IP addresses
impact: 100
filters: asset.platform == "terraform-hcl" && terraform.providers.any( nameLabel == "okta" )
mql: |
terraform.resources.where( nameLabel == "okta_network_zone" ).one( arguments['usage'] == "BLOCKLIST" )
terraform.resources.where( nameLabel == "okta_network_zone" && arguments['usage'] == "BLOCKLIST" ).all( arguments['gateways'].length > 0 )
docs:
remediation:
- id: terraform
desc: |
```
resource "okta_network_zone" "example_blocklist" {
name = "myBlockList"
type = "IP"
usage - "BLOCKLIST"
gateways = ["1.2.3.4/24", "2.3.4.5-2.3.4.15"]
proxies = ["2.2.3.4/24", "3.3.4.5-3.3.4.15"]
}
```
- uid: mondoo-okta-security-threatinsight-block-suspicious-ip-addresses-terraform-plan
title: Enable Okta ThreatInsight to block suspicious IP addresses
impact: 100
filters: asset.platform == "terraform-plan" && terraform.plan.resourceChanges.contains( providerName == /okta/ )
mql: |
terraform.plan.resourceChanges.where( type == "okta_network_zone" ).one( change.after['usage'] == "BLOCKLIST" )
terraform.plan.resourceChanges.where( type == "okta_network_zone" && change.after['usage'] == "BLOCKLIST" ).all( change.after['gateways'].length > 0 )
docs:
remediation:
- id: terraform
desc: |
```
resource "okta_network_zone" "example_blocklist" {
name = "myBlockList"
type = "IP"
usage - "BLOCKLIST"
gateways = ["1.2.3.4/24", "2.3.4.5-2.3.4.15"]
proxies = ["2.2.3.4/24", "3.3.4.5-3.3.4.15"]
}
```
- uid: mondoo-okta-security-threatinsight-block-suspicious-ip-addresses-terraform-state
title: Enable Okta ThreatInsight to block suspicious IP addresses
impact: 100
filters: asset.platform == "terraform-state" && terraform.state.resources.contains( type == /okta_network_zone/ )
mql: |
terraform.state.resources.where( type == 'okta_network_zone' ).contains( values['usage'] == "BLOCKLIST" )
terraform.state.resources.where( type == 'okta_network_zone' ).contains( values['usage'] == "BLOCKLIST" && values['gateways'].length > 0 )
docs:
remediation:
- id: terraform
desc: |
```
resource "okta_network_zone" "example_blocklist" {
name = "myBlockList"
type = "IP"
usage - "BLOCKLIST"
gateways = ["1.2.3.4/24", "2.3.4.5-2.3.4.15"]
proxies = ["2.2.3.4/24", "3.3.4.5-3.3.4.15"]
}
```
- uid: mondoo-okta-security-disable-weaker-mfa-factors-in-factor-enrollment-policies
title: Disable weaker MFA factors in factor enrollment policies
impact: 80
docs:
desc: |
Enable strong MFA factors to improve resistance to phishing and man-in-the-middle attacks.
Admins can configure multifactor authentication (MFA) at the organization level or application level. When users sign in to Okta or an app, they're prompted to authenticate themselves. If you deploy strong factors, they provide better protection against phishing, adversary-in-the-middle attacks, and others.
### Okta recommends
Update factor enrollment policies based on the following:
- Enable as primary factors: Okta Verify (with Push if available), Google Authenticator, WebAuthn
- Don't enable as secondary factors: Security Questions and SMS/Email/Voice
### Security impact
High
### User impact
High
When signing in to their org, end users are prompted to enroll in required factors and may enroll in any factors set to optional. Factors that have been disabled aren't visible to end users.
refs:
- url: https://help.okta.com/en-us/Content/Topics/Security/healthinsight/strong-factors.htm
title: Disable weaker MFA factors in factor enrollment policies
- url: https://registry.terraform.io/providers/okta/okta/latest/docs/resources/policy_mfa_default
title: Terraform Registry - okta_policy_mfa_default
variants:
- uid: mondoo-okta-security-disable-weaker-mfa-factors-in-factor-enrollment-policies-api
- uid: mondoo-okta-security-disable-weaker-mfa-factors-in-factor-enrollment-policies-terraform-hcl
- uid: mondoo-okta-security-disable-weaker-mfa-factors-in-factor-enrollment-policies-terraform-plan
- uid: mondoo-okta-security-disable-weaker-mfa-factors-in-factor-enrollment-policies-terraform-state
- uid: mondoo-okta-security-disable-weaker-mfa-factors-in-factor-enrollment-policies-api
title: Disable weaker MFA factors in factor enrollment policies
impact: 80
filters: asset.platform == "okta-org"
mql: |
okta.policies.mfaEnroll.all( _.settings['factors']['okta_email']['enroll']['self'] != /(OPTIONAL|REQUIRED)/ )
okta.policies.mfaEnroll.all( _.settings['factors']['okta_sms']['enroll']['self'] != /(OPTIONAL|REQUIRED)/ )
okta.policies.mfaEnroll.all( _.settings['factors']['phone_number']['enroll']['self'] != /(OPTIONAL|REQUIRED)/ )
docs:
remediation:
- id: console
desc: |
### Enable strong factors for factor enrollment
1. In the Admin Console, go to SecurityMultifactor.
2. Select Factor Enrollment.
3. Select Edit.
4. Set the factor of your choice to Required, Optional, or Disabled.
- uid: mondoo-okta-security-disable-weaker-mfa-factors-in-factor-enrollment-policies-terraform-hcl
title: Disable weaker MFA factors in factor enrollment policies
impact: 80
filters: asset.platform == "terraform-hcl" && terraform.providers.any( nameLabel == "okta" )
mql: |
terraform.resources.where( nameLabel == "okta_policy_mfa_default" ).all( arguments['okta_sms']['enroll'] != /(OPTIONAL|REQUIRED)/)
terraform.resources.where( nameLabel == "okta_policy_mfa_default" ).all( arguments['okta_email']['enroll'] != /(OPTIONAL|REQUIRED)/)
docs:
remediation:
- id: terraform
desc: |
```
resource "okta_policy_mfa_default" "classic_example" {
is_oie = false
okta_verify = {
enroll = "REQUIRED"
}
okta_otp = {
enroll = "REQUIRED"
}
google_otp = {
enroll = "REQUIRED"
}
okta_email = {
enroll = "NOT_ALLOWED"
}
okta_sms = {
enroll = "NOT_ALLOWED"
}
okta_email = {
enroll = "NOT_ALLOWED"
}
}
```
- uid: mondoo-okta-security-disable-weaker-mfa-factors-in-factor-enrollment-policies-terraform-plan
title: Disable weaker MFA factors in factor enrollment policies
impact: 80
filters: asset.platform == "terraform-plan" && terraform.plan.resourceChanges.contains( providerName == /okta/ )
mql: |
terraform.plan.resourceChanges.where( type == "okta_policy_mfa_default" ).all( change.after['okta_email']['enroll'] != /(OPTIONAL|REQUIRED)/ )
terraform.plan.resourceChanges.where( type == "okta_policy_mfa_default" ).all( change.after['okta_sms']['enroll'] != /(OPTIONAL|REQUIRED)/ )
docs:
remediation:
- id: terraform
desc: |
```
resource "okta_policy_mfa_default" "classic_example" {
is_oie = false
okta_verify = {
enroll = "REQUIRED"
}
okta_otp = {
enroll = "REQUIRED"
}
google_otp = {
enroll = "REQUIRED"
}
okta_email = {
enroll = "NOT_ALLOWED"
}
okta_sms = {
enroll = "NOT_ALLOWED"
}
okta_email = {
enroll = "NOT_ALLOWED"
}
}
```
- uid: mondoo-okta-security-disable-weaker-mfa-factors-in-factor-enrollment-policies-terraform-state
title: Disable weaker MFA factors in factor enrollment policies
impact: 80
filters: asset.platform == "terraform-state" && terraform.state.resources.contains( type == /okta_policy_password/ )
mql: |
terraform.state.resources.where( type == 'okta_policy_mfa_default' ).all( values['okta_sms']['enroll'] != /(OPTIONAL|REQUIRED)/ )
terraform.state.resources.where( type == 'okta_policy_mfa_default' ).all( values['okta_email']['enroll'] != /(OPTIONAL|REQUIRED)/ )
docs:
remediation:
- id: terraform
desc: |
```
resource "okta_policy_mfa_default" "classic_example" {
is_oie = false
okta_verify = {
enroll = "REQUIRED"
}
okta_otp = {
enroll = "REQUIRED"
}
google_otp = {
enroll = "REQUIRED"
}
okta_email = {
enroll = "NOT_ALLOWED"
}
okta_sms = {
enroll = "NOT_ALLOWED"
}
okta_email = {
enroll = "NOT_ALLOWED"
}
}
```
- uid: mondoo-okta-security-enable-okta-verify-with-push-for-mfa
title: Enable Okta Verify (with Push if available) for MFA
impact: 80
docs:
desc: |
Okta Verify is a multifactor authentication (MFA) app developed by Okta. It lets users verify their identity when they sign in to Okta and makes it less likely that someone pretending to be the user can gain access to the account.
To use Okta Verify, you must first enable and configure it for your org, and then your end users must install the Okta Verify app on their device and set it up. Then, when end users sign in to Okta, they can verify their identity by approving a push notification in the app, or by entering a one-time code provided by the app into Okta.
variants:
- uid: mondoo-okta-security-enable-okta-verify-with-push-for-mfa-api
- uid: mondoo-okta-security-enable-okta-verify-with-push-for-mfa-terraform-hcl
- uid: mondoo-okta-security-enable-okta-verify-with-push-for-mfa-terraform-plan
- uid: mondoo-okta-security-enable-okta-verify-with-push-for-mfa-api
title: Enable Okta Verify (with Push if available) for MFA
impact: 80
filters: asset.platform == "okta-org"
mql: okta.policies.mfaEnroll.any( _.settings['factors']['okta_otp'] )
docs:
remediation:
- id: console
desc: |
See [Enable and configure Okta Verify](https://help.okta.com/en-us/Content/Topics/Mobile/okta-verify-overview.htm) in Okta's documentation site.
- uid: mondoo-okta-security-enable-okta-verify-with-push-for-mfa-terraform-hcl
title: Enable Okta Verify (with Push if available) for MFA
impact: 80
filters: asset.platform == "terraform-hcl" && terraform.providers.any( nameLabel == "okta" )
mql: terraform.resources.where( nameLabel == "okta_policy_mfa_default" ).any( arguments['okta_otp']['enroll'] == /REQUIRED/)
docs:
remediation:
- id: terraform
desc: |
```
resource "okta_policy_mfa_default" "classic_example" {
is_oie = false
okta_verify = {
enroll = "REQUIRED"
}
okta_otp = {
enroll = "REQUIRED"
}
google_otp = {
enroll = "REQUIRED"
}
okta_email = {
enroll = "NOT_ALLOWED"
}
okta_sms = {
enroll = "NOT_ALLOWED"
}
okta_email = {
enroll = "NOT_ALLOWED"
}
}
```
- uid: mondoo-okta-security-enable-okta-verify-with-push-for-mfa-terraform-plan
title: Enable Okta Verify (with Push if available) for MFA
impact: 80
filters: asset.platform == "terraform-plan" && terraform.plan.resourceChanges.contains( providerName == /okta/ )
mql: |
terraform.plan.resourceChanges.where( type == "okta_policy_mfa_default" ).all( change.after['okta_otp']['enroll'] == /REQUIRED/ )
docs:
remediation:
- id: terraform
desc: |
```
resource "okta_policy_mfa_default" "classic_example" {
is_oie = false
okta_verify = {
enroll = "REQUIRED"
}
okta_otp = {
enroll = "REQUIRED"
}
google_otp = {
enroll = "REQUIRED"
}
okta_email = {
enroll = "NOT_ALLOWED"
}
okta_sms = {
enroll = "NOT_ALLOWED"
}
okta_email = {
enroll = "NOT_ALLOWED"
}
}
```
- uid: mondoo-okta-security-okta-mfa-access
title: Require at least one factor in every MFA enrollment policy
impact: 100
docs:
desc: |
Enabling at least one required factor for your org ensures that end users assigned to a given policy are enrolled in MFA.
Once a required factor is set, you can also update your Okta sign-on policy to prompt users to enroll in the factor the next time they sign in.
### Okta recommends
Require at least one factor in every MFA enrollment policy.
### Security impact
High
### End-user impact
Low
If a factor is required as part of the MFA enrollment policy, end users must enroll in the factor before they can sign in to their org. Setup varies depending on the factor specified.
variants:
- uid: mondoo-okta-security-okta-mfa-access-api
- uid: mondoo-okta-security-okta-mfa-access-api
title: Require at least one factor in every MFA enrollment policy
impact: 100
filters: asset.platform == "okta-org"
mql: |
everyoneGroupId = okta.groups.where( profile['name'] == "Everyone" ).map(id)[0]
okta.policies.mfaEnroll.one( status == "ACTIVE" && conditions['people']['groups']['include'].contains(everyoneGroupId) )
docs:
remediation:
- id: console
desc: |
### Set a required factor in an MFA enrollment policy
1. In the Admin Console, go to **Security > Multifactor**. The **Factor Types** page appears.
2. Select **Factor Enrollment** to switch to factor enrollment policies and rules.
3. Select a policy and select **Edit** to modify it.
4. From the list of eligible factors, set at least one factor to **Required**.
5. Select **Update Policy**.
### Prompt an end user to enroll in a required factor
To prompt an end user to enroll in a required factor, you may do one of the following:
- Set an Okta sign-on policy rule that prompts a user for factor enrollment.
- Set a factor enrollment policy rule that allows a user to enroll in a factor when challenged for MFA.
- Set a factor enrollment policy rule that prompts the user to enroll in a factor the first time they sign in to their org.
### Create an Okta sign-on policy rule that prompts for factor enrollment
1. From the Admin Console menu, select Security > Authentication. The Authentication policies page appears.
2. Select Sign On to access Sign-On Policies.
3. Select the policy and from the list of associated rules, select Edit to start modifying an existing policy rule. You can also create a rule.
4. From the Edit Rule window, select Prompt for Factor.
5. Select **Update Rule**.
### Create a factor enrollment policy rule that allows users to enroll in a factor when challenged for MFA
1. In the Admin Console, go to **Security > Multifactor**. The **Factor Types** page appears.
2. Select **Factor Enrollment**.
3. Choose one of the active policy rules in the list and select Edit. The Edit Rule dialog appears.
4. Under the condition THEN Enroll in multi-factor, select the first time a user is challenged for MFA.
5. Select **Update Rule**.
### Create a factor enrollment policy rule that prompts new users to enroll in a factor the first time they sign in to their org
1. In the Admin Console, go to **Security > Multifactor**. The **Factor Types** page appears.
2. Select **Factor Enrollment**.
3. Choose one of the active policy rules in the list and select Edit. The Edit Rule dialog appears.
4. Under the condition THEN Enroll in multi-factor, select the first time a user signs in.
5. Select **Update Rule**.
- uid: mondoo-okta-security-okta-enforce-session-lifetime
title: Enforce a limited session lifetime for all policies
impact: 80
docs:
desc: |
The session lifetime determines the maximum idle time of a user's Okta session, and when the session expires.
Shorter session lifetimes reduce the risk of malicious parties gaining access to a user's session.
The default session lifetime is two hours. A countdown timer appears to users when there are five minutes of session time remaining.
### Okta recommends
A session lifetime of two hours or less.
### Security impact
High
### End-user impact
Moderate
A countdown timer appears to users when there are five minutes of session time remaining.
variants:
- uid: mondoo-okta-security-okta-enforce-session-lifetime-api
- uid: mondoo-okta-security-okta-enforce-session-lifetime-api
title: Enforce a limited session lifetime for all policies
impact: 80
filters: asset.platform == "okta-org"
props:
- uid: mondooOktaSecurityMaxSessionIdleMinutes
title: Okta Security - SignOn mondooOktaSecurityMaxSessionIdleMinutes
mql: return 120
- uid: mondooOktaSecurityMaxSessionLifetimeMinutes
title: Okta Security - Max session lifetime minutes
mql: return 1440
mql: |
okta.policies.signOn.where(_.rules.all(status == "ACTIVE")).all(_.rules.all(actions["signon"]["session"]["mondooOktaSecurityMaxSessionIdleMinutes"] <= props.mondooOktaSecurityMaxSessionIdleMinutes ))
okta.policies.signOn.where(_.rules.all(status == "ACTIVE")).all(_.rules.all(actions["signon"]["session"]["mondooOktaSecurityMaxSessionLifetimeMinutes"] <= props.mondooOktaSecurityMaxSessionLifetimeMinutes ))
docs:
remediation:
- id: console
desc: |
### Set the session lifetime for a policy
1. In the Admin Console, go to **Security > Authentication**.
2. Select **Sign On**.
3. Select **Add Rule** or **Edit** to modify an existing policy rule.
4. Under **Session expires after**, set the session lifetime duration in minutes, hours, or days.
5. Select **Create Rule** or **Save Rule** once your changes have been made.
- uid: mondoo-okta-security-okta-auth-openid-saml
title: Enable SAML or OIDC authentication for supported apps
impact: 100
docs:
desc: |
SAML and OIDC are authentication protocols that reduce reliance on password-based authentication.
SAML is an XML-based standard for exchanging authentication and authorization data between an Identity Provider (IdP) and a service provider (SP).
OpenID Connect (OIDC) is a protocol that sits on top of the OAuth 2.0 framework. The OIDC protocol allows otherwise different systems to interoperate and share authentication state and user profile information.
SWA is an SSO system developed by Okta to provide single sign-on for apps that don't support proprietary federated sign-on methods or SAML. In a SWA login, the username and password are passed to the third-party app whereas with SAML and OIDC, those credentials never leave Okta.
### Okta recommends
Enable SAML or OIDC and disable SWA for applications when possible.
### Security impact
High
### User impact
None
When signing in to their org, end users are prompted to enroll in required factors and may enroll in any factors set to optional. Factors that have been disabled aren't visible to end users.
variants:
- uid: mondoo-okta-security-okta-auth-openid-saml-api
- uid: mondoo-okta-security-okta-auth-openid-saml-terraform-hcl
- uid: mondoo-okta-security-okta-auth-openid-saml-terraform-plan
- uid: mondoo-okta-security-okta-auth-openid-saml-api
title: Enable SAML or OIDC authentication for supported apps
impact: 80
filters: asset.platform == "okta-org"
mql: |
okta.applications.where(signOnMode != "BOOKMARK" && status == "ACTIVE").all(_.signOnMode == "OPENID_CONNECT" || _.signOnMode == "SAML_2_0")
docs:
desc: |
This check explicitly skips Okta Bookmark apps.
remediation:
- id: console
desc: |
### Use the Okta Admin Console
1. Log into the organization as an administrator.
2. Select **Applications > Applications**.
3. Select **Create App Integration** or **Browse App Catalog** to see the available apps.
4. Assign OIDC or SAML.
- uid: mondoo-okta-security-okta-auth-openid-saml-terraform-hcl
title: Enable SAML or OIDC authentication for supported apps
impact: 80
filters: asset.platform == "terraform-hcl" && terraform.providers.any( nameLabel == "okta" )
mql: |
terraform.resources.any( nameLabel == "okta_idp_oidc" || nameLabel == "okta_app_saml" )
docs:
remediation:
- id: terraform
desc: |
### Configure a SAML application with Terraform
>Note: If you receive the error `You do not have permission to access the feature you are requesting` contact support and request feature flag `ADVANCED_SSO` be applied to your org.
```
resource "okta_app_saml" "example" {
label = "example"
sso_url = "https://example.com"
recipient = "https://example.com"
destination = "https://example.com"
audience = "https://example.com/audience"
subject_name_id_template = "$${user.userName}"
subject_name_id_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
response_signed = true
signature_algorithm = "RSA_SHA256"
digest_algorithm = "SHA256"
honor_force_authn = false
authn_context_class_ref = "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"
attribute_statements {
type = "GROUP"
name = "groups"
filter_type = "REGEX"
filter_value = ".*"
}
}
```
### Configure an OIDC provider with Terraform
```
resource "okta_idp_oidc" "example" {
name = "example"
authorization_url = "https://idp.example.com/authorize"
authorization_binding = "HTTP-REDIRECT"
token_url = "https://idp.example.com/token"
token_binding = "HTTP-POST"
user_info_url = "https://idp.example.com/userinfo"
user_info_binding = "HTTP-REDIRECT"
jwks_url = "https://idp.example.com/keys"
jwks_binding = "HTTP-REDIRECT"
scopes = ["openid"]
client_id = "efg456"
client_secret = "efg456"
issuer_url = "https://id.example.com"
username_template = "idpuser.email"
}
```
- uid: mondoo-okta-security-okta-auth-openid-saml-terraform-plan
title: Enable SAML or OIDC authentication for supported apps
impact: 80
filters: asset.platform == "terraform-plan" && terraform.plan.resourceChanges.contains( providerName == /okta/ )
mql: |
terraform.plan.resourceChanges.any( type == /okta_idp_oidc/ || type == /okta_app_saml/ )
docs:
remediation:
- id: terraform
desc: |
### Configure a SAML application with Terraform
>Note: If you receive the error `You do not have permission to access the feature you are requesting` contact support and request feature flag `ADVANCED_SSO` be applied to your org.
```
resource "okta_app_saml" "example" {
label = "example"
sso_url = "https://example.com"
recipient = "https://example.com"
destination = "https://example.com"
audience = "https://example.com/audience"
subject_name_id_template = "$${user.userName}"
subject_name_id_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
response_signed = true
signature_algorithm = "RSA_SHA256"
digest_algorithm = "SHA256"
honor_force_authn = false
authn_context_class_ref = "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"
attribute_statements {
type = "GROUP"
name = "groups"
filter_type = "REGEX"
filter_value = ".*"
}
}
```
### Configure an OIDC provider with Terraform
```
resource "okta_idp_oidc" "example" {
name = "example"
authorization_url = "https://idp.example.com/authorize"
authorization_binding = "HTTP-REDIRECT"
token_url = "https://idp.example.com/token"
token_binding = "HTTP-POST"
user_info_url = "https://idp.example.com/userinfo"
user_info_binding = "HTTP-REDIRECT"
jwks_url = "https://idp.example.com/keys"
jwks_binding = "HTTP-REDIRECT"
scopes = ["openid"]
client_id = "efg456"
client_secret = "efg456"
issuer_url = "https://id.example.com"
username_template = "idpuser.email"
}
```
- uid: mondoo-okta-security-enable-suspicious-activity-reporting
title: Enable Suspicious Activity Reporting
impact: 80
docs:
desc: |
When a user reports suspicious activity, admins can enable specific actions and System Log events to obtain further details about the activity.
### Okta Recommends
Enable Suspicious Activity Reporting for end-user reporting.
### Security impact
High
### User impact
Low
variants:
- uid: mondoo-okta-security-enable-suspicious-activity-reporting-api
- uid: mondoo-okta-security-enable-suspicious-activity-reporting-terraform-hcl
- uid: mondoo-okta-security-enable-suspicious-activity-reporting-terraform-plan
- uid: mondoo-okta-security-enable-suspicious-activity-reporting-api
title: Enable Suspicious Activity Reporting
impact: 80
filters: asset.platform == "okta-org"
mql: okta.organization.securityNotificationEmails['reportSuspiciousActivityEnabled'] == true
docs:
remediation:
- id: console
desc: |
### Enable or disable Security Notification emails
If you disable this feature, all valid links expire immediately.
If you disable the Report suspicious activity via email option, the Report Suspicious Activity button is removed from the email templates that use it.
When you enable the Report suspicious activity via email option, events reported when users select the Report Suspicious Activity button appear on the Admin Console. Select Review Security Event to view the event details in the System Log. The event name is:
```
user.account.report_suspicious_activity_by_enduser
```
The following email templates include the Report Suspicious Activity button:
- New Sign-On Notification
- Authenticator Enrolled
- Authenticator Reset
- Password Changed
1. In the Admin Console, go to SecurityGeneral.
2. In the Security notification emails section, select Edit.
3. Select either Enabled or Disabled from the dropdown beside the option that you want to enable or disable.
4. Select Save.
- uid: mondoo-okta-security-enable-suspicious-activity-reporting-terraform-hcl
title: Enable Suspicious Activity Reporting
impact: 80
filters: asset.platform == "terraform-hcl" && terraform.providers.any( nameLabel == "okta" )
mql: terraform.resources.where( nameLabel == "okta_security_notification_emails" ).any( arguments['report_suspicious_activity_enabled'] == /var/ || arguments['report_suspicious_activity_enabled'] == true )
docs:
remediation:
- id: terraform
desc: |
```
resource "okta_security_notification_emails" "example" {
report_suspicious_activity_enabled = true
send_email_for_factor_enrollment_enabled = true
send_email_for_factor_reset_enabled = true
send_email_for_new_device_enabled = true
send_email_for_password_changed_enabled = true
}
```
- uid: mondoo-okta-security-enable-suspicious-activity-reporting-terraform-plan
title: Enable Suspicious Activity Reporting
impact: 80
filters: asset.platform == "terraform-plan" && terraform.plan.resourceChanges.contains( providerName == /okta/ )
mql: terraform.plan.resourceChanges.where( type == /okta_security_notification_emails/ ).all( change.after['report_suspicious_activity_enabled'] == true )
docs:
remediation:
- id: terraform
desc: |
```
resource "okta_security_notification_emails" "example" {
report_suspicious_activity_enabled = true
send_email_for_factor_enrollment_enabled = true
send_email_for_factor_reset_enabled = true
send_email_for_new_device_enabled = true
send_email_for_password_changed_enabled = true
}
```
- uid: mondoo-okta-security-sign-on-notifications-for-end-users
title: Enable sign-on notifications for end users
impact: 80
docs:
desc: |
When enabled, this email notification notifies end users of any sign-in activity. The email contains user sign-on details such as the web browser, operating system used to sign in, and time and location of authentication.
### Okta Recommends
Enable this email notification so end users are informed about new sign-on activity, which can inform them if a different user has signed in to their account.
### Security impact
High
### User impact
Low
End users receive an email notification if they sign in from a new or unrecognized client.
### Known limitations
Currently, new sign-on notifications don't use Improved New Device Behavior Detection when sending email notifications for new sign-ins. Changes to `deviceToken` or browser cookies may not trigger a new sign-on email notification.
variants:
- uid: mondoo-okta-security-sign-on-notifications-for-end-users-api
- uid: mondoo-okta-security-sign-on-notifications-for-end-users-terraform-hcl
- uid: mondoo-okta-security-sign-on-notifications-for-end-users-terraform-plan
- uid: mondoo-okta-security-sign-on-notifications-for-end-users-api
title: Enable sign-on notifications for end users
impact: 80
filters: asset.platform == "okta-org"
mql: okta.organization.securityNotificationEmails['sendEmailForNewDeviceEnabled'] == true
docs:
remediation:
- id: console
desc: |
### Enable sign-on notification emails for end users
1. In the Admin Console, go to **Security > General**.
2. Under **Security Notification Emails**, select **Edit**.
3. Set **New sign-on notification email** to **Enabled**.
4. Select **Save**.
- uid: mondoo-okta-security-sign-on-notifications-for-end-users-terraform-hcl
title: Enable sign-on notifications for end users
impact: 80
filters: asset.platform == "terraform-hcl" && terraform.providers.any( nameLabel == "okta" )
mql: terraform.resources.where( nameLabel == "okta_security_notification_emails" ).any( arguments['send_email_for_new_device_enabled'] == /var/ || arguments['send_email_for_new_device_enabled'] == true )
docs:
remediation:
- id: terraform
desc: |
```
resource "okta_security_notification_emails" "example" {
report_suspicious_activity_enabled = true
send_email_for_factor_enrollment_enabled = true
send_email_for_factor_reset_enabled = true
send_email_for_new_device_enabled = true
send_email_for_password_changed_enabled = true