Showing posts with label permission. Show all posts
Showing posts with label permission. Show all posts

Saturday, 25 February 2012

Confused About Permission

I read a few articles on best SQL practices and they kept coming back to using a Least Privileged Account. So I did so and gave that account read only permissions. The articles also said to do updates use Stored Procedures - so I created stored procedures for updating/deleting data.

So here's my problem - I connect to the database using the Least Privileged Account, I use the Stored Procedures, but .NET keeps saying I lack permissions. If I GRANT the Least Privileged Account UPDATE/DELETE permission on the table, the Stored Procedures run perfectly. But isn't that EXACTLY what I'm trying to avoid?

My greatest concern is someone hacks my website and using the Least Privileged Account, they delete all my data using that account. So I don't want to give the Least Privileged Account the Update/Delete privileges.

Thanks a MILLION in advance!

Do you grant EXECUTE permission on the stored procedures to the account?

Once that is done you do not need UPDATE/DELETE on the tables for the account.

|||I granted execute permissions to the stored procedures, but it still fails when I check OFF the Update permission on the table (and still works when I check ON the Update permission). Any other ideas?|||

I figured out my problem (thanks to TATWORTH). I was creating the SP's while logging in as the least privileged account, so therefore the SP was [LeastPrivilegedAccount].[StoredProcedureName] - this required the Least privileged user to have the permissions. Now I created the SP's as [dbo].[StoredProcedureName] and granted the Least privileged user EXECUTE permissions.

It works perfectly! Thanks a MILLION!!1Big Smile

Friday, 24 February 2012

Conflict of Permissions by NT Groups

Hi,

This is regarding permission issue in windows-authenticated sql server 2000.

I have two NT groups namely A & B.

Groups A has all permissions on SQLDB1 while group B has all on SQLDB1 and SQLDB2.

Since I dont want B to have INS/UPD/DEL rights on SQLDB1, I revoked those permissions for B on the same. But users belonging to both groups suffer INS/UPD/DEL rights on SQLDB1.

Could anyone help please ?

Thanks in advance.

Use DENY instead of REVOKE.

--

Tibor Karaszi, SQL Server MVP

http://www.karaszi.com/sqlserver/default.asp

http://www.solidqualitylearning.com/

Blog: http://solidqualitylearning.com/blogs/tibor/

wrote in message

news:2d0faecd-406e-4bcd-9aba-70fc886637ce@.discussions.microsoft.com...

> Hi,

>

> This is regarding permission issue in windows-authenticated sql server

> 2000.

>

> I have two NT groups namely A & B.

>

> Groups A has all permissions on SQLDB1 while group B has all on SQLDB1

> and SQLDB2.

>

> Since I dont want B to have INS/UPD/DEL rights on SQLDB1, I revoked

> those permissions for B on the same. But users belonging to both groups

> suffer INS/UPD/DEL rights on SQLDB1.

>

> Could anyone help please ?

>

> Thanks in advance.

>

>|||

I tried DENY too. Result is the same as before.

|||

Can you explain in more detail what commands you executed? Also, can you check the catalog to verify that permissions are granted/denied as intended. The database permissions catalog is sys.database_permissions.

Thanks
Laurentiu

|||There is no such a table called sys.database_permissions in sql server 2000. Thanks.|||

In SQL 2000 you can use sysprotects. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sys-p_0837.asp, for a description.

Thanks
Laurentiu

Conflict of Permissions by NT Groups

Hi,

This is regarding permission issue in windows-authenticated sql server 2000.

I have two NT groups namely A & B.

Groups A has all permissions on SQLDB1 while group B has all on SQLDB1 and SQLDB2.

Since I dont want B to have INS/UPD/DEL rights on SQLDB1, I revoked those permissions for B on the same. But users belonging to both groups suffer INS/UPD/DEL rights on SQLDB1.

Could anyone help please ?

Thanks in advance.

Use DENY instead of REVOKE.

--

Tibor Karaszi, SQL Server MVP

http://www.karaszi.com/sqlserver/default.asp

http://www.solidqualitylearning.com/

Blog: http://solidqualitylearning.com/blogs/tibor/

wrote in message

news:2d0faecd-406e-4bcd-9aba-70fc886637ce@.discussions.microsoft.com...

> Hi,

>

> This is regarding permission issue in windows-authenticated sql server

> 2000.

>

> I have two NT groups namely A & B.

>

> Groups A has all permissions on SQLDB1 while group B has all on SQLDB1

> and SQLDB2.

>

> Since I dont want B to have INS/UPD/DEL rights on SQLDB1, I revoked

> those permissions for B on the same. But users belonging to both groups

> suffer INS/UPD/DEL rights on SQLDB1.

>

> Could anyone help please ?

>

> Thanks in advance.

>

>|||

I tried DENY too. Result is the same as before.

|||

Can you explain in more detail what commands you executed? Also, can you check the catalog to verify that permissions are granted/denied as intended. The database permissions catalog is sys.database_permissions.

Thanks
Laurentiu

|||There is no such a table called sys.database_permissions in sql server 2000. Thanks.|||

In SQL 2000 you can use sysprotects. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sys-p_0837.asp, for a description.

Thanks
Laurentiu