![]() |
|
|||||||
| Notices |
| Projects: Audio, Graphics, Video, HTPC and Programming Discuss your software and hardware projects, web sites, programming, music, design and home theatre and other set-ups here. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||||
|
I'm doing a bit of a "backup audit"... in other words, setting up automated backups for every piece of technology that I depend on in any significant way that is automatically backupable. One of these devices is my home modem/router.
I have worked out how to backup the router configuration using a combination of curl commands and basic HTTP authentication. I have written a nice Ruby backup script that downloads the backup, runs it through bzip2, then puts it in a dated folder. I want this script to run every 24 hours. A launchd Daemon set to fire every 24 hours seems like the appropriate way to do it. There are two security concerns here - one is that the script itself stores the username/password in cleartext. The other is that the downloaded config files have my router username/password in cleartext. For the script, what's the best security policy? Should I make a new user named "backups", and make the script file only accessible to the "backups" user, then run the launchd Daemon as the "backups" user? Is there a better way? For the actual backup files themselves, does anyone have any good suggestions? I guess I could make all the backup files only readable by "backups" as well, which would require a sudo or other authentication to access them. How does one normally solve the problem of username/password credentials as cleartext in a script? edit: for the moment, I have made the script Root:Wheel, with 700 permissions. launchd Daemons default to run as root, so it runs just fine.
__________________
"The need is not for, say, half a million ¼-inch drill bits. The need is that there are ten million ¼-inch holes that need to be drilled." - Robert Noyce forgecode.net Last edited by forgie; 7th April 2009 at 04:27 PM. |
|
|
|||||
|
if run as root surely is fairly secure but may i ask:
Does your router config actually change on a daily basis? why not manually backup when you make changes?
__________________
Mac Pro Dual Intel Xeon 2.8GHz Quad, 6GB Ram, 320GB HDD, Nvidia 8800GT, Mac OS X 10.5.6 MacBook White 2GHz Intel Core Duo, 2GB Ram, 250GB HD AusDataHost | My Flickr | Portfolio/Photoblog |
|
|||||
|
No, I probably change my router config on average every 2 weeks or so. The problem is that I forget to back it up. I want to have a Time Machine style system that automatically has the latest copy of everything. Ultimately I want the peace of mind of knowing that I always have the latest data in a safe place.
__________________
"The need is not for, say, half a million ¼-inch drill bits. The need is that there are ten million ¼-inch holes that need to be drilled." - Robert Noyce forgecode.net |
|
||||
|
Interesting dilemma.
I'm wondering whether you're able to SSH to the router? If so, you could use a public/private key pair to do the authentication to the router, then download your configs across the SSH session. Of course, you probably shouldn't be running the script as root, but some other user with no password defined, and no shell. |
|
|||||
|
Unfortunately, this router (Billion 7401VGP) doesn't have SSH. I'll be setting something similar up for someone else who does have networking gear that has SSH access though, so that'll be how I do it for them.
As for storing the backup files, what's involved in using GPG? Are there any other easy options (that use pre-existing OSX components) for say, encrypting a file so that you need a specific password to decrypt it?
__________________
"The need is not for, say, half a million ¼-inch drill bits. The need is that there are ten million ¼-inch holes that need to be drilled." - Robert Noyce forgecode.net |
![]() |
| Bookmarks |
| Tags |
| backup, implications, password, script, security |
| Thread Tools | |
| Display Modes | |
|
|