Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-80962

Remove any SMS implementation and admin settings no longer in use

XMLWordPrintable

    • MOODLE_404_STABLE
    • MDL-80962-main
    • Hide

      When it comes to testing, this resource for testing SMS sending in AWS will likely come in handy: https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html

      Prerequisites

      To test this issue you'll need a Moodle that you have admin access to.

      You will need a resource for testing SMS sending in AWS.

      Having an admin account makes it easier to move through all of the test settings.
      If you don't have cli access to the instance make sure you have access to two separate admin accounts. As part of the testing, it will lock out a user.

      Set up your SMS Sandbox

      1. Access to https://signin.aws.amazon.com with your credentials.
      2. From your AWS Console go to Amazon SNS / Mobile / Text messaging(SMS) and enable it.
      3. Include some "Sandbox destination phone numbers"
      4. From Security credentials: create a new Access keys for this and save the "Key", "Secret" and Region for the configuration in Moodle. 

      More information about SMS sandbox can be found 

      Test Mobile phone SMS Authentication (upgrade):

      1. Stand up a Moodle instance using the 404 branch (Don't apply the patch yet).
      2. Access to your Moodle as admin user.
      3. Navigate to: Site administration > plugins > administration tools > Multi-factor authentication.
      4. Enable the "MFA plugin enabled" Checkbox.
      5. Go to "SMS mobile phone".
      6. Enable the factor and include the AWS credentials created before.
      7. Apply the patch and upgrade the site.
      8. Navigate to: Site administration > plugins > administration tools > Multi-factor authentication.
      9. Confirm you can see the new setting SMS gateway.
      10. Confirm the SMS gateway setting has the following option selected: MFA AWS Default (AWS).
      11. Navigate to: Site administration > plugins > SMS > Manage SMS Gateways.
      12. Confirm you can see the following gateway in the table: MFA AWS Default (AWS).
      13. Click the toggle to disable the gateway.
      14. Confirm you can see the notification that it's in use and can not be disabled.
      15. Click the Delete action to delete the gateway.
      16. Confirm you can see the notification that it's in use and can not be deleted.
      17. Click the Edit action to edit the gateway.
      18. Confirm you can see the same credentials you had set up in MFA.
      19. Access to your user preferences / "Multi-factor authentication preferences".
      20. Set up the "SMS mobile phone" factor with a test phone number.
      21. Confirm you have received an SMS in your phone number.
      22. Enter the code you received and continue. 
      23. Open another browser and access Moodle with your user.
      24. Enter your username and password.
      25. Confirm a new screen will be displayed where it will ask for the Mobile phone SMS.
      26. Confirm you have received an SMS on your mobile. 
      27. Enter the code in the box and click on verify code.
      28. Confirm you have been login successfully and you have access to Moodle.

      Test Mobile phone SMS Authentication (fresh install):

      1. Stand up a Moodle instance using this patch.
      2. Access to your Moodle as admin user.
      3. Navigate to: Site administration > plugins > SMS > Manage SMS Gateways.
      4. Click Create a new SMS gateway button.
      5. Fill all the fields using the AWS credentials created initially.
      6. Save changes.
      7. Click the toggle to disable the gateway.
      8. Confirm that the gateway is disabled.
      9. Click the Edit action.
      10. Change the name of the gateway.
      11. Confirm that the gateway is updated with the new name.
      12. Click the Delete action
      13. Select continue button in the dialogue.
      14. Confirm that the gateway is deleted.
      15. Create another SMS gateway using the same credentials.
      16. Navigate to: Site administration > plugins > administration tools > Multi-factor authentication.
      17. Enable the "MFA plugin enabled" Checkbox.
      18. Confirm you can see the new setting SMS gateway.
      19. Select the created SMS gateway in the SMS gateway setting.
      20. Save changes.
      21. Access to your user preferences / "Multi-factor authentication preferences".
      22. Set up "Mobile phone SMS" factor with a test phone number.
      23. Confirm you have received an SMS in your phone number.
      24. Enter the code you received and continue. 

       

      NOTE: If you mess things up and locked yourself out, you can disable the whole MFA plugin from the CLI:

      php admin/cli/cfg.php --component=tool_mfa --name=enabled --set=0

      Note2: Reset user authentication factors

      1. Access to your Moodle as admin user
      2. Go to "Plugins" / Multi-factor authentication / Reset user authentication factors
      3. Search by one user with authentication factors
      4. Click on button "Reset user factor"
      1. Open another browser and access to Moodle with your user.
      2. Enter your username and password.
      3. Confirm a new screen will be display where it will ask for the Mobile phone SMS.
      4. Confirm you have received an SMS in your mobile. 
      5. Enter the code in the box and click on verify code.
      6. Confirm you have been login successfully and you have access to Moodle.
      Show
      When it comes to testing, this resource for testing SMS sending in AWS will likely come in handy: https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html Prerequisites To test this issue you'll need a Moodle that you have admin access to. You will need a resource for testing SMS sending in AWS. Having an admin account makes it easier to move through all of the test settings. If you don't have cli access to the instance make sure you have access to two separate admin accounts. As part of the testing, it will lock out a user. Set up your SMS Sandbox Access to https://signin.aws.amazon.com with your credentials. From your AWS Console go to Amazon SNS / Mobile / Text messaging(SMS) and enable it. Include some "Sandbox destination phone numbers" From Security credentials: create a new Access keys for this and save the "Key", "Secret" and Region for the configuration in Moodle.  More information about SMS sandbox can be found  https://aws.amazon.com/blogs/compute/introducing-the-sms-sandbox-for-amazon-sns/ https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox-verifying-phone-numbers.html https://docs.aws.amazon.com/sns/latest/dg/sns-getting-started.html Test Mobile phone SMS Authentication (upgrade): Stand up a Moodle instance using the 404 branch (Don't apply the patch yet). Access to your Moodle as admin user. Navigate to: Site administration > plugins > administration tools > Multi-factor authentication. Enable the "MFA plugin enabled" Checkbox. Go to "SMS mobile phone". Enable the factor and include the AWS credentials created before. Apply the patch and upgrade the site. Navigate to: Site administration > plugins > administration tools > Multi-factor authentication. Confirm you can see the new setting SMS gateway. Confirm the SMS gateway setting has the following option selected: MFA AWS Default (AWS). Navigate to: Site administration > plugins > SMS > Manage SMS Gateways. Confirm you can see the following gateway in the table: MFA AWS Default (AWS). Click the toggle to disable the gateway. Confirm you can see the notification that it's in use and can not be disabled. Click the Delete action to delete the gateway. Confirm you can see the notification that it's in use and can not be deleted. Click the Edit action to edit the gateway. Confirm you can see the same credentials you had set up in MFA. Access to your user preferences / "Multi-factor authentication preferences". Set up the "SMS mobile phone" factor with a test phone number. C onfirm you have received an SMS in your phone number. Enter the code you received and continue.  Open another browser and access Moodle with your user. Enter your username and password. C onfirm a new screen will be displayed where it will ask for the Mobile phone SMS. C onfirm you have received an SMS on your mobile.  Enter the code in the box and click on verify code. C onfirm you have been login successfully and you have access to Moodle. Test Mobile phone SMS Authentication (fresh install): Stand up a Moodle instance using this patch. Access to your Moodle as admin user. Navigate to: Site administration > plugins > SMS > Manage SMS Gateways. Click Create a new SMS gateway button. Fill all the fields using the AWS credentials created initially. Save changes. Click the toggle to disable the gateway. Confirm that the gateway is disabled. Click the Edit action. Change the name of the gateway. Confirm that the gateway is updated with the new name. Click the Delete action Select continue button in the dialogue. Confirm that the gateway is deleted. Create another SMS gateway using the same credentials. Navigate to: Site administration > plugins > administration tools > Multi-factor authentication. Enable the "MFA plugin enabled" Checkbox. Confirm you can see the new setting SMS gateway. Select the created SMS gateway in the SMS gateway setting. Save changes. Access to your user preferences / "Multi-factor authentication preferences". Set up "Mobile phone SMS" factor with a test phone number. Confirm you have received an SMS in your phone number. Enter the code you received and continue.    NOTE :  If you mess things up and locked yourself out, you can disable the whole MFA plugin from the CLI : php admin/cli/cfg.php --component=tool_mfa --name=enabled --set=0 Note2: Reset user authentication factors Access to your Moodle as admin user Go to "Plugins" / Multi-factor authentication / Reset user authentication factors Search by one user with authentication factors Click on button "Reset user factor" Open another browser and access to Moodle with your user. Enter your username and password. C onfirm a new screen will be display where it will ask for the Mobile phone SMS. C onfirm you have received an SMS in your mobile.  Enter the code in the box and click on verify code. C onfirm you have been login successfully and you have access to Moodle.
    • 6
    • Team Hedgehog 2024 Sprint 2.3, Team Hedgehog 2024 Review 2, Team Hedgehog 2024 Sprint 3.1

      Once MFA is calling the SMS API for that factor, there will be some SMS/AWS implementation and admin settings related to those which are no longer used by any component. These should be removed.

      There is no deprecation process as these were introduced to main only in the current (4.4) release cycle.

      Note: This will be a must fix once MDL-80961 lands.

            safat.shahin@moodle.com Safat Shahin
            michaelh Michael Hawkins
            Raquel Ortega Raquel Ortega
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 51 minutes
                4h 51m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.