diff --git a/admin/index.php b/admin/index.php index ba80a968322..d12212b5a0b 100644 --- a/admin/index.php +++ b/admin/index.php @@ -865,7 +865,7 @@ $eventshandlers = $DB->get_records_sql('SELECT DISTINCT component FROM {events_h $themedesignermode = !empty($CFG->themedesignermode); // Check if a directory with development libraries exists. -if (is_dir($CFG->dirroot.'/vendor') || is_dir($CFG->dirroot.'/node_modules')) { +if (empty($CFG->disabledevlibdirscheck) && (is_dir($CFG->dirroot.'/vendor') || is_dir($CFG->dirroot.'/node_modules'))) { $devlibdir = true; } else { $devlibdir = false; diff --git a/config-dist.php b/config-dist.php index 48d89d76a0a..094ffb49dd3 100644 --- a/config-dist.php +++ b/config-dist.php @@ -465,6 +465,13 @@ $CFG->admin = 'admin'; // // $CFG->disableupdateautodeploy = true; // +// Use the following flag to disable the warning on the system notifications page +// about present development libraries. This flag will not disable the warning within +// the security overview report. Use this flag only if you really have prohibited web +// access to the development libraries in your webserver configuration. +// +// $CFG->disabledevlibdirscheck = true; +// // Use the following flag to disable modifications to scheduled tasks // whilst still showing the state of tasks. // diff --git a/lang/en/admin.php b/lang/en/admin.php index f2ad60bc7a0..20eaac3b6a9 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -440,7 +440,7 @@ $string['deleteunconfirmed'] = 'Delete not fully setup users after'; $string['deleteuser'] = 'Delete user'; $string['density'] = 'Density'; $string['denyemailaddresses'] = 'Denied email domains'; -$string['devlibdirpresent'] = 'Directories with development libraries such as vendor or node_modules should not be present on public sites. See the security overview report for more details.'; +$string['devlibdirpresent'] = 'Directories with development libraries, especially /vendor and /node_modules, should not be present on public sites. See the security overview report for more details.'; $string['development'] = 'Development'; $string['devicedetectregex'] = 'Device detection regular expressions'; $string['devicedetectregex_desc'] = '

By default, Moodle can detect devices of the type default (desktop PCs, laptops, etc), mobile (phones and small hand held devices), tablet (iPads, Android tablets) and legacy (Internet Explorer 6 users). The theme selector can be used to apply separate themes to all of these. This setting allows regular expressions that allow the detection of extra device types (these take precedence over the default types).

diff --git a/report/security/lang/en/report_security.php b/report/security/lang/en/report_security.php index 1cdb6a9e5aa..a389768411d 100644 --- a/report/security/lang/en/report_security.php +++ b/report/security/lang/en/report_security.php @@ -80,7 +80,7 @@ $string['check_noauth_details'] = '

The No authentication plugin is n $string['check_noauth_error'] = 'The No authentication plugin cannot be used on production sites.'; $string['check_noauth_name'] = 'No authentication'; $string['check_noauth_ok'] = 'No authentication plugin is disabled.'; -$string['check_nodemodules_details'] = '

The directory {$a->path} contains Node.js modules and their dependencies, typically installed by the NPM utility. These modules may be required for Moodle development. They are not needed to run a Moodle site and they can contain potentially dangerous code exposing your site to remote attacks.

It is strongly recommended to remove the directory if the site is available via a public URL, or at least prohibit web access to it.

'; +$string['check_nodemodules_details'] = '

The directory {$a->path} contains Node.js modules and their dependencies, typically installed by the NPM utility. These modules may be needed for local Moodle development, such as for using the grunt framework. They are not needed to run a Moodle site in production and they can contain potentially dangerous code exposing your site to remote attacks.

It is strongly recommended to remove the directory if the site is available via a public URL, or at least prohibit web access to it in your webserver configuration.

'; $string['check_nodemodules_info'] = 'The node_modules directory should not be present on public sites.'; $string['check_nodemodules_name'] = 'Node.js modules directory'; $string['check_openprofiles_details'] = 'Open user profiles can be abused by spammers. It is recommended that either Force users to log in for profiles or Force users to log in are enabled.'; @@ -124,7 +124,7 @@ $string['check_unsecuredataroot_error'] = 'Your dataroot directory {$a}