My environment is an AWS EC2 machine, with only one magento 2.2.3 store, with apache and Mysql. I've followed a few posts here from stackoverflow ([here](https://magento.stackexchange.com/questions/116470/what-are-the-final-production-file-permissions-for-magento-2-0-6) and [here](https://magento.stackexchange.com/questions/91870/magento-2-folder-file-permissions)) and [oficial documentation](https://devdocs.magento.com/guides/v2.2/config-guide/prod/prod_file-sys-perms.html), but I'm not sure if I got all we need here. I've been setting my folder permissions as:

```
sudo find . -type f -exec chmod 740 {} \;
sudo chmod u+x bin/magento;
sudo find . -type d -exec chmod 750 {} \;
./var/view_preprocessed \( -type d -or -type f \) -exec chmod 777 {} \;
sudo find ./pub/media -type d -exec chmod 775 {} \;
sudo find ./pub/static \( -type d -or -type f \) -exec chmod 775 {} \;
sudo find app/code lib pub/static app/etc generated/code generated/metadata var/view_preprocessed \( -type d -or -type f \) -exec chmod g-w {} \; && chmod o-rwx app/etc/env.php;
sudo find . -maxdepth 1 -type f -exec chmod g-wr {} \;
sudo chmod g+rx index.php .htaccess composer.json composer.lock && sudo chmod g-w .;

```

My question is, is this file permissions secure? There is something to get better, if so, why?