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


User with database role of "NULL"


User with database role of "NULL"

Author
Message
jasona.work
jasona.work
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10296 Visits: 12576
So I have a query that I use to get a list of database users, and the role(s) they belong to. In running this against one particularly annoying DB (751 users!? REALLY?!?!) I come across several accounts that have NULL for their role membership. I've checked them manually, and they belong to NO database-level roles, and NO server level roles other than Public.

So, what sort of access would one of these users have? None at all to the DB (even thought they likely can connect to SQL Server itself,) or would they have read-only?

I need to know because I'm going to be sending a list of users and their role memberships to the DB owner to review so we can try to trim out some of the dead weight...

I've read the Technet / MSDN info on "is_member" which indicates that either these users used to belong to a DB role that no longer exists, or to a Windows Group (of which NONE have SQL permissions!)

Thanks,
Jason
jasona.work
jasona.work
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10296 Visits: 12576
OK, quick tested this on a QA copy of the DB in question, and if the role membership is NULL, you can connect to SQL (expected) but you can't query anything in the DB. But, you can view system stored procedures and users that are built-in to SQL.

So, really, such a user won't be able to do anything really...

Jason
Orlando Colamatteo
Orlando Colamatteo
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: General Forum Members
Points: 40472 Visits: 14413
All Database Users will at minimum be a member of the public Role. This affords them basic permissions like connecting to the database. Now, you can grant or deny permissions from the public Role if you want everyone to have that permission, but that is ill-advised.

That said, just because a User is only a member of public does nor mean they have no permissions. Users can be granted permissions directly.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
jasona.work
jasona.work
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10296 Visits: 12576
opc.three (7/12/2013)
All Database Users will at minimum be a member of the public Role. This affords them basic permissions like connecting to the database. Now, you can grant or deny permissions from the public Role if you want everyone to have that permission, but that is ill-advised.


Understood. As for altering the "basic" permissions the Public role has, that would get my SQL Servers yanked off the network around here... If it weren't for the fact that removing (if even possible) the Public Role would break just about everything in SQL, that's what they'd want done...

Yes, where I work is that maniacally security oriented. The best way to say what the rules are for setting up / configuring servers?
This site is the be-all / end-all bible:
http://iase.disa.mil/stigs/index.html


opc.three (7/12/2013)
That said, just because a User is only a member of public does nor mean they have no permissions. Users can be granted permissions directly.


OK. But, in this case, I know the users have no other permissions granted, only what they've got through role membership.

Thanks!
Jason
Ed Wagner
Ed Wagner
SSC Guru
SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)

Group: General Forum Members
Points: 50165 Visits: 10844
OK. But, in this case, I know the users have no other permissions granted, only what they've got through role membership.


I'm not trying to be a complete pain here, but are you sure they don't have any object-level permissions granted to them? I know you said you have a militant security policy, but have you run something similar to the following?

select users.name username, so.name, perms.permission_name
from sys.database_permissions perms
inner join sys.objects so on so.object_id = perms.major_id
inner join sys.database_principals users on users.principal_id = perms.grantee_principal_id
where users.name = 'suspect_username'
order by users.name, so.name, perms.permission_name;




Tally Tables - Performance Personified
String Splitting with True Performance
Best practices on how to ask questions
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