Moodle
  1. Moodle
  2. MDL-21042

Security overview report always displays warning for riskbackup

    Details

      Description

      Selecting 'Users > Permissions > Define roles > Administrator' from the admin block, I've set 'moodle/backup:userinfo' to Prevent, as I want to disable the option for any users of the site (including admins) to include user data in backups.

      I then checked the security overview report, and there was still a warning message displayed, despite there being no roles/overrides/users with that ability (see screenshot).

        Gliffy Diagrams

        1. MDL-21042.diff
          0.8 kB
          Paul Holden
        1. backupuserdatawarning.png
          39 kB

          Activity

          Hide
          Paul Holden added a comment -

          Attached patch checks the number of roles returned in the report_security_check_riskbackup() function and sets $result->status accordingly.

          Show
          Paul Holden added a comment - Attached patch checks the number of roles returned in the report_security_check_riskbackup() function and sets $result->status accordingly.
          Hide
          Michael de Raadt added a comment -

          Thanks for reporting this issue.

          We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

          If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

          Michael d;

          lqjjLKA0p6

          Show
          Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
          Hide
          Paul Holden added a comment -

          Hi Michael,

          Current 2.x versions are also affected by this. I've added links to my github that fix it in master.

          Show
          Paul Holden added a comment - Hi Michael, Current 2.x versions are also affected by this. I've added links to my github that fix it in master.
          Hide
          Michael de Raadt added a comment -

          Thanks for reporting this issue.

          We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

          If you believe that this issue is still relevant to current versions (2.3 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

          Michael d;

          4d6f6f646c6521

          Show
          Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.3 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; 4d6f6f646c6521
          Hide
          Paul Holden added a comment -

          Hi Michael,

          This issue is still present in the 'Security overview report'.

          Show
          Paul Holden added a comment - Hi Michael, This issue is still present in the 'Security overview report'.
          Hide
          Paul Holden added a comment -

          Michael de Raadt, I was just cleaning up a fresh Moodle 2.6.4 installation and ran the security report, only to notice that this is still present - despite the report stating that no roles/overrides/users had the capability to backup user data, there is still a "Warning".

          Show
          Paul Holden added a comment - Michael de Raadt , I was just cleaning up a fresh Moodle 2.6.4 installation and ran the security report, only to notice that this is still present - despite the report stating that no roles/overrides/users had the capability to backup user data, there is still a "Warning".
          Hide
          Mark Nelson added a comment -

          Since this issue has been around for a long time and there is a patch I am setting this to get peer reviewed. Once this review is done and approved this will need to be backported to 2.6 and 2.7. Thanks Paul for your patience.

          Show
          Mark Nelson added a comment - Since this issue has been around for a long time and there is a patch I am setting this to get peer reviewed. Once this review is done and approved this will need to be backported to 2.6 and 2.7. Thanks Paul for your patience.
          Hide
          Mark Nelson added a comment -

          Wow, your first message was over 4 years ago! Very patient indeed!

          Show
          Mark Nelson added a comment - Wow, your first message was over 4 years ago! Very patient indeed!
          Hide
          CiBoT added a comment -

          Fails against automated checks.

          Checked MDL-21042 using repository: git://github.com/paulholden/moodle.git

          • master (branch: MDL-21042 | CI Job)
            • Error: The MDL-21042 branch at git://github.com/paulholden/moodle.git is very old (>60 days ago). Please rebase against current master.

          More information about this report

          Show
          CiBoT added a comment - Fails against automated checks. Checked MDL-21042 using repository: git://github.com/paulholden/moodle.git master (branch: MDL-21042 | CI Job ) Error: The MDL-21042 branch at git://github.com/paulholden/moodle.git is very old (>60 days ago). Please rebase against current master. More information about this report
          Hide
          Mark Nelson added a comment -

          Hi Paul,

          The code is great, thanks. However, you are removing the comment "there is always at least one admin" which explains why this is always going to show as a warning.

          I think there are a few approaches to this issue -

          1. Stick with your patch.
          2. Edit the description so that it explains that the administrator can always perform this operation in addition to your patch.
          3. Edit the description so that it explains that the administrator can always perform this operation without including your patch.

          I am still undecided which approach is correct. I will need to talk to other devs to see what the general consensus is.

          Show
          Mark Nelson added a comment - Hi Paul, The code is great, thanks. However, you are removing the comment "there is always at least one admin" which explains why this is always going to show as a warning. I think there are a few approaches to this issue - Stick with your patch. Edit the description so that it explains that the administrator can always perform this operation in addition to your patch. Edit the description so that it explains that the administrator can always perform this operation without including your patch. I am still undecided which approach is correct. I will need to talk to other devs to see what the general consensus is.
          Hide
          Mark Nelson added a comment -

          I thought about it and am going with option 1. I will take your commit and backport. I guess it is up to the integrator to decide.

          Show
          Mark Nelson added a comment - I thought about it and am going with option 1. I will take your commit and backport. I guess it is up to the integrator to decide.
          Hide
          Paul Holden added a comment -

          Thanks for picking this up Mark Nelson

          Show
          Paul Holden added a comment - Thanks for picking this up Mark Nelson
          Hide
          CiBoT added a comment -

          Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!

          Show
          CiBoT added a comment - Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!
          Hide
          Marina Glancy added a comment -

          thanks for working on it. I agree that suck sticky warning status does look weird.
          Interesting statement:
          if (max($usercount, $systemrolecount, $overriddenrolecount) > 0)
          I would write
          if ($usercount || $systemrolecount || $overrideenrolecount)
          but it's not some error or coding style violation so I'll proceed with integration

          Show
          Marina Glancy added a comment - thanks for working on it. I agree that suck sticky warning status does look weird. Interesting statement: if (max($usercount, $systemrolecount, $overriddenrolecount) > 0) I would write if ($usercount || $systemrolecount || $overrideenrolecount) but it's not some error or coding style violation so I'll proceed with integration
          Hide
          Marina Glancy added a comment -

          Thanks Paul, Mark, integrated in 2.6, 2.7 and master

          Show
          Marina Glancy added a comment - Thanks Paul, Mark, integrated in 2.6, 2.7 and master
          Hide
          Simey Lameze added a comment -

          Thanks for work on this Mark, test passed.

          Show
          Simey Lameze added a comment - Thanks for work on this Mark, test passed.
          Hide
          Marina Glancy added a comment -

          Thank you, your change is now upstream!

          Show
          Marina Glancy added a comment - Thank you, your change is now upstream!

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: