Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

User with database role of "NULL" Expand / Collapse
Author
Message
Posted Tuesday, July 9, 2013 12:05 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Yesterday @ 12:06 PM
Points: 752, Visits: 5,531
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
Post #1471775
Posted Tuesday, July 9, 2013 12:42 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Yesterday @ 12:06 PM
Points: 752, Visits: 5,531
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
Post #1471802
Posted Friday, July 12, 2013 1:21 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 8:51 PM
Points: 7,140, Visits: 12,763
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
Post #1473220
Posted Wednesday, July 17, 2013 6:04 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Yesterday @ 12:06 PM
Points: 752, Visits: 5,531
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
Post #1474522
Posted Monday, August 5, 2013 8:19 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 12:28 PM
Points: 4,611, Visits: 4,067
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
Post #1480936
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse