Andreas Wolter
  • Consulting & Services
    • SQL Server Security Assessment by Andreas Wolter
    • SQL Server Health Check
    • Performance Analysis
    • SQL Server Discovery
    • Air-Gapped SQL Server
  • My Customers
  • About
    • Conferences
    • Certifications
    • Training
  • Blog
  • Contact
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu

SQL Server security admins, attention: Auditing is missing attempts to change permissions, leading to repudiation and miss elevation attempts

SQL Server security admins, attention: Auditing is missing attempts to change permissions, leading to repudiation and miss elevation attempts

SQL Audit bug permissions

Auditing is one if not the most crucial security control (read more about it here: Security concept: Audit Trail): without it it’s hard to figure out exactly how a breach happened, when it started, sometimes even if it happened at all and last but not least: “whodunnit” – in technical terms: non-repudiation. Unless the breach is at a stage that users notice, only Auditing can tell you that a breach happened.

Advice
All SQL Server installations should contain at least a basic security audit.

When running some tests in November last year I noticed that some events were not captured on a new SQL Server 2022 system. We (Sarpedon Quality Lab LLC, USA and Sarpedon Quality Lab GmbH, Germany) quickly ran more tests and compared different systems with a definitive result:

SQL Auditing fails to capture the SERVER_OBJECT_PERMISSION_CHANGE_GROUP Audit Action group

Affected: SQL Server 2022 (including CU 17) and Azure SQL Managed Instance. No fix till today.

This server-level audit action group is being monitored on our customer’s servers, because events in this category can directly impact the security of the SQL Server Instance.

The first to inform (besides our customers) was the security team at Microsoft Data of course and also wasted many hours with the Microsoft Support system just to get this rolling as a ticket.

Given the timeline and importance of this event, I want to raise awareness of this auditing-gap, hoping it gets fixed soon.

Recommended temporary workaround

There is no practical workaround for Auditing. Auditing every batch_completed is likely going to impact not only the system itself but also overload the audit and processing thereof.

Instead I recommend to keep track of server object permissions by taking scheduled snapshots of the system table sys.server_permissions and compare it over time for changes. Changes of server-level permissions should be the exception and always have a proper explanation. This way one would at least capture permissions that are changes and left in place. What it can miss are changes to permissions and then reverting the change quickly again. Therefore, make sure to audit other events like impersonation or role-membership changes.

Code to test

And here is the code to test this event on your system:

Set up an Audit including the event “SERVER_OBJECT_PERMISSION_CHANGE_GROUP”:

USE [master]

GO

CREATE SERVER AUDIT SARPEDON_SecurityAuditToFile

TO FILE — configure according to your needs

(             FILEPATH                   = N’D:\SQLData\Audits’

,      MAXSIZE                           = 100 MB

,      MAX_ROLLOVER_FILES  = 100

,      RESERVE_DISK_SPACE  = OFF

) WITH (QUEUE_DELAY = 1000, ON_FAILURE = CONTINUE)

GO

CREATE SERVER AUDIT SPECIFICATION SARPEDON_SecurityAuditSpec

FOR SERVER AUDIT SARPEDON_SecurityAuditToFile

ADD (SERVER_OBJECT_PERMISSION_CHANGE_GROUP),

— … in addition to many others

GO

ALTER SERVER AUDIT SARPEDON_SecurityAuditToFile

WITH (STATE = ON)

GO

ALTER SERVER AUDIT SPECIFICATION SARPEDON_SecurityAuditSpec

WITH (STATE = ON)

Test: if the system is affected by the bug, it will NOT capture any of the following event types:

— replace “MALICIOUS” with a Test Login of your choice

GRANT CONNECT ON ENDPOINT::[TSQL Default TCP] TO MALICIOUS;

GO

GRANT ALTER ON ENDPOINT::[TSQL Default TCP] TO MALICIOUS

GO

GRANT IMPERSONATE ON LOGIN::sa TO MALICIOUS

GO

GRANT ALTER ON LOGIN::sa TO MALICIOUS

GO

— [role_SecurityAdmins] is a custom server role

GRANT ALTER ON SERVER ROLE::[role_SecurityAdmins] TO MALICIOUS

GO

Call to action

Please upvote the official bug-report:
Security-bug: SQL Auditing SERVER_OBJECT_PERMISSION_CHANGE_GROUP does not capture anything

And while you’re there, why not also vote for these other Auditing related suggestions:

  1. Having the same Audit name on server and inside contained AG will lead to error when trying to start it (but not when creating it)
  2. Implicit addition of database user is not audited
  3. When adding an Entra ID admin for an ARC-enabled SQL Server this needs to be auditable in the instance itself
  4. RESTORE VERIFYONLY should not be captured under CREATE DATABASE Audit Action group
  5. Document ALL_AUDIT_SPECIFICATIONS_AND_ACTIONS wait type

Thank you

Happy Auditing

Andreas

Is your SQL Server Audit catching what matters? Gaps like this one are easy to miss. I help design and review SQL Server auditing for security and compliance.

Explore Auditing & Activity Monitoring
Share article
  • Share on Facebook
  • Share on X
  • Share on LinkedIn
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Security Assessment Community Edition

Learn about my free Community Edition script.

Recent
  • Sample result in SSMS: local NTLM connections over shared memory from SQL01, and NTLM connections over TCP from a reporting server, an ETL server and a workstation
    NTLM Deprecation and SQL Server: How to Find NTLM Connections...18. November 2026 - 17:01in: Security
  • SQL Server Consolidation: $3M+ in Projected Savings and...30. September 2026 - 15:47in: Architecture & High Availability, Security
  • Using a Database Server as a Honeypot for Threat Detect...18. September 2026 - 16:00in: Security
  • Azure Arc for SQL Server: “Least Privilege” Mode Still...8. September 2026 - 15:56in: Security
  • When SIEM Enrichment Becomes False Attribution3. September 2026 - 14:26in: Security
Comments
  • Thanks Scott. Goof feedback. NETSTAT is a useful addition,...21. November 2026 - 15:44 by Andreas Wolter
  • I would go a little deeper with how to troubleshoot SQL...21. November 2026 - 15:15 by Scott O
  • Protecting database data at rest is essential for maintaining...21. October 2026 - 2:23 by Viska
  • Thanks Now Microsoft could document them as well, and put...19. August 2026 - 16:26 by Andreas Wolter
  • List of Action_IDs for Filter https://sqlquantumleap.com/reference/server-audit-filter-values-for-action_id/ Great...18. August 2026 - 0:59 by Peter Dünsch

Articles

Analysis Services Auditing Availability Groups Azure Best Practices Certification Columnstore Consolidation Deadlocks & Blocking Encryption Extended Events Get-SqlSafe In-Memory OLTP Indexing Least Privilege PASS Summit Patching Performance Analysis Permissions Privilege Escalation Reporting Services Security Principles Spatial Data SQLBits SQL Injection SQLSaturday SQL Server 2012 SQL Server 2014 SQL Server 2016 SQL Server 2022 SQL Server 2025 SQL Trace & Profiler sysadmin & Server Roles Threat Detection Vulnerabilities Workshop & PreCon
© 2026 Andreas WolterContactImprintPrivacy PolicyLinkedInRSS
Link to: The challenges for least privilege: When sysadmin is still required in Microsoft SQL Server Link to: The challenges for least privilege: When sysadmin is still required in Microsoft SQL Server The challenges for least privilege: When sysadmin is still required in Microsoft...Error message Only members of the sysadmin fixed server role can perform this operation. Link to: PreCon Practical Performance Monitoring SQL Server at SQLSaturday New York City 2025 May 9th Link to: PreCon Practical Performance Monitoring SQL Server at SQLSaturday New York City 2025 May 9th PreCon Practical Performance Monitoring SQL Server at SQLSaturday New York City...
Scroll to top Scroll to top Scroll to top
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}