So I have a web page that displays who's online. (See
http://www.sentinels.us). The web server and bot server are on separate computers.
The original web page was written by Beaker. To update the online list on the web page you load a special URL. PHP script takes in the parameters, updates the URL. In Beaker's version, access to the update script is limited to IP address. I want to improve that a bit...
My through was to use PHP's mcrypt functions and generate a security key. For example, the Bot and the web page would have a preshared encryption key and a pass phrase.
My idea for authentication is when the bot needs to update the webpage, it would take the passphrase, current UTC timestamp, and online users, encrypt that information with the shared key, and send that to the web server. If the web server can decrypt the string, the passphrase matches, and the timestamp is within tolerance (5 minutes) the web server's online list would update. Otherwise updates would be rejected.
Anyone sniffing the wire could replay the URL, but as all the information was encrypted replaying the encrypted string will only produce the same results as the bot produces, and that URL is only valid for a limited time.
Currently the bot module can only send updates to the web server once per minute, and it will only send an update if something has changed.
I know that this should work and should be reasonably secure for the application when using the right encryption...but what can be done to eliminate the possiblity of replay?
Track the most recent accepted time stamp I suppose...the next time stamp has to be greater than the previous.
Any suggestions or better methods would be appreciated.
