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 ifdown and ifup.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.)
How to securely automate periodic website logins
login;web;hardening;selenium
Security is a tradeoff. As an extreme example, a system powered off, disconnected, and encased in a block of concrete is very secure but completely useless. You decide on which security measures you're willing to pay for (reduced usability, actual dollars spent, etc.) by analyzing how likely a breach is to occur, and how much it'll cost.Since this is apparently a machine dedicated to the task, I'd personally just stick it in a text file (or, stored only in memory were these more valuable passwords, like bank accounts) and do your step 1 [which you almost always should; turning off unused services is basically free].If it's possible to drive a web browser running as a different user, I'd do thatweb browsers have a huge attack surface. And of course make sure your browser security updates are applied.BTW: You missed some hardening steps, like iptables. Also, turning off ICMP echo IMO doesn't really give you any security, but makes network troubleshooting annoying. (Anything behind your firewall able to ping it could also do an ARP ping instead, which it has to respond to for Ethernet to work. Or any number of other protocol pings to see it's up.)