Skip to content

Commit df4e131

Browse files
authored
chore: Limiting Eventcount to Sysmon Events
1 parent 3530138 commit df4e131

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
shell: powershell
2828

2929
- name: Check Eventcount
30-
run: '$EventCount = 0 ;Get-WinEvent -ListLog * | where {$_.RecordCount -gt 0} | foreach{$_;$EventCount = $EventCount + $_.RecordCount}|Out-Null;"Eventcount: "+$EventCount; if ($EventCount -gt 52500){ Write-Output "Too many events"; $host.SetShouldExit(1)}'
30+
run: '$EventCount = 0 ;Get-WinEvent -ListLog Microsoft-Windows-Sysmon* | where {$_.RecordCount -gt 0} | foreach{$_;$EventCount = $EventCount + $_.RecordCount}|Out-Null;"Eventcount: "+$EventCount; if ($EventCount -gt 50){ Write-Output "Too many events"; $host.SetShouldExit(1)}'
3131
shell: powershell
3232

3333
busySystem:
@@ -40,9 +40,16 @@ jobs:
4040
run: Invoke-WebRequest http://live.sysinternals.com/tools/sysmon.exe -OutFile .\sysmon.exe
4141
shell: powershell
4242

43+
- name: Run Sysmon
44+
run: .\sysmon.exe -accepteula -i sysmonconfig-export.xml
45+
shell: powershell
46+
47+
- name: Print Eventcount
48+
run: Get-WinEvent -ListLog Microsoft-Windows-Sysmon*
49+
4350
- name: Install some Choco Packages
4451
run: choco install ninja adobereader googlechrome firefox jre8 notepadplusplus.install vlc python3 dotnetfx openssh winrar nodejs.install foxitreader autohotkey.portable putty.install skype ccleaner winlogbeat gimp
4552

46-
- name: Check Eventcount Post Choco
47-
run: '$EventCount = 0 ;Get-WinEvent -ListLog * | where {$_.RecordCount -gt 0} | foreach{$_;$EventCount = $EventCount + $_.RecordCount}|Out-Null;"Eventcount: "+$EventCount; if ($EventCount -gt 54000){ Write-Output "Too many events"; $host.SetShouldExit(1)}'
53+
- name: Check Eventcount
54+
run: '$EventCount = 0 ;Get-WinEvent -ListLog Microsoft-Windows-Sysmon* | where {$_.RecordCount -gt 0} | foreach{$_;$EventCount = $EventCount + $_.RecordCount}|Out-Null;"Eventcount: "+$EventCount; if ($EventCount -gt 10000){ Write-Output "Too many events"; $host.SetShouldExit(1)}'
4855
shell: powershell

0 commit comments

Comments
 (0)