@@ -627,3 +627,99 @@ The following global configuration should be configured:
627627
628628- ``saml2.timeout ``: SAML2 IDP Metadata refresh interval in seconds, minimum value is set to 300. Default is 1800
629629
630+ Using Two Factor Authentication For Users
631+ ------------------------------------------
632+
633+ CloudStack supports two factor authentication wherein users need to provide a 2FA code after the
634+ regular login using username and password. CloudStack currently supports Google Authenticator or
635+ other TOTP authenticators and static PIN as the 2FA providers. Other 2FA providers can be easily
636+ integrated with CloudStack using its plugin model.
637+
638+ .. Note :: 2FA is applicable to authentication mechanisms in CloudStack using username/password,
639+ LDAP, SAML. While using apikey/secretkey 2FA checks will be bypassed.
640+
641+ For admins, the following are the settings available at global and domain level to configure 2FA.
642+
643+ .. cssclass :: table-striped table-bordered table-hover
644+
645+ ================================================ ================ ===================================================================
646+ Global setting Default values Description
647+ ================================================ ================ ===================================================================
648+ enable.user.2fa false Determines whether 2FA is enabled or not
649+ mandate.user.2fa false Determines whether to make the 2FA mandatory or not for the users
650+ user.2fa.default.provider totp The default user 2FA provider plugin. Eg. totp, staticpin
651+ ================================================ ================ ===================================================================
652+
653+ If 2FA is configured for the user, the 2FA verification page looks like below after the login.
654+
655+ The verification page when the user configures 2FA using Google or other TOTP Authenticators.
656+
657+ .. image :: /_static/images/verify-2fa-totp.png
658+ :width: 400px
659+ :align: center
660+ :alt: Verify 2FA page using TOTP
661+
662+ The verification page when the user configures 2FA using Static PIN.
663+
664+ .. image :: /_static/images/verify-2fa-staticpin.png
665+ :width: 400px
666+ :align: center
667+ :alt: Verify 2FA page using static PIN
668+
669+ Users can configure 2FA in CloudStack using the action button in user form.
670+
671+ .. image :: /_static/images/configure-2fa-action-button.png
672+ :width: 400px
673+ :align: center
674+ :alt: Configure 2FA action button
675+
676+
677+ In the 2FA setup form, the user needs to select one of the providers. CloudStack currently supports
678+ Google Authenticator or other TOTP Authenticators and static PIN as the 2FA providers.
679+
680+ When the Google Authenticator or other TOTP 2FA provider is selected, the user must setup the account in
681+ the respective application in their device by either scanning the QR code or using the setup key provided
682+ by CloudStack. Once this is set up in the authenticator application, the user must always use the provided
683+ 2FA codes to log in.
684+
685+ .. image :: /_static/images/configure-google-2fa-form.png
686+ :width: 400px
687+ :align: center
688+ :alt: Configure Google 2FA form
689+
690+
691+ When the static PIN 2FA provider is selected, the user must use the static PIN as the code to verify 2FA
692+ with CloudStack. The user must input this static PIN as a 2FA code every time they need to login.
693+
694+ .. image :: /_static/images/configure-staticpin-2fa-form.png
695+ :width: 400px
696+ :align: center
697+ :alt: Configure static PIN 2FA form
698+
699+ The admin has the capability to mandate 2FA for users via the setting ``mandate.user.2fa ``.
700+ In this case the user must configure 2FA during their first login into CloudStack.
701+
702+ The user's first login page to configure 2FA looks like the below.
703+
704+ .. image :: /_static/images/configure-2fa-at-login-page.png
705+ :width: 400px
706+ :align: center
707+ :alt: Configure 2FA at login page
708+
709+
710+ For the existing users, the admin can mandate 2FA using the 'updateUser' API with the parameter 'mandate2FA'.
711+
712+ The admin can also disable 2FA for a user using the action button as shown below.
713+
714+ .. image :: /_static/images/disable-2fa.png
715+ :width: 400px
716+ :align: center
717+ :alt: Disable 2FA action button
718+
719+ .. Note :: [2FA Recovery process] :
720+ If the user loses the authenticator application or forgets the static PIN, then the user must
721+ contact admin to disable 2FA.
722+ If the admin themself loses the authenticator application or forgets the static PIN, then the admin
723+ will have to either use apikey to disable 2FA using the API setupUserTwoFactorAuthentication with
724+ enable flag to false or to do the database changes in 'user' table by clearing the columns
725+ 'is_user_2fa_enabled', 'key_for_2fa', 'user_2fa_provider' for the specific entry.
0 commit comments