Detection rules › Splunk

Windows SQL Server Critical Procedures Enabled

Status
production
Severity
medium
Group by
change_type, config_name, dest, risk_message, risk_score, signature_id
Author
Michael Haag, Splunk, sidoyle from Splunk Community
Source
github.com/splunk/security_content

This detection identifies when critical SQL Server configuration options are modified, including "Ad Hoc Distributed Queries", "external scripts enabled", "Ole Automation Procedures", "clr enabled", and "clr strict security". These features can be abused by attackers for various malicious purposes - Ad Hoc Distributed Queries enables Active Directory reconnaissance through ADSI provider, external scripts and Ole Automation allow execution of arbitrary code, and CLR features can be used to run custom assemblies. Enabling these features could indicate attempts to gain code execution or perform reconnaissance through SQL Server.

Known false positives

  • Database administrators may legitimately enable these features for valid business purposes such as cross-database queries, custom CLR assemblies, automation scripts, or application requirements. To reduce false positives, document when these features are required, monitor for unauthorized changes, create change control procedures for configuration modifications, and consider alerting on the enabled state rather than configuration changes if preferred.

MITRE ATT&CK coverage

Telemetry coverage

ProviderRecord / event type
MSSQLSERVEREvent ID 15457

Rule body

name: Windows SQL Server Critical Procedures Enabled
id: d0434864-b043-41e3-8c08-30e53605e9cb
version: 7
creation_date: '2025-02-13'
modification_date: '2026-05-13'
author: Michael Haag, Splunk, sidoyle from Splunk Community
status: production
type: TTP
description: This detection identifies when critical SQL Server configuration options are modified, including "Ad Hoc Distributed Queries", "external scripts enabled", "Ole Automation Procedures", "clr enabled", and "clr strict security". These features can be abused by attackers for various malicious purposes - Ad Hoc Distributed Queries enables Active Directory reconnaissance through ADSI provider, external scripts and Ole Automation allow execution of arbitrary code, and CLR features can be used to run custom assemblies. Enabling these features could indicate attempts to gain code execution or perform reconnaissance through SQL Server.
data_source:
    - Windows Event Log Application 15457
search: |-
    `wineventlog_application` EventCode=15457
      | rex field=EventData_Xml "<Data>(?<config_name>[^<]+)</Data><Data>(?<old_value>[^<]+)</Data><Data>(?<new_value>[^<]+)</Data>"
      | where config_name IN ("Ad Hoc Distributed Queries", "external scripts enabled", "Ole Automation Procedures", "clr enabled", "clr strict security")
      | rename host as dest
      | eval change_type=case( old_value="0" AND new_value="1", "enabled", old_value="1" AND new_value="0", "disabled", true(), "modified" )
      | eval risk_score=case( change_type="enabled", 90, change_type="disabled", 60, true(), 70 )
      | eval risk_message="SQL Server critical procedure ".config_name." was ".change_type." on host ".dest.", which may indicate attempts to gain code execution or perform reconnaissance"
      | stats count min(_time) as firstTime max(_time) as lastTime
        BY dest EventCode config_name
           change_type risk_message risk_score
      | `security_content_ctime(firstTime)`
      | `security_content_ctime(lastTime)`
      | `windows_sql_server_critical_procedures_enabled_filter`
how_to_implement: To successfully implement this detection, you need to be ingesting Windows Application Event Logs from SQL Server instances where SQL Server is installed. The detection specifically looks for EventID 15457 which indicates configuration changes to SQL Server features. Ensure proper logging is enabled for SQL Server configuration changes and that the logs are being forwarded to your SIEM.
known_false_positives: Database administrators may legitimately enable these features for valid business purposes such as cross-database queries, custom CLR assemblies, automation scripts, or application requirements. To reduce false positives, document when these features are required, monitor for unauthorized changes, create change control procedures for configuration modifications, and consider alerting on the enabled state rather than configuration changes if preferred.
references:
    - https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/ad-hoc-distributed-queries-server-configuration-option
    - https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/external-scripts-enabled-server-configuration-option
    - https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/ole-automation-procedures-server-configuration-option
    - https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/clr-enabled-server-configuration-option
    - https://www.netspi.com/blog/technical/network-penetration-testing/enumerating-domain-accounts-via-sql-server-using-adsi/
    - https://attack.mitre.org/techniques/T1505/001/
    - https://www.netspi.com/blog/technical-blog/adversary-simulation/attacking-sql-server-clr-assemblies/
finding:
    title: SQL Server critical procedure "$config_name$" was $change_type$ on host $dest$, which could indicate an attempt to gain code execution or perform reconnaissance
    entity:
        field: dest
        type: system
        score: 50
analytic_story:
    - SQL Server Abuse
asset_type: Windows
mitre_attack_id:
    - T1505.001
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: endpoint
security_domain: endpoint

Stages and Predicates

Stage 1: search

`wineventlog_application` EventCode=15457

Stage 2: rex

| rex field=EventData_Xml "<Data>(?<config_name>[^<]+)</Data><Data>(?<old_value>[^<]+)</Data><Data>(?<new_value>[^<]+)</Data>"

Stage 3: where

| where config_name IN ("Ad Hoc Distributed Queries", "external scripts enabled", "Ole Automation Procedures", "clr enabled", "clr strict security")

Stage 4: rename

| rename host as dest

Stage 5: eval

| eval change_type=case( old_value="0" AND new_value="1", "enabled", old_value="1" AND new_value="0", "disabled", true(), "modified" )
change_type =
ifold_value = "0" AND new_value = "1""enabled"
elifold_value = "1" AND new_value = "0""disabled"
else"modified"

Stage 6: eval

| eval risk_score=case( change_type="enabled", 90, change_type="disabled", 60, true(), 70 )
risk_score =
ifchange_type = "enabled"90
elifchange_type = "disabled"60
else70

Stage 7: eval

| eval risk_message="SQL Server critical procedure ".config_name." was ".change_type." on host ".dest.", which may indicate attempts to gain code execution or perform reconnaissance"

Stage 8: stats

| stats count min(_time) as firstTime max(_time) as lastTime
    BY dest EventCode config_name
       change_type risk_message risk_score

Stage 9: search

| `security_content_ctime(firstTime)`

Stage 10: search

| `security_content_ctime(lastTime)`

Stage 11: search

| `windows_sql_server_critical_procedures_enabled_filter`

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 15457 corpus 3 (splunk 3)
field:"EventID" kind:eq value:"15457"
config_namein
  • "Ad Hoc Distributed Queries"
  • "Ole Automation Procedures"
  • "clr enabled"
  • "clr strict security"
  • "external scripts enabled"
field:"config_name" kind:in