Framework: [5.0] Log file permissions

Created on 20 Nov 2014  路  2Comments  路  Source: laravel/framework

Example:
http://laravel.local/404page - Generates an error, which is written to a new log file with permissions 644
php artisan unknowcmd - Generates an error and can not write it to a log file because the user running that script, do not have write this file because it was created by the www-data with permissions 644

If the log file will be created depending on the SAPI, or with permissions 777, then this problem will not.

If we use the daily log, then we'll have to do *chmod ugo+w storage/logs/** each time you create a new log file.

My solution to this problem was in this pull request https://github.com/laravel/framework/pull/6441

Most helpful comment

This solution is completely unacceptable. Securing a system requires separating concerns to different users. Why is it so hard for Laravel to simply use the permissions given by the file system? Laravel should not assume the application administrator is incompetent and "fix" the permissions on the filesystem. This is completely broken and leads to continuous problems in any secured environment.

All 2 comments

You should run your HTTP requests (web server) under the same user. Or you can run the artisan command as www-data with sudo -u www-data php artisan unknowncmd.

I don't think this is something the framework should address. Most server configurations will be running under the same user.

This solution is completely unacceptable. Securing a system requires separating concerns to different users. Why is it so hard for Laravel to simply use the permissions given by the file system? Laravel should not assume the application administrator is incompetent and "fix" the permissions on the filesystem. This is completely broken and leads to continuous problems in any secured environment.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gabriellimo picture gabriellimo  路  3Comments

RomainSauvaire picture RomainSauvaire  路  3Comments

kerbylav picture kerbylav  路  3Comments

JamborJan picture JamborJan  路  3Comments

lzp819739483 picture lzp819739483  路  3Comments