Skip to content

microsoft_sql_dangerous_operations #5221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

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
Comment on lines +21 to +23
Data|contains:
- 'statement:TRUNCATE TABLE'
- 'statement:DROP TABLE'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide example logs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- <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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author Input Required changes the require information from original author of the rules Rules Windows Pull request add/update windows related rules Work In Progress Some changes are needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants