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


Elevation of Privileges


Elevation of Privileges

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)

Group: Administrators
Points: 150920 Visits: 19455
Eric M Russell (7/30/2014)
SQL Server Audit has an 'Addlogin' event and a 'Add Login to Server Role' event. For example, when a login is created or granted membership in SYSADMIN group.
http://msdn.microsoft.com/en-us/library/ms188646.aspx

But this doesn't handle the scenario where a domain account (ex: mycorp\johnsmith) becomes a member of a domain or local admin group (ex: mycorp\ProductionDBA or Builtin\Administrators) that has SYSADMIN membership. That's not a SQL Server meta-data change, but rather a change in Active Directory.

Using the following technique, you can leverage xp_logininfo to report on what accounts have SYSADMIN membership, either explicitly or via a domain group.
http://www.sqlservercentral.com/articles/Security/76919/


Lots of ways to do this, but you also need to check it, or have a process that notifies you of events. It's also a balance as too many notifications can cause you to start ignoring many of them.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Eric M Russell
Eric M Russell
One Orange Chip
One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)

Group: General Forum Members
Points: 29839 Visits: 11559
Steve Jones - SSC Editor (7/30/2014)
Eric M Russell (7/30/2014)
SQL Server Audit has an 'Addlogin' event and a 'Add Login to Server Role' event. For example, when a login is created or granted membership in SYSADMIN group.
http://msdn.microsoft.com/en-us/library/ms188646.aspx

But this doesn't handle the scenario where a domain account (ex: mycorp\johnsmith) becomes a member of a domain or local admin group (ex: mycorp\ProductionDBA or Builtin\Administrators) that has SYSADMIN membership. That's not a SQL Server meta-data change, but rather a change in Active Directory.

Using the following technique, you can leverage xp_logininfo to report on what accounts have SYSADMIN membership, either explicitly or via a domain group.
http://www.sqlservercentral.com/articles/Security/76919/


Lots of ways to do this, but you also need to check it, or have a process that notifies you of events. It's also a balance as too many notifications can cause you to start ignoring many of them.

I would expect adding sysadmin logins or granting sysadmin permissions to be a rare event.


"The universe is complicated and for the most part beyond your control, but your life is only as complicated as you choose it to be."
Steve Jones
Steve Jones
SSC Guru
SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)

Group: Administrators
Points: 150920 Visits: 19455
FYI, here's a post someone sent me: http://blogs.xtivia.com/home/-/blogs/alerting-on-elevation-of-privileges-in-sql-server?_33_redirect=http%3A%2F%2Fblogs.xtivia.com%2Fhome%3Fp_p_id%3D33%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-2%26p_p_col_count%3D2%26p_r_p_564233524_categoryId%3D12100%26p_r_p_564233524_resetCur%3Dtrue

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Eric M Russell
Eric M Russell
One Orange Chip
One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)

Group: General Forum Members
Points: 29839 Visits: 11559
If the windows group like 'MyCorp\ProductionDBA' or 'Builtin\Administrators' are members of SYSADMIN, and user account 'MyCorp\JohnSmith' is added to one of these groups, then he has sysadmin privillage. There is no 'CREATE LOGIN..' or 'GRANT..' operation, and as far as I know, there is no profiler event, extended events, trigger, or meta-data change within SQL Server that could be leveraged to alert this at the time the domain group membership is added.
However, one thing that could be done is to create a LOGIN trigger that checks the sysadmin privillage of an account at time of login and then compares user's account name to a table containing list of known admins.


"The universe is complicated and for the most part beyond your control, but your life is only as complicated as you choose it to be."
Steve Jones
Steve Jones
SSC Guru
SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)

Group: Administrators
Points: 150920 Visits: 19455
Eric M Russell (7/31/2014)
If the windows group like 'MyCorp\ProductionDBA' or 'Builtin\Administrators' are members of SYSADMIN, and user account 'MyCorp\JohnSmith' is added to one of these groups, then he has sysadmin privillage. There is no 'CREATE LOGIN..' or 'GRANT..' operation, and as far as I know, there is no profiler event, extended events, trigger, or meta-data change within SQL Server that could be leveraged to alert this at the time the domain group membership is added.
However, one thing that could be done is to create a LOGIN trigger that checks the sysadmin privillage of an account at time of login and then compares user's account name to a table containing list of known admins.


No WMI-type event? Something like this?
http://msdn.microsoft.com/en-us/library/aa772153(v=vs.85).aspx

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Eric M Russell
Eric M Russell
One Orange Chip
One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)

Group: General Forum Members
Points: 29839 Visits: 11559
Steve Jones - SSC Editor (7/31/2014)
Eric M Russell (7/31/2014)
If the windows group like 'MyCorp\ProductionDBA' or 'Builtin\Administrators' are members of SYSADMIN, and user account 'MyCorp\JohnSmith' is added to one of these groups, then he has sysadmin privillage. There is no 'CREATE LOGIN..' or 'GRANT..' operation, and as far as I know, there is no profiler event, extended events, trigger, or meta-data change within SQL Server that could be leveraged to alert this at the time the domain group membership is added.
However, one thing that could be done is to create a LOGIN trigger that checks the sysadmin privillage of an account at time of login and then compares user's account name to a table containing list of known admins.


No WMI-type event? Something like this?
http://msdn.microsoft.com/en-us/library/aa772153(v=vs.85).aspx

That looks promising for monitoring changes to a specific domain group that we know has membership in mssql sysadmin role. However, I'm not sure it would cover local groups like 'Builtin\Administrators'. That's a strong and compelling reason to not add local windows groups or accounts to a privillaged SQL Server role, and why they are not longer added by default in recent editions of mssql installation process.


"The universe is complicated and for the most part beyond your control, but your life is only as complicated as you choose it to be."
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