Re: Grant access to applications only



ulrich schumacher (ulrichschumacher@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
Is there a way to allow a .net application write access to sql server
but to deny a direct user login e.g. via management studio.

The background is that the users must not be able to manipulate the data
directly but only within the application. Integrated security should be
used as authentication type.

There are a couple of ways to achieve that, but all have quite
hefty repercussions:

* Make all access through stored procedures, and remove direct access to
the tables. Good start, but if users can access SSMS, they can run the
procs manually, so you need to have your procedures to do all business
logic.

* Use application roles. This is only good for a three-tier application,
where you can hide the password in the middle layer somewhere the
users cannot access it. On a two-tier application, the users can always
find the password if they want to.

* Use a proxy user. Again, this requires a three-tier application. The
middle tier authenticates the users, connect to the database, and
then impersonate the users. The users however, do not have their own
login to the server.

Undoubtedly, this last method is the safest.

In short, to achieve what you are asking for, you need to design
your application for it.


--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: Grant access to applications only
    ... but to deny a direct user login e.g. via management studio. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.security)
  • Re: Grant access to applications only
    ... Solid Quality Mentors ... Is there a way to allow a .net application write access to sql server but ... deny a direct user login e.g. via management studio. ...
    (microsoft.public.sqlserver.security)
  • Re: Query training -- Complex queries
    ... > Update PositionsEOM ... Here you don't have a derived table, but a correlated subquery. ... UPDATE in Books Online. ... is not written for SQL Server. ...
    (microsoft.public.sqlserver.server)
  • Re: Linked Server: How to check if server exists?
    ... The root problem is described in the Books Online topic Batches. ... Rick Byham, SQL Server Books Online ... linked server don't run on those development machines not having that linked ...
    (microsoft.public.sqlserver.connect)
  • Re: STORED PROCEDURE - passing table name as a parameter
    ... T-SQL, is that you get problems if the view definition does not fit into ... will need to query other system tables, for instance syscolumns. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)