# OffSet7: Suspicious Eventlog Clear

> Design for the QRadar Rule Wizard. Not an importable rule and not tested in QRadar.

- Rule type: Event rule (Local), create disabled
- Log source types: Microsoft Windows Security Event Log DSM collecting Microsoft-Windows-PowerShell/Operational 4104 (Script Block Logging)

## Building blocks

### BB:OffSet7:Suspicious Eventlog Clear:selection (match)
Any of the groups matches (OR): build one BB per group and a parent BB "when an event matches any of" them.
- when **Message** contains: `Clear-EventLog`, `Remove-EventLog`, `Limit-EventLog`, `Clear-WinEvent`
- when **Message** contains: `Eventing.Reader.EventLogSession`, `ClearLog`
- when **Message** contains: `Diagnostics.EventLog`, `Clear`

## Main rule — option A (building blocks)

1. when the event(s) were detected by one or more of these log source types: `Microsoft Windows Security Event Log DSM collecting Microsoft-Windows-PowerShell/Operational 4104 (Script Block Logging)`
2. when an event matches the condition built from these building blocks: `BB:OffSet7:Suspicious Eventlog Clear:selection`

## Main rule — option B (AQL filter test)

1. when the event matches this AQL filter query: `devicetype=12 AND ((LOWER(Message) LIKE '%clear-eventlog %' OR LOWER(Message) LIKE '%remove-eventlog %' OR LOWER(Message) LIKE '%limit-eventlog %' OR LOWER(Message) LIKE '%clear-winevent %') OR (LOWER(Message) LIKE '%eventing.reader.eventlogsession%' AND LOWER(Message) LIKE '%clearlog%') OR (LOWER(Message) LIKE '%diagnostics.eventlog%' AND LOWER(Message) LIKE '%clear%'))`

## Rule response

- Severity 5, credibility 6, relevance 7
- Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
- Respond no more than once per 30 minutes per Log Source (tune per environment)

## Limitations

- QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.

Source rule: Suspicious Eventlog Clear (0f017df3-8f5a-414f-ad6b-24aff1128278). Author: Nasreddine Bencherchali (Nextron Systems), Swachchhanda Shrawan Poudel (Nextron Systems). Licence: DRL-1.1.
