I'm writing a webpage-monitoring program that, every hour, logs in to a website using Selenium and notifies me if the page has changed in a particular way. For example, this program can monitor my cell phone data usage and warn me if my usage is spiking. However, I'm concerned about having my plaintext password just sitting on a machine that's perpetually connected to the Internet.
Q: What is a responsible way to automate periodic website logins?
I've considered the following precautions, in order of increasing paranoid-ness:
"Harden" the Linux distro -- turn off ping responses, CUPS, Java, SSH, Samba, and other unused services.
Encrypt the password on disk and hard-code the key in the program (like, use XOR to obfuscate the password a little).
Store the password only in RAM; that is, enter the password when I start the program. (So the program is always running; can't use
cron)Turn off the machine's network when the program isn't running using
ifdownandifup.Use a timed electrical outlet to -- once an hour -- physically power up the machine, let it run for a few minutes, and power it down (say, using this Art Controller relay board).
(BTW, I have the basic program working on a Raspberry Pi using Python and pyvirtualdisplay as described here, and I'm using Selenium because some websites of interest require JavaScript.)