noid-privacy/Modules/ASR/ASR.psm1
Nexus d4dfe39e4f
Some checks failed
CI - PowerShell Quality Checks / PSScriptAnalyzer (push) Has been cancelled
CI - PowerShell Quality Checks / Test on PowerShell 5.1 (push) Has been cancelled
CI - PowerShell Quality Checks / Test on PowerShell 7.4 (push) Has been cancelled
CI - PowerShell Quality Checks / Validate Project Structure (push) Has been cancelled
Pester Tests / test (push) Has been cancelled
chore: bump version to 2.2.4, update CHANGELOG and README
Version bump across 62 files (2.2.3 → 2.2.4).
CHANGELOG.md: New [2.2.4] section with EDR/XDR detection and version tooling.
README.md: Updated release highlights, AV detection example output synced with code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:22:12 +01:00

52 lines
1.5 KiB
PowerShell

<#
.SYNOPSIS
Attack Surface Reduction (ASR) Module
.DESCRIPTION
Enables all 19 Microsoft Defender ASR rules in Block mode for comprehensive protection.
Hybrid implementation:
- Registry for backup/verification
- Set-MpPreference for clean application
.NOTES
Author: NexusOne23
Version: 2.2.4
Requires: PowerShell 5.1+, Administrator privileges, Windows Defender
#>
# Get the module root path
$ModuleRoot = $PSScriptRoot
# Dot source all Private functions
$PrivatePath = Join-Path $ModuleRoot "Private"
if (Test-Path $PrivatePath) {
Get-ChildItem -Path $PrivatePath -Filter "*.ps1" | ForEach-Object {
try {
. $_.FullName
}
catch {
Write-Host "WARNING: Failed to import private function $($_.Name): $_" -ForegroundColor Yellow
}
}
}
# Dot source all Public functions
$PublicPath = Join-Path $ModuleRoot "Public"
if (Test-Path $PublicPath) {
Get-ChildItem -Path $PublicPath -Filter "*.ps1" | ForEach-Object {
try {
. $_.FullName
}
catch {
Write-Host "WARNING: Failed to import public function $($_.Name): $_" -ForegroundColor Yellow
}
}
}
# Export public functions + Test-ASRCompliance (needed for Invoke-ASRRules verification)
Export-ModuleMember -Function @('Invoke-ASRRules', 'Test-ASRCompliance')
# Alias for naming consistency (non-breaking change)
New-Alias -Name 'Invoke-ASR' -Value 'Invoke-ASRRules' -Force
Export-ModuleMember -Alias 'Invoke-ASR'