I am building a web application to store sensitive medical information into a database with TDE on. However my users are in 3 categories:
The medics who have access everywhere
Management who can only see certain pages and access certain tables/views
I.T. guys who will login and need to access a different database in the
SQL Serverto load up some dummy data so they can do their troubleshooting.
The first thing that came to mind was to create a user management system. I created one by asking the users to enter their own private password I made for each of them, but I am not sure what I should protect. So what I tried to do is to encrypt the SQL connection string using AES and the password I have provided each medic, and saved the encrypted string into a table in a different database.
When they launch the application, it will ask for their password which in turn will decrypt the corresponding connection string, store it in a cookie and protect it using Machine.Protect() found in asp.net 4.5
This way, I can use page permissions for allowing only the medics to access certain pages with certain reports. Allow management to see their own pages and thirdly when the I.T. guy goes in, he will have his own key that will decrypt a a different connection string to connect to a dummy database so he can do his troubleshooting.
Is this a safe way or can this be exploited easily? I would love to have any feedback on this.
All code calls to the SQL server is in a single class library dll, language used: asp.net and c#, we are using Active Directory to limit access in the first place.