Re: Grant access to applications only



Hi Erland,

thanks a lot for your suggestions. I think i will give the third a try.

Best regards
Ulrich

"Erland Sommarskog" wrote:

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: ALTER PARTITION FUNCTION PartFunc() MERGE RANGE & blocking
    ... I hope MS fix this livelock problem in the next service pack. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.tools)
  • Re: IDENT_CURRENT and empty table
    ... >> And there is no definition what the result will be after fixing the bug. ... Books Online for 2005 is wrong and will be updated. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: sorting twice?!
    ... So I run a query to select the top 20 when ordered by datemodified ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: Rolling up spans without breaks between them
    ... CREATE TABLE periods (start datetime NOT NULL, ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)