Skip to content

microsoft_sql_dangerous_operations#5221

Merged
phantinuss merged 5 commits intoSigmaHQ:masterfrom
dan21san:microsoft_sql_critical_operations
Jun 11, 2025
Merged

microsoft_sql_dangerous_operations#5221
phantinuss merged 5 commits intoSigmaHQ:masterfrom
dan21san:microsoft_sql_critical_operations

Conversation

@dan21san
Copy link
Contributor

@dan21san dan21san commented Mar 3, 2025

Summary of the Pull Request

Add a new rule about the critical transaction on MS SQL SERVER (as truncate or drop table).

Changelog

new: MSSQL Destructive Query

Example Log Event

Fixed Issues

SigmaHQ Rule Creation Conventions

  • If your PR adds new rules, please consider following and applying these conventions

@github-actions github-actions bot added Rules Windows Pull request add/update windows related rules labels Mar 3, 2025
@nasbench nasbench added Work In Progress Some changes are needed Author Input Required changes the require information from original author of the rules labels Mar 4, 2025
@dan21san
Copy link
Contributor Author

Log sample (blurred):

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="MSSQLSERVER$AUDIT" /> 
  <EventID Qualifiers="16384">33205</EventID> 
  <Version>0</Version> 
  <Level>0</Level> 
  <Task>3</Task> 
  <Opcode>0</Opcode> 
  <Keywords>0x80a0000000000000</Keywords> 
  <TimeCreated SystemTime="2025-03-03T08:38:18.9887014Z" /> 
  <EventRecordID>1263721</EventRecordID> 
  <Correlation ActivityID="{...}" /> 
  <Execution ProcessID="756" ThreadID="880" /> 
  <Channel>Security</Channel> 
  <Computer>TESTSQL.testdomain</Computer> 
  <Security UserID="S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx" /> 
  </System>
- <EventData>
  <Data>audit_schema_version:1 event_time:2025-03-05 08:38:18.0821929 sequence_number:1 action_id:DR succeeded:true is_column_permission:false session_id:70 server_principal_id:266 database_principal_id:1 target_server_principal_id:0 target_database_principal_id:0 object_id:1845581613 user_defined_event_id:0 transaction_id:175974 class_type:U duration_milliseconds:0 response_rows:0 affected_rows:0 client_tls_version:0 database_transaction_id:0 ledger_start_sequence_number:0 client_ip:local machine permission_bitmask:00000000000000000000000000000000 [...] statement:DROP TABLE dbo.tst1_Table_3 [...]</Data> 
  </EventData>
  </Event>

@nasbench nasbench added this to the Sigma-March-Release milestone Mar 21, 2025
@dan21san
Copy link
Contributor Author

Hi @phantinuss the suggested changes have been made! I also added the query for database drop (same logic).
As for the error, I don't understand how to solve it.

@phantinuss
Copy link
Collaborator

looks good to me.

The error is on our side. I will pull in the fixes when they are merged.

@phantinuss phantinuss force-pushed the microsoft_sql_critical_operations branch from e0f25ff to 5555ab2 Compare May 15, 2025 10:29
@phantinuss phantinuss added 2nd Review Needed and removed Author Input Required changes the require information from original author of the rules labels May 15, 2025
@nasbench nasbench added Ready to Merge and removed Work In Progress Some changes are needed 2nd Review Needed labels Jun 4, 2025
@phantinuss phantinuss merged commit 8c29f27 into SigmaHQ:master Jun 11, 2025
12 checks passed
phantinuss pushed a commit that referenced this pull request Jun 11, 2025
new: MSSQL Destructive Query
---------

Co-authored-by: Nasreddine Bencherchali <monsteroffire2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready to Merge Rules Windows Pull request add/update windows related rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants