In my laravel project I have set up file and directory permissions with myself as the owner following the answer in the post How to set up file permissions for Laravel? as follows:
sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;
And the storage and cache folder writable as follows:
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
In this application I've also use laravel passport which generates the passpot keys inside the storage folder and therefore the permission for the keys are as follows:
-rwxrwxr-- 1 sammy www-data 3322 Mar 11 14:32 oauth-private.key
-rwxrwxr-- 1 sammy www-data 812 Mar 11 14:32 oauth-public.key
That means everyone can read those files. would that be secure?