|
| 1 | +<!-- ============================================================================ |
| 2 | + Sysmon — Baseline Security Policy (Low-Noise Medium/High Severity) |
| 3 | + ============================================================================ |
| 4 | + Type: DETECTION |
| 5 | + Purpose: Detect high-confidence endpoint behaviors from Windows Sysmon logs |
| 6 | + with strict signal controls to keep false positives low. |
| 7 | + Scope: Windows Sysmon events (primarily Event ID 1/10/11/13/22) |
| 8 | + Notes: |
| 9 | + - Focused on medium/high severity only. |
| 10 | + - Most rules require multiple conditions (behavior + context). |
| 11 | + - Rule IDs are stable for triage workflow and suppression management. |
| 12 | + ============================================================================ --> |
| 13 | + |
| 14 | +<root type="DETECTION" name="sysmon_baseline" author="AgentSmith"> |
| 15 | + |
| 16 | + <!-- ================================================================ |
| 17 | + S-B001 — Suspicious Encoded PowerShell |
| 18 | + Severity: HIGH |
| 19 | + ================================================================ --> |
| 20 | + <rule id="S-B001" name="Suspicious encoded PowerShell execution"> |
| 21 | + <check type="EQU" field="event.code">1</check> |
| 22 | + <check type="INCL" field="process.executable">powershell</check> |
| 23 | + <checklist condition="enc and hidden and bypass"> |
| 24 | + <check id="enc" type="REGEX" field="process.command_line">(?i)(-enc|-encodedcommand)\s+[A-Za-z0-9+/=]{20,}</check> |
| 25 | + <check id="hidden" type="REGEX" field="process.command_line">(?i)(-w|/w|--windowstyle)\s*hidden</check> |
| 26 | + <check id="bypass" type="REGEX" field="process.command_line">(?i)(-ep|--executionpolicy)\s*bypass</check> |
| 27 | + </checklist> |
| 28 | + <append field="alert_id">S-B001</append> |
| 29 | + <append field="severity">high</append> |
| 30 | + <append field="category">baseline</append> |
| 31 | + <append field="description">Encoded PowerShell with hidden window and policy bypass</append> |
| 32 | + <append field="mitre_tactic">Execution</append> |
| 33 | + <append field="mitre_technique_id">T1059.001</append> |
| 34 | + </rule> |
| 35 | + |
| 36 | + <!-- ================================================================ |
| 37 | + S-B002 — Office/Browser spawning script engines |
| 38 | + Severity: HIGH |
| 39 | + ================================================================ --> |
| 40 | + <rule id="S-B002" name="Office or browser spawned script engine"> |
| 41 | + <check type="EQU" field="event.code">1</check> |
| 42 | + <check type="REGEX" field="process.parent.executable">(?i)(winword|excel|powerpnt|outlook|chrome|msedge|firefox)\.exe$</check> |
| 43 | + <check type="REGEX" field="process.executable">(?i)(powershell|pwsh|wscript|cscript|mshta|rundll32|regsvr32)\.exe$</check> |
| 44 | + <append field="alert_id">S-B002</append> |
| 45 | + <append field="severity">high</append> |
| 46 | + <append field="category">baseline</append> |
| 47 | + <append field="description">User-facing app spawned a high-risk script/LOLBin child process</append> |
| 48 | + <append field="mitre_tactic">Execution</append> |
| 49 | + <append field="mitre_technique_id">T1204</append> |
| 50 | + </rule> |
| 51 | + |
| 52 | + <!-- ================================================================ |
| 53 | + S-B003 — Run/RunOnce persistence write |
| 54 | + Severity: HIGH |
| 55 | + ================================================================ --> |
| 56 | + <rule id="S-B003" name="Run key persistence created or modified"> |
| 57 | + <check type="EQU" field="event.code">13</check> |
| 58 | + <check type="REGEX" field="registry.path">(?i)\\(CurrentVersion\\Run|CurrentVersion\\RunOnce)(\\|$)</check> |
| 59 | + <check type="REGEX" field="process.executable">(?i)(powershell|cmd|wscript|cscript|mshta|rundll32|regsvr32)\.exe$</check> |
| 60 | + <append field="alert_id">S-B003</append> |
| 61 | + <append field="severity">high</append> |
| 62 | + <append field="category">baseline</append> |
| 63 | + <append field="description">High-risk process modified Run/RunOnce persistence key</append> |
| 64 | + <append field="mitre_tactic">Persistence</append> |
| 65 | + <append field="mitre_technique_id">T1547.001</append> |
| 66 | + </rule> |
| 67 | + |
| 68 | + <!-- ================================================================ |
| 69 | + S-B004 — Suspicious startup-folder artifact |
| 70 | + Severity: MEDIUM |
| 71 | + ================================================================ --> |
| 72 | + <rule id="S-B004" name="Script or executable dropped to startup folder"> |
| 73 | + <check type="EQU" field="event.code">11</check> |
| 74 | + <check type="REGEX" field="file.path">(?i)\\(ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Startup|Users\\[^\\]+\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup)\\</check> |
| 75 | + <check type="REGEX" field="file.path">(?i)\.(ps1|vbs|js|hta|cmd|bat|exe|dll)$</check> |
| 76 | + <append field="alert_id">S-B004</append> |
| 77 | + <append field="severity">medium</append> |
| 78 | + <append field="category">baseline</append> |
| 79 | + <append field="description">Potential startup persistence payload dropped to Startup folder</append> |
| 80 | + <append field="mitre_tactic">Persistence</append> |
| 81 | + <append field="mitre_technique_id">T1547.001</append> |
| 82 | + </rule> |
| 83 | + |
| 84 | + <!-- ================================================================ |
| 85 | + S-B005 — Remote-script style LOLBin command |
| 86 | + Severity: HIGH |
| 87 | + ================================================================ --> |
| 88 | + <rule id="S-B005" name="LOLBin with remote script or URL pattern"> |
| 89 | + <check type="EQU" field="event.code">1</check> |
| 90 | + <check type="REGEX" field="process.executable">(?i)(mshta|regsvr32|rundll32)\.exe$</check> |
| 91 | + <check type="REGEX" field="process.command_line">(?i)(https?://|scrobj\.dll|javascript:|vbscript:)</check> |
| 92 | + <append field="alert_id">S-B005</append> |
| 93 | + <append field="severity">high</append> |
| 94 | + <append field="category">baseline</append> |
| 95 | + <append field="description">LOLBin commandline indicates remote script execution pattern</append> |
| 96 | + <append field="mitre_tactic">Defense Evasion</append> |
| 97 | + <append field="mitre_technique_id">T1218</append> |
| 98 | + </rule> |
| 99 | + |
| 100 | + <!-- ================================================================ |
| 101 | + S-B006 — Unusual scheduler abuse chain |
| 102 | + Severity: MEDIUM |
| 103 | + ================================================================ --> |
| 104 | + <rule id="S-B006" name="Suspicious schtasks command writing script payload"> |
| 105 | + <check type="EQU" field="event.code">1</check> |
| 106 | + <check type="INCL" field="process.executable">schtasks.exe</check> |
| 107 | + <checklist condition="create and payload"> |
| 108 | + <check id="create" type="REGEX" field="process.command_line">(?i)\s/create(\s|$)</check> |
| 109 | + <check id="payload" type="REGEX" field="process.command_line">(?i)(powershell|wscript|cscript|mshta|rundll32|regsvr32|cmd\.exe\s+/c)</check> |
| 110 | + </checklist> |
| 111 | + <append field="alert_id">S-B006</append> |
| 112 | + <append field="severity">medium</append> |
| 113 | + <append field="category">baseline</append> |
| 114 | + <append field="description">Scheduled task created with script/LOLBin execution payload</append> |
| 115 | + <append field="mitre_tactic">Persistence</append> |
| 116 | + <append field="mitre_technique_id">T1053.005</append> |
| 117 | + </rule> |
| 118 | + |
| 119 | +</root> |
0 commit comments