473,395 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

SQL Server Object Security

Hello,

We are using Access Front End (ADP Project) and SQL Server 2000
backend. SQL Server is using NT Security.

We do not want the users to access the the underlying tables. So, we
went to each table and unchecked 'Select'. We also placed an 'X' in
all columns for guest and public account.

Next, we created a view. The view has 'Select' permission given to the
users (it is also enforcing some business rules on whether a record
should be returned).

Access XP is behaving as expected - the tables are not showing up, and
a report can be created using the view.

Here is the test situation we have set up:
User 'test_a' has 'select' allowed on the view.
Built in user 'public' and 'guest' were not allowed on the view.

When we configured the view as stated above, 'test_a' did not have
access to the view (even though we specifically granted). It appears
the 'public' must also have at least 'Select'.

It is not the case for a member of BUILTIN\Administrators.

Is this expected behavior? Does SQL server not follow the NT Security
model? Or am I simply missing something with the 'public' role?

Should I create roles, then add users to the roles (so I can remove
public). This seems a little different than the NT model of
users/groups.

Also, thanks to Simon and Pete for their previous replies.

Jeff
no******@yahoo.com
Jul 20 '05 #1
3 4790
> We also placed an 'X' in
all columns for guest and public account.
The red 'X' denotes an explicit DENY. Because DENY takes precedence over a
GRANT, the effective result is that no users can access the view because all
users are members of the public role. It is generally best to avoid using
DENY unless you have a specific reason to use it.
Should I create roles, then add users to the roles (so I can remove
public). This seems a little different than the NT model of
users/groups.
Yes, it's a good practice to grant permissions to roles rather than
individual users. This allows you to more easily control data access via
role membership. You can ignore the public role unless you want to grant
permissions to all database users.

I suggest you clear (REVOKE) all permissions on the view and then grant
permissions only to those roles as desired.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Noloader" <no******@yahoo.com> wrote in message
news:6b**************************@posting.google.c om... Hello,

We are using Access Front End (ADP Project) and SQL Server 2000
backend. SQL Server is using NT Security.

We do not want the users to access the the underlying tables. So, we
went to each table and unchecked 'Select'. We also placed an 'X' in
all columns for guest and public account.

Next, we created a view. The view has 'Select' permission given to the
users (it is also enforcing some business rules on whether a record
should be returned).

Access XP is behaving as expected - the tables are not showing up, and
a report can be created using the view.

Here is the test situation we have set up:
User 'test_a' has 'select' allowed on the view.
Built in user 'public' and 'guest' were not allowed on the view.

When we configured the view as stated above, 'test_a' did not have
access to the view (even though we specifically granted). It appears
the 'public' must also have at least 'Select'.

It is not the case for a member of BUILTIN\Administrators.

Is this expected behavior? Does SQL server not follow the NT Security
model? Or am I simply missing something with the 'public' role?

Should I create roles, then add users to the roles (so I can remove
public). This seems a little different than the NT model of
users/groups.

Also, thanks to Simon and Pete for their previous replies.

Jeff
no******@yahoo.com

Jul 20 '05 #2
"Dan Guzman" <da*******@nospam-earthlink.net> wrote in message news:<MU*****************@newsread2.news.pas.earth link.net>...
We also placed an 'X' in
all columns for guest and public account.
The red 'X' denotes an explicit DENY. Because DENY takes precedence over a
GRANT, the effective result is that no users can access the view because all
users are members of the public role. It is generally best to avoid using
DENY unless you have a specific reason to use it.
Should I create roles, then add users to the roles (so I can remove
public). This seems a little different than the NT model of
users/groups.


Yes, it's a good practice to grant permissions to roles rather than
individual users. This allows you to more easily control data access via
role membership. You can ignore the public role unless you want to grant
permissions to all database users.

I suggest you clear (REVOKE) all permissions on the view and then grant
permissions only to those roles as desired.

--
Hope this helps.

Dan Guzman
SQL Server MVP

...


Hi Dan,

Thanks for the reply.
You can ignore the public role unless you want to grant
permissions to all database users.

We found if we revoke the deny role, other roles loose access. So
would you suggest we simply revoke (not deny) the public role and add
a role to encompass our users? If we deny the public role, then our
additional role does not have access to the view.

Also, what is the difference between revoke and deny. I've seen the
behavior it exhibits, but I was not able to get a good definition from
the help files.

Thanks,
Jeff
no******@yahoo.com
Jul 20 '05 #3
> So would you suggest we simply revoke (not deny) the public role and add
a role to encompass our users? If we deny the public role, then our
additional role does not have access to the view.
Yes, I suggest you start by revoking all object permissions. Then create
your own role(s), add role members and grant permissions to the role.
Also, what is the difference between revoke and deny. I've seen the
behavior it exhibits, but I was not able to get a good definition from
the help files.
This is a bit confusing and is why I discourage using DENY in most cases. A
GRANT adds a security entry that gives a user/role the specified permission.
A DENY adds a security entry that prohibits a user/role the specified
permission. The important point is that both GRANT and DENY *add* security
entries and, when conflicting entries exist, DENY takes precedence.

A REVOKE *removes* GRANT and DENY security entries so the result is no
permission entries. With no object permissions, the only users that can
directly access the object are:

1) the dbo user (includes sysadmin role members)

2) db_owner role members

3) db_datareader and db_datawriter role members (tables and views)

Other users can still access the object indirectly if the ownership chain is
unbroken and they have been granted permissions on the directly referenced
object. You can use unbroken ownership chains as a security mechanism by
allowing data access only via views and procs while prohibiting direct
access to the underlying data.

The example below illustrates how to implement this.

USE MyDatabase
GO

EXEC sp_addlogin 'MyUser1'
EXEC sp_addlogin 'MyUser2'

EXEC sp_addrole 'MyUserRole'
EXEC sp_addrole 'MyPowerUserRole'

EXEC sp_adduser 'MyUser1'
EXEC sp_adduser 'MyUser2'

EXEC sp_addrolemember 'MyUserRole', 'MyUser1'
EXEC sp_addrolemember 'MyPowerUserRole', 'MyUser2'
GO

CREATE TABLE MyTable
(
MyNonSensitiveData int NOT NULL,
MySensitiveData int NOT NULL
)
GO

CREATE VIEW MyView
AS
SELECT MyNonSensitiveData FROM MyTable
GO

GRANT SELECT ON MyView TO MyUserRole
GRANT ALL ON MyView TO MyPowerUserRole
GO

CREATE VIEW MyOtherView
AS
SELECT MyNonSensitiveData, MySensitiveData FROM MyTable
GO
GRANT ALL ON MyOtherView TO MyPowerUserRole
--
Hope this helps.

Dan Guzman
SQL Server MVP

"Noloader" <no******@yahoo.com> wrote in message
news:6b**************************@posting.google.c om... "Dan Guzman" <da*******@nospam-earthlink.net> wrote in message

news:<MU*****************@newsread2.news.pas.earth link.net>...
We also placed an 'X' in
all columns for guest and public account.


The red 'X' denotes an explicit DENY. Because DENY takes precedence over a GRANT, the effective result is that no users can access the view because all users are members of the public role. It is generally best to avoid using DENY unless you have a specific reason to use it.
Should I create roles, then add users to the roles (so I can remove
public). This seems a little different than the NT model of
users/groups.


Yes, it's a good practice to grant permissions to roles rather than
individual users. This allows you to more easily control data access via role membership. You can ignore the public role unless you want to grant permissions to all database users.

I suggest you clear (REVOKE) all permissions on the view and then grant
permissions only to those roles as desired.

--
Hope this helps.

Dan Guzman
SQL Server MVP

...


Hi Dan,

Thanks for the reply.
You can ignore the public role unless you want to grant
permissions to all database users.

We found if we revoke the deny role, other roles loose access. So
would you suggest we simply revoke (not deny) the public role and add
a role to encompass our users? If we deny the public role, then our
additional role does not have access to the view.

Also, what is the difference between revoke and deny. I've seen the
behavior it exhibits, but I was not able to get a good definition from
the help files.

Thanks,
Jeff
no******@yahoo.com

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Noloader | last post by:
Hello, We are using Access Front End (ADP Project) and SQL Server 2000 backend. SQL Server is using NT Security. We do not want the users to access the the underlying tables. So, we went to...
2
by: FrodoBaggins | last post by:
Dear Team, I am running Visual Studio 2003 Version 7.1.3088 on Windows Server 2003. I have written a C# application that must write to the event log. When it attempts to write to the event log,...
13
by: Edward Mitchell | last post by:
I have a problem that involves the error I receive when attempting to complete the asp.net web application example (Walkthrough: Creating a Web Application Using a Third-Party Business Object). ...
0
by: Charles Leonard | last post by:
I am having yet another issue with Windows Server 2003. This time, the web service (a file import web service) appears to run except for one odd message: "ActiveX component can't create object". ...
4
by: VB Programmer | last post by:
When I run my ASP.NET 2.0 web app on my dev machine it works perfect. When I precomile it to my web deployment project and then copy the debug files to my web server I get this problem when trying...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
5
by: James | last post by:
Hello, I have written a simple logon page that redirects to another page when successful. All works fine on my computer but when I upload it I get the error message below. I have written it...
17
by: Anil Gupte | last post by:
I am using the following to try to connect to the database, but it does not seem to be working. Dim sConnString sConnString = "Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.