Skip to content

Commit 3aba8ea

Browse files
committed
Warn about Smart App Control when applying SRP
Add a Smart App Control (SAC) compatibility check to the generated PowerShell for applying Software Restriction Policies (SRP). The script now reads HKLM:\\SYSTEM\\CurrentControlSet\\Control\\CI\\Policy -> VerifiedAndReputablePolicyState and emits a warning if SAC is in Evaluation (1) or On (2), since SAC can override SRP on Windows 11. This is a non-invasive notification (it still sets the SRP registry keys) and only runs for non-Home systems when the blockExecutables lock is enabled, guiding users to disable SAC if they want SRP to take effect.
1 parent c076800 commit 3aba8ea

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/utils/scriptBuilder.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,18 @@ $SRP = "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Safer\\CodeIdentifiers"
611611
${isLock && system.blockExecutables ? `
612612
if (-not $IsHome) {
613613
Write-Host "[*] Applying Software Restriction Policies (Pro/Ent Only)..." -ForegroundColor Yellow
614+
615+
# --- Smart App Control (SAC) Compatibility Check ---
616+
# On Windows 11, SAC overrides SRP when it is 'On' or in 'Evaluation' mode.
617+
# SAC state is stored at HKLM:\SYSTEM\CurrentControlSet\Control\CI\Policy -> VerifiedAndReputablePolicyState
618+
# 0 = Off, 1 = Evaluation, 2 = On
619+
$SACState = (Get-ItemProperty -Path "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\CI\\Policy" -Name "VerifiedAndReputablePolicyState" -ErrorAction SilentlyContinue).VerifiedAndReputablePolicyState
620+
if ($SACState -eq 1 -or $SACState -eq 2) {
621+
Write-Host " [!] WARNING: Smart App Control is active (state=$SACState)." -ForegroundColor Magenta
622+
Write-Host " SRP may be IGNORED on this Windows 11 machine while SAC is on/evaluating." -ForegroundColor Magenta
623+
Write-Host " To enable SRP: turn off Smart App Control in Windows Security > App & Browser Control." -ForegroundColor Magenta
624+
}
625+
614626
Set-RegKey -Path $SRP -Name "TransparentEnabled" -Value 1
615627
Set-RegKey -Path $SRP -Name "PolicyScope" -Value 1
616628

0 commit comments

Comments
 (0)