Skip to content

Commit 73ebaa7

Browse files
committed
Add finding suppression system (v0.4.4)
Users can acknowledge known-benign findings in config.json Suppressions array. Pattern wildcards via -like. Count shown in summary box and CI JSON. Made-with: Cursor
1 parent 0d5c36b commit 73ebaa7

6 files changed

Lines changed: 26 additions & 2 deletions

File tree

AmIHacked.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ if ($script:NonInteractive) {
7878
$script:RedactMode = $Redact.IsPresent
7979
}
8080
$script:RedactMap = @{}
81+
$script:SuppressedCount = 0
8182

82-
$script:Version = "0.4.3"
83+
$script:Version = "0.4.4"
8384

8485
# ── Helpers (loaded first) ───────────────────────────────────────────────────
8586

@@ -350,6 +351,7 @@ if ($script:NonInteractive) {
350351
Write-SummaryLine "CRITICAL " "$critCount" "Red" $w
351352
Write-SummaryLine "WARNING " "$warnCount" "Yellow" $w
352353
Write-SummaryLine "INFO " "$infoCount" "DarkCyan" $w
354+
Write-SummaryLine "Suppressed " "$($script:SuppressedCount)" "DarkGray" $w
353355
Write-Host " | $(' ' * ($w - 2)) |"
354356
Write-SummaryLine "Total " "$totalCount findings" "White" $w
355357
Write-SummaryLine "Duration " "$durationStr" "DarkGray" $w
@@ -378,6 +380,7 @@ if ($script:NonInteractive) {
378380
Write-SummaryLine "CRITICAL " "$critCount" $(if ($critCount -gt 0) { "Red" } else { "Green" }) $w
379381
Write-SummaryLine "WARNING " "$warnCount" $(if ($warnCount -gt 0) { "Yellow" } else { "Green" }) $w
380382
Write-SummaryLine "INFO " "$infoCount" "DarkCyan" $w
383+
Write-SummaryLine "Suppressed " "$($script:SuppressedCount)" "DarkGray" $w
381384
Write-Host "$(' ' * $w)" -ForegroundColor DarkCyan
382385
Write-SummaryLine "Total " "$totalCount findings" "White" $w
383386
Write-SummaryLine "Duration " "$durationStr" "DarkGray" $w
@@ -406,6 +409,7 @@ if ($script:NonInteractive) {
406409
critical = $critCount
407410
warning = $warnCount
408411
info = $infoCount
412+
suppressed = $script:SuppressedCount
409413
total = $totalCount
410414
duration = [math]::Round($duration.TotalSeconds, 1)
411415
reportPath = $reportFile

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [0.4.4] - 2026-03-15
8+
9+
### Added
10+
- **Finding suppression system** -- `Suppressions` array in config lets users acknowledge known-benign findings by title pattern (wildcard `-like` matching). Suppressed count appears in summary box and CI JSON output.
11+
712
## [0.4.3] - 2026-03-15
813

914
### Added

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Copied from `config/config.example.json`. Controls:
7878
- Optional API keys: VirusTotal (`VirusTotalAPIKey`), AbuseIPDB (`AbuseIPDBKey`)
7979
- Suspicious parent→child process rules
8080
- Per-module tuning parameters
81+
- `Suppressions`: array of `{ pattern, reason }` objects. Findings whose Title matches a pattern (wildcard via `-like`) are silently dropped before storing or printing. A `$script:SuppressedCount` counter tracks how many were suppressed; the count appears in the summary box and CI JSON output (`suppressed` key).
8182

8283
`config/config.json` is gitignored to keep API keys local.
8384

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[![PowerShell 5.1+](https://img.shields.io/badge/PowerShell-5.1%2B-0d1117?style=for-the-badge&logo=powershell&logoColor=5391FE)](https://docs.microsoft.com/powershell/)
1313
[![Windows 10/11](https://img.shields.io/badge/Windows-10%20%2F%2011-0d1117?style=for-the-badge&logo=windows&logoColor=white)](https://www.microsoft.com/windows)
1414
[![License: MIT](https://img.shields.io/badge/License-MIT-0d1117?style=for-the-badge&logoColor=white)](LICENSE)
15-
[![Version](https://img.shields.io/badge/Version-0.4.3-FF6B6B?style=for-the-badge)](#changelog)
15+
[![Version](https://img.shields.io/badge/Version-0.4.4-FF6B6B?style=for-the-badge)](#changelog)
1616

1717
[![Zero Dependencies](https://img.shields.io/badge/Dependencies-Zero-0d1117?style=flat-square&labelColor=0d1117)](#)
1818
[![MITRE ATT&CK](https://img.shields.io/badge/MITRE%20ATT%26CK-40%2B%20Techniques-ff3333?style=flat-square&labelColor=0d1117)](#mitre-attck-coverage)
@@ -241,6 +241,7 @@ Then edit `config/config.json` (gitignored — API keys stay local):
241241
| `SuspiciousParentChild` | `object[]` | Parent→Child process rules |
242242
| `SuspiciousTempExtensions` | `string[]` | Extensions flagged in temp directories |
243243
| `TrustedAppDirs` | `string[]` | App directory names to skip during temp-dir scanning |
244+
| `Suppressions` | `object[]` | Findings to silence permanently. Each entry has a `pattern` (wildcard, matched against Title) and optional `reason` |
244245
| `AccountMaxAgeDays` | `int` | Flag accounts created within N days |
245246
| `FileSystemMaxAgeDays` | `int` | Flag recently modified system executables |
246247
| `MaxEventLogEntries` | `int` | Max events to scan per log |

config/config.example.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,9 @@
7373
".microsoft.com", ".windowsupdate.com", ".akamaized.net",
7474
".cloudfront.net", ".slack-msgs.com", ".googleapis.com",
7575
".gstatic.com", ".steamcontent.com"
76+
],
77+
"Suppressions": [
78+
{ "pattern": "New Listening Port: 6463", "reason": "Discord RPC — expected on this machine" },
79+
{ "pattern": "Unquoted Service Path*", "reason": "Vendor bug, not exploitable — no write access to intermediate paths" }
7680
]
7781
}

lib/Helpers.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,15 @@ function Add-Finding {
174174
$Remediation = Invoke-Redact $Remediation
175175
$Details = Invoke-RedactObject $Details
176176

177+
if ($script:Config.Suppressions) {
178+
foreach ($sup in $script:Config.Suppressions) {
179+
if ($Title -like $sup.pattern) {
180+
$script:SuppressedCount++
181+
return
182+
}
183+
}
184+
}
185+
177186
$finding = [PSCustomObject]@{
178187
Severity = $Severity
179188
Category = $Category

0 commit comments

Comments
 (0)