Know which user runs each process
Record the user and group for the web server, application worker and deployment process. Avoid running every service as root or giving a shared account broad write access.
Separate files that the application only needs to read from directories where it must write temporary data or uploads.
Protect configuration and uploaded data
Restrict secrets and configuration files to the service accounts that need them. Keep uploaded files outside executable code paths and control who can read private documents.
Avoid world-writable directories. Review symbolic links and deployment paths so a writable location cannot replace trusted code.
Review after deployment changes
Check ownership and modes after releases, restores and hosting migrations. Confirm that logs and backups do not become readable to unrelated users.
Test the site after reducing permissions. Record the required access so the next deployment does not reintroduce broad write rights.
