[With apologies for a long, rambling question. I'm hoping to spark some discussion/suggestions from folks much more knowledgeable than I am. If this really isn't appropriate for SO, please give me a hint where to ask this sort of question.]
I have an ASP.NET MVC 4 app. I'm using an Azure web role to host it (for now, at least). My app, which is a specialized medical interview, collects sensitive information from users and produces a report that is viewable by, and deliverable to (via an encrypted PDF file attached to an unencrypted email) doctors and patients. The sensitive data is retained for 24 hours to allow doctors to come back and retrieve reports, after which time the records are deleted (which, I know does not actually remove the data from persistent storage).
So I'm starting to think about what I need to worry about with regards to security boundaries to keep the confidential data confidential. I'm new to this whole web programming thing, although I'm a very experienced desktop app developer.
The first, obvious security boundary I need to worry about is the communication layer between the server and the users. I have a valid, properly configured SSL certificate and all of the sections of the website that deal with logged-in users (which includes the interview and reporting workflow) operate over an HTTPS endpoint.
I am assuming/hoping that Azure has its SSL implementation correct and that there is nothing that I can or should do to harden the host itself.
For user convenience, I do allow visitors to browse to http://mywebsite.com, and I redirect to a page marked with [RequiresHttps] if and when they are logged in. I understand that this HTTP-to-HTTPS redirection is vulnerable to an SSLStrip man-in-the-middle attack, in which the server sees a secure HTTPS connection but the vigilant user would notice that the URL is HTTP and not HTTPS. I plan to keep this convenience feature, but I will mitigate it by employing an extended validation certificate, which gives most users a happy, green address bar. I'll put something on the main logged-in-user page that reminds the user to verify the green address bar.
I'll figure out how to configure ASP.NET so that all of my cookies are encrypted.
I've enabled Remote Desktop (in the Azure deployment wizard), so that opens up a portal that can be attacked if someone can figure out my username and password. C'est la vie.
The next security boundary I need to worry about -- and this is where I need help -- is protecting sensitive data in the event that an unauthorized person gains access to the database. My knowledge of database administration is pretty much limited to copying and pasting connection strings and writing simple SQL queries.
I'm using Entity Framework and Azure SQL Databases for all of my database stuff. I encrypt the sensitive data in the data entities using a key baked into my code. Presumably, the database itself is encrypted and someone who just got hold of the database files (the Azure SQL Databases interface is accessible via a web connection, but only from trusted IP addresses) would need to figure out my SQL username and password to pull the data out.
Someone could presumably trick my app into revealing sensitive information. My workflow only allows a logged in user to read and write his own records. In order for an attacker to access the encrypted sensitive data, they would either need to get my encryption key or figure out a way to call into my code. I have not obfuscated the .NET code; I assume that my executables are secure. I also assume that my clear-text web.config, which contains my database credentials, is secure. Are these good assumptions?
So, that's as far as my beginner brain has taken me down the security path. Any comments or suggestions? Have I made any incorrect assumptions or overlooked anything obvious?