Sql-server – Audit Admin rights use on SQL Server 2019

sql server

Being security conscious, I want to audit the use of admin rights. I would like to assign specific permissions to a user (following the concept of least privilege) that current has the SysAdmin role and I want to know what rights they are using above DBO to the database. Is there a good way to audit these actions so that I can grant those specific rights?

Best Answer

From the nature of the question, it sounds like you're observing the user discreetly before opting to revoke permissions. Definitely get an understanding of what the business is willing to allow the user to perform on the instance, especially if they aren't wearing the DBA hat in any capacity. If you're the DBA of the instance and you're responsible for its uptime, security and integrity, convey your security expectations with the business and ensure your users' logins are in compliance.

That being said, you may want to use a combination of Audits with both Server level and Database level specifications. The groups of actions that can be audited are vast but this will allow you the most precision if you want to ignore particular action groups. As for the indicating the principal (user/login), you can indicate the login you want to track in particular but it may be advisable to track the public role so you can monitor overall use of the high-level actions.

Server Audit Specification dialog box

Another approach you can try is to start by looking at the default trace. It may not capture all events and its retention depends on disk space and the amount of qualifying events being generated but can be checked on the fly.

Both the above actions are passive with output checked periodically using SSMS and T-SQL. You can also interactively monitor with Extended Events sessions.