Most secure way of setting up cron processing job
I have a PHP script which checks the mail server for new messages.
If it finds a new message, it will process the message (and attachment) and store the data.
Once complete it archives the email and is done!
I want to automate this process using the cron.
HOWEVER, I just want to take into consideration the security implications.
1. What would be the best way to configure the script so that it were only accessible via a cron job?
2. If there was ever a need to manually process - what would be the best way to build an override that allowed me (and only me) to access and process the file?
Make the file only accessible by the user account that owns the crontab you'll be running. E.g., if you'll be running the cron job as user "johndoe", then the file should be owned by johndoe and have its permissions set to 700 or 600 (read/write/execute or just read/write, only for the file owner). If you need to run it manually, just log in as that user and execute the same command as the crontab file uses.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread