SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Denying write access if not connected via the application.


Denying write access if not connected via the application.

Author
Message
Yusuf Bhiwandiwala
Yusuf Bhiwandiwala
SSC Veteran
SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)

Group: General Forum Members
Points: 294 Visits: 413
Hi,

Front end applications in my projects use the users' windows ids to get windows authenticated connections to SQL Server 2008 databases.
Since the applications modify data in tables and not necessarily through stored procedures, we have had to give "db_datawriter" role membership to all these windows authenticated users.
But this gives them a free hand to log into the databases using SSMS or even other clients, and potentially run any DML statement.

I'm looking for ways by which write access can be denied if it is not through the front end applications.
At the same time users should be allowed to read data i.e. run select statements through SSMS.

1) Encapsulating all application queries into stored procedures is out of my control and so application needs to run raw insert/update/delete statements.
2) Even if only stored procedures were used for DML, users could still directly run stored procedures via SSMS. So, this is also a problem.
3) Removing windows authentication and using two separate sql authenticated logins - read-only (for users) and read-write (for application) is an option. But we do not want to go this route unless left with no choice.

Have we exhausted all options?
Is there any other clever thing that can be done here please which we haven't been clever enough yet to think of? Smooooth
Yusuf Bhiwandiwala
Yusuf Bhiwandiwala
SSC Veteran
SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)

Group: General Forum Members
Points: 294 Visits: 413
Had a look at "Application Roles".

I think this is what we are looking for. Will try out and post back if the objective gets achieved or not.
There are some gotchas in the comments of this article that we'll need to be aware of:
schleep
schleep
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2613 Visits: 1405
Logon triggers might be a solution, have a look.

http://msdn.microsoft.com/en-us/library/bb326598.aspx



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search