Skip to content

Commit

Permalink
feat: make Core Isolation options functional
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Jul 9, 2023
1 parent 5be99ed commit 60e3e87
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Configuration/tweaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ features:
# -----------------------------------------------------
- tweaks\statuses\status-scripts.yml
- tweaks\scripts\script-storage-sense.yml
- tweaks\scripts\script-core-isolation.yml
- tweaks\scripts\script-devices.yml
- tweaks\scripts\script-cleanup.yml
- tweaks\scripts\script-startmenu.yml
Expand Down
11 changes: 11 additions & 0 deletions src/Configuration/tweaks/scripts/script-core-isolation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Disable Core Isolation
description: Disables Core Isolation (VBS) based on the user's options
privilege: TrustedInstaller
actions:
- !run:
exe: 'powershell.exe'
args: '-NoP -File "C:\Users\Default\Desktop\Atlas\3. Configuration\5. Security\Core Isolation (VBS)\Current Configuration.ps1" -DisableAllVBS'
exeDir: true
wait: true
option: 'vbs-disable'
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
[CmdletBinding()]
param (
[Parameter()][Switch]$DisableAllVBS,
[Parameter()][Switch]$EnableMemoryIntegrity
)

# https://learn.microsoft.com/en-us/windows/security/threat-protection/device-guard/enable-virtualization-based-protection-of-code-integrity#validate-enabled-vbs-and-memory-integrity-features

$memIntegrity = "HKLM:\System\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity"
$kernelShadowStacks = "HKLM:\System\CurrentControlSet\Control\DeviceGuard\Scenarios\KernelShadowStacks"
$credentialGuard = "HKLM:\System\CurrentControlSet\Control\DeviceGuard\Scenarios\CredentialGuard"

if ($DisableAllVBS) {
Write-Warning "Disabling VBS features..."

# Memory Integrity
if (Test-Path $memIntegrity) {
New-ItemProperty -Path $memIntegrity -Name "Enabled" -Value 0 -PropertyType DWORD -Force
Remove-ItemProperty -Path $memIntegrity -Name "ChangedInBootCycle" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $memIntegrity -Name "WasEnabledBy" -ErrorAction SilentlyContinue
}

# Kernel-mode Hardware-enforced Stack Protection (Windows 11 only)
if (Test-Path $kernelShadowStacks) {
New-ItemProperty -Path $kernelShadowStacks -Name "Enabled" -Value 0 -PropertyType DWORD -Force
Remove-ItemProperty -Path $kernelShadowStacks -Name "ChangedInBootCycle" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $kernelShadowStacks -Name "WasEnabledBy" -ErrorAction SilentlyContinue
}

# Credential Guard (Windows 11 only)
if (Test-Path $credentialGuard) {
New-ItemProperty -Path $credentialGuard -Name "Enabled" -Value 0 -PropertyType DWORD -Force
Remove-ItemProperty -Path $credentialGuard -Name "ChangedInBootCycle" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $credentialGuard -Name "WasEnabledBy" -ErrorAction SilentlyContinue
}
exit
} elseif ($EnableMemoryIntegrity) {
Write-Warning "Enabling memory integrity..."
Set-ItemProperty -Path $memIntegrity -Name "Enabled" -Value 1 -Type DWord
Set-ItemProperty -Path $memIntegrity -Name "WasEnabledBy" -Value 2 -Type DWord
exit
}

$pages = @(
@{
Title = "VBS Features Running"
Expand Down

0 comments on commit 60e3e87

Please sign in to comment.