diff --git a/CHANGELOG.md b/CHANGELOG.md index 739b6c74..55524601 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ Changelog", this file is a reverse-chronological list of merged pull requests. ## Open PR's +- [PR-167](https://github.com/itk-dev/devops_itkdev-docker/pull/167) - 2026-11-26 - + Block web access to Drupal's maintenance scripts. - [PR-135](https://github.com/itk-dev/devops_itkdev-docker/pull/135) - 2026-01-29 - Add Podman support with dynamic machine detection - [PR-126](https://github.com/itk-dev/devops_itkdev-docker/pull/126) - 2026-01-05 - diff --git a/templates/drupal-8/.docker/templates/default.conf.template b/templates/drupal-8/.docker/templates/default.conf.template index 8ff4314c..5ebe43c9 100644 --- a/templates/drupal-8/.docker/templates/default.conf.template +++ b/templates/drupal-8/.docker/templates/default.conf.template @@ -74,7 +74,29 @@ server { return 404; } - location ~ '\.php$|^/update.php' { + # Block web access to Drupal's maintenance scripts (update, install, cache + # rebuild, and authorize). Use drush and composer for these tasks instead. + location ^~ /update.php { + return 404; + } + + location ^~ /install.php { + return 404; + } + + location ^~ /core/install.php { + return 404; + } + + location ^~ /core/rebuild.php { + return 404; + } + + location ^~ /core/authorize.php { + return 404; + } + + location ~ '\.php$' { include fastcgi_params; fastcgi_buffers 16 32k; diff --git a/templates/drupal-9/.docker/templates/default.conf.template b/templates/drupal-9/.docker/templates/default.conf.template index 8ff4314c..5ebe43c9 100644 --- a/templates/drupal-9/.docker/templates/default.conf.template +++ b/templates/drupal-9/.docker/templates/default.conf.template @@ -74,7 +74,29 @@ server { return 404; } - location ~ '\.php$|^/update.php' { + # Block web access to Drupal's maintenance scripts (update, install, cache + # rebuild, and authorize). Use drush and composer for these tasks instead. + location ^~ /update.php { + return 404; + } + + location ^~ /install.php { + return 404; + } + + location ^~ /core/install.php { + return 404; + } + + location ^~ /core/rebuild.php { + return 404; + } + + location ^~ /core/authorize.php { + return 404; + } + + location ~ '\.php$' { include fastcgi_params; fastcgi_buffers 16 32k; diff --git a/templates/drupal/.docker/templates/default.conf.template b/templates/drupal/.docker/templates/default.conf.template index e77213bd..451bd598 100644 --- a/templates/drupal/.docker/templates/default.conf.template +++ b/templates/drupal/.docker/templates/default.conf.template @@ -74,7 +74,29 @@ server { return 404; } - location ~ '\.php$|^/update.php' { + # Block web access to Drupal's maintenance scripts (update, install, cache + # rebuild, and authorize). Use drush and composer for these tasks instead. + location ^~ /update.php { + return 404; + } + + location ^~ /install.php { + return 404; + } + + location ^~ /core/install.php { + return 404; + } + + location ^~ /core/rebuild.php { + return 404; + } + + location ^~ /core/authorize.php { + return 404; + } + + location ~ '\.php$' { include fastcgi_params; fastcgi_buffers 16 32k;