www.webdeveloper.com
Results 1 to 2 of 2

Thread: Most secure way of setting up cron processing job

  1. #1
    Join Date
    Dec 2013
    Location
    Melbourne, Australia
    Posts
    26

    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?

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,529
    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

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles