I have a simple Drupal 8.8.5 site running on Ubuntu 18.04 (PHP 7.3).
Before running drush fp, sites/default/files/.htaccess file is not writeable
-r--r--r-- 1 anthony www-data 543 Apr 11 09:15 .htaccess
After running drush fp, ownership (as expected) is changed to www-data; however it also changes the permission to writeable:
-rwxrwsr-x 1 www-data www-data 543 Apr 11 09:15 .htaccess*
This in turn trips up drush security-review which then reports:
The .htaccess file in the files directory is writable. warning
Are we taking a good installation and making it less secure by using drush fp. If so, that would seem to be counter to what is intended by using this module.
Interestingly enough, the behavior exists on D7 sites as well; however, it appears the drush security-review does not check the writeablity of the files .htaccess file for D7 sites.
Comments
Comment #2
turek commentedThank you for reporting this — you were absolutely right, this was a valid bug.
I have addressed this in the 2.x release of the module which supports
Drupal 9, 10 and 11. The `.htaccess` and `settings.php` files are now
explicitly set to read-only (0444) and excluded from the general file
permission (0664) that was incorrectly applied to all files including
`.htaccess` in the previous version.
If you are still on Drupal 8, please note that Drupal 8 has reached
end of life and it is recommend upgrading to Drupal 10 or 11.
The 2.x release of this module will then resolve the issue you reported.