Howdy,
Got an application (C# WPF) that needs to "call home" and get updated stuff from a home server. In theory there could be thousands of client out there, needing to communicate over the public internet.
Each user will first register with a username and a password. Then, as the application runs, it will call home every now and then for information about new versions, news, comments, messages for the user, and other application specific stuff. This will not be an application for "everyone", but as mentioned, there could still be quite a few users - so security is a priority. I want it to be very, very difficult to break in, but if impossible is an option, I'll go for that as well. :)
There are only a few basic operations that need to be supported;
- Initial registration of a new user
- Verifying username and password
- A "What's new since [TIMESTAMP]?" operation
- Client posting comments, messages, or other allowed user-generated content
The server side of things will be on a Win2008 server with IIS7. I don't have nearly the knowledge I need with WCF to implement this in the time I have for the project, so I will do some ASP.NET MVC 2 magic with XML files back and forth. If all you have is a hammer..
What I am looking for is advice on how to do this as securely as possible without making it impossible to use. Configuration on the client side will be persisted in an XML file. On the server side, most things will live in an SQL server.
I realize this will to a certain degree be a matter of opinion, but I also believe it should be possible to get to some kind of best practice where I can sleep at night not worrying about the client<->server communication and users having accounts hijacked etc.
- On the client side, password should be stored as a hash I guess? Or encrypted, with a way to get it back?
- I am thinking HTTPS between client and server for a nice default layer of security. Bad idea? No?
- Is it necessary to actually "log in" with this model? Should a username/password combination be sent with each request?
- If I go for https, is that secure enough at that point? Or should I still encrypt some of the authentication stuff?
- Is there a point to the server providing some kind of encryption "token", which can be used as a salt (I am not really familiar with the terminology here) to further encrypt username/password?
- Basically, how can I secure this system to the point where noone outside the client or server machines can steal account information? I realize of course that if the bad guys get ahold of a proper configuration file, then that account is compromised. This system will of course never allow any critical operations to take place using this communication, all that will happen on the server; Still, I consider account hacking a very very bad thing that I should take every possibel measure to avoid.
Any good ideas?
Thanks!