Skip to content

Commit e7011cd

Browse files
authored
Add Remote Access / Always-On VPN module (74-AlwaysOnVPN) (#39)
New module 74-AlwaysOnVPN is the VPN-gateway half of the remote-access stack whose RADIUS auth back end is the NPS module (73): RRAS forwards authentication to NPS, NPS applies the network policy. * Install the RemoteAccess (DirectAccess and VPN) role (reversible, via the timeout wrapper + undo). * Configure RRAS as a VPN server (Install-RemoteAccess -VpnType Vpn). * Point VPN authentication at an NPS/RADIUS server. The shared secret is collected as a SecureString, converted to plaintext only for the Add-RemoteAccessRadius call, then zeroed — never written to the Dry-Run queue, its JSON export, or any file. Undo removes the RADIUS server and reverts auth back to Windows. * Generate device-tunnel (machine-cert) / user-tunnel (EAP-TLS) Always-On VPN ProfileXML from a few prompts. User-supplied values are XML-escaped before interpolation, and profiles are written to the Admins+SYSTEM-only hardened state dir. * Show the current Remote Access / VPN configuration. Wired into the loader, Header action set, entry-point dispatch (AlwaysOnVPNSetup), Roles & Features menu (item 11), and menu runner. Module count 74 -> 75; 4944 tests, 0 failures; PSScriptAnalyzer clean.
1 parent 9547b3e commit e7011cd

12 files changed

Lines changed: 645 additions & 31 deletions

Changelog.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## v1.105.0
4+
5+
Remote Access / Always-On VPN — new module (74-AlwaysOnVPN.ps1), reachable from **Roles & Features → [11] Remote Access / Always-On VPN** and via the `AlwaysOnVPNSetup` CLI action. This is the VPN-gateway half of the remote-access stack whose RADIUS auth back end is the NPS module (73): RRAS forwards authentication to NPS, NPS applies the network policy.
6+
7+
**What it does:**
8+
- **Install the Remote Access role** (`-Action AlwaysOnVPNSetup`, or menu): installs the DirectAccess and VPN (RAS) role with management tools. Reversible / Dry-Run-aware.
9+
- **Configure the VPN server** (interactive or CLI): enables RRAS as a VPN server (SSTP + IKEv2). Undo tears the VPN configuration back down.
10+
- **Point authentication at NPS/RADIUS** (interactive): register an NPS server as the VPN's RADIUS authentication source. The shared secret is collected as a SecureString and held only long enough for the registration — it never lands in the Dry-Run queue, its JSON export, or any file. Undo removes the RADIUS server.
11+
- **Generate Always-On VPN profiles** (interactive): build a device-tunnel (machine-cert) or user-tunnel (EAP-TLS) ProfileXML from a few prompts — server FQDN, protocol (IKEv2/SSTP/Automatic), split- vs force-tunnel, DNS suffix, and split-tunnel routes. The generated profile is written to an admin-only path, ready to deploy via the VPNv2 CSP (Intune) or PowerShell.
12+
- **Show the current Remote Access / VPN configuration.**
13+
14+
Requires the Remote Access role; the menu surfaces install + VPN-configured status. Connection-request and network policies are authored in the NPS module / console.
15+
16+
Module count: 74 → 75.
17+
318
## v1.104.0
419

520
Network Policy Server (NPS / RADIUS) — new module (73-NPS.ps1), reachable from **Roles & Features → [10] Network Policy Server (RADIUS)** and via the `NPSSetup` CLI action. NPS is Windows' RADIUS server for 802.1X (wired/wireless NAC), VPN authentication, and as the auth back end for Always-On VPN.

Header.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
RackStack - All-in-one Windows Server setup utility (Monolithic Build).
44
55
.DESCRIPTION
6-
This is the MONOLITHIC BUILD -- all 74 modules combined into a single file.
6+
This is the MONOLITHIC BUILD -- all 75 modules combined into a single file.
77
Generated by sync-to-monolithic.ps1 from the modular source in Modules/.
88
The .exe is compiled from this file via ps2exe.
99
@@ -30,7 +30,7 @@
3030
7h3 4b1d3r
3131
3232
.VERSION
33-
1.104.0
33+
1.105.0
3434
3535
.LAST UPDATED
3636
05/23/2026
@@ -1391,7 +1391,7 @@
13911391
param(
13921392
# CLI headless mode: run a specific action without interactive menus
13931393
# Usage: RackStack.exe -Action Cleanup [-Tier Standard] [-Silent] [-OutputFormat JSON]
1394-
[ValidateSet('Cleanup', 'Debloat', 'HealthCheck', 'Batch', 'QuickScan', 'Inventory', 'DriftCheck', 'Snapshot', 'Compliance', 'Harden', 'Remediate', 'Aggregate', 'Compare', 'Export', 'Trend', 'CertCheck', 'ReportHTML', 'ListeningPorts', 'SoftwareList', 'Uptime', 'ServiceAudit', 'EventAudit', 'NetInfo', 'ScheduledExport', 'ValidateConfig', 'Watch', 'Query', 'Diff', 'Baseline', 'Alert', 'FleetScan', 'PatchStatus', 'UserAudit', 'FirewallAudit', 'TaskAudit', 'DiskAudit', 'TLSAudit', 'SMBAudit', 'DriverAudit', 'TimeAudit', 'BootAudit', 'GPOAudit', 'MemoryAudit', 'ProcessAudit', 'BackupAudit', 'ShareAudit', 'DNSAudit', 'PowerAudit', 'RegistryAudit', 'ProfileAudit', 'HyperVAudit', 'NetworkAudit', 'StorageAudit', 'FeatureAudit', 'AutoStartAudit', 'BIOSAudit', 'ClusterAudit', 'AuditPolicyAudit', 'EnvAudit', 'CrashAudit', 'LocalGroupAudit', 'WMIAudit', 'TempAudit', 'UpdatePolicyAudit', 'IISAudit', 'SSHAudit', 'BitLockerAudit', 'PrintAudit', 'CredGuardAudit', 'PortAudit', 'AntivirusAudit', 'DotNetAudit', 'RDPAudit', 'VPNAudit', 'HostsFileAudit', 'NetStatAudit', 'LicenseAudit', 'USBDeviceAudit', 'AppLockerAudit', 'EventSubAudit', 'HotfixAudit', 'SysInfoAudit', 'LogonAudit', 'ACLAudit', 'RecoveryAudit', 'ServiceAccountAudit', 'ProxyAudit', 'PendingRebootAudit', 'PageFileAudit', 'CPUAudit', 'DefenderExclusionAudit', 'KerberosAudit', 'DHCPAudit', 'NUMAAudit', 'SymlinkAudit', 'StartupScriptAudit', 'SecureChannelAudit', 'ComObjectAudit', 'FirewallLogAudit', 'ScheduledRebootAudit', 'PowerShellAudit', 'RouteTableAudit', 'TokenPrivilegeAudit', 'WindowsCapabilityAudit', 'ARPTableAudit', 'LocaleAudit', 'TaskHistoryAudit', 'NTFSAudit', 'Win11Cleanup', 'DarkMode', 'LightMode', 'iSCSIAudit', 'NICTeamAudit', 'SMBSessionAudit', 'WindowsUpdateAudit', 'ClusterQuorumAudit', 'S2DAudit', 'VirtualSwitchAudit', 'MPIOPathAudit', 'ServiceRecoveryAudit', 'VMOvercommitAudit', 'DedupAudit', 'ClusterNetworkAudit', 'ReplicaLagAudit', 'HandleLeakAudit', 'ShadowCopyAudit', 'QoSPolicyAudit', 'LiveMigrationAudit', 'DomainTrustAudit', 'DiskLatencyAudit', 'NICOffloadAudit', 'StorageTimeoutAudit', 'EventLogCapacityAudit', 'TcpSettingsAudit', 'WinRMAudit', 'ClusterHealthScore', 'VMInventoryExport', 'VMSnapshotAudit', 'StorageHealthScore', 'CSVSpaceAudit', 'SMBConnectionAudit', 'VolumeLabelAudit', 'NICErrorAudit', 'VMResourceWaste', 'HealthDashboard', 'SCCMClientAudit', 'SCOMAgentAudit', 'WACConnectivityAudit', 'AzureADAudit', 'ServerScore', 'FleetReport', 'PasswordPolicy', 'FirewallRuleAudit', 'GPResultAudit', 'DNSCacheAudit', 'TPMAudit', 'SecureBootAudit', 'TimeSkewAudit', 'NetworkProfileAudit', 'InsecureServiceAudit', 'SelfTest', 'CheckForUpdate', 'ExportLogs', 'UpdateSelf', 'Rollback', 'ScheduleUpdateCheck', 'Dashboard', 'History', 'Replay', 'AzureArcEnroll', 'DefenderEndpointOnboard', 'WSUSSetup', 'ADCSSetup', 'StorageMigrationSetup', 'GPOBackup', 'GPODrift', 'JEAList', 'NPSSetup')]
1394+
[ValidateSet('Cleanup', 'Debloat', 'HealthCheck', 'Batch', 'QuickScan', 'Inventory', 'DriftCheck', 'Snapshot', 'Compliance', 'Harden', 'Remediate', 'Aggregate', 'Compare', 'Export', 'Trend', 'CertCheck', 'ReportHTML', 'ListeningPorts', 'SoftwareList', 'Uptime', 'ServiceAudit', 'EventAudit', 'NetInfo', 'ScheduledExport', 'ValidateConfig', 'Watch', 'Query', 'Diff', 'Baseline', 'Alert', 'FleetScan', 'PatchStatus', 'UserAudit', 'FirewallAudit', 'TaskAudit', 'DiskAudit', 'TLSAudit', 'SMBAudit', 'DriverAudit', 'TimeAudit', 'BootAudit', 'GPOAudit', 'MemoryAudit', 'ProcessAudit', 'BackupAudit', 'ShareAudit', 'DNSAudit', 'PowerAudit', 'RegistryAudit', 'ProfileAudit', 'HyperVAudit', 'NetworkAudit', 'StorageAudit', 'FeatureAudit', 'AutoStartAudit', 'BIOSAudit', 'ClusterAudit', 'AuditPolicyAudit', 'EnvAudit', 'CrashAudit', 'LocalGroupAudit', 'WMIAudit', 'TempAudit', 'UpdatePolicyAudit', 'IISAudit', 'SSHAudit', 'BitLockerAudit', 'PrintAudit', 'CredGuardAudit', 'PortAudit', 'AntivirusAudit', 'DotNetAudit', 'RDPAudit', 'VPNAudit', 'HostsFileAudit', 'NetStatAudit', 'LicenseAudit', 'USBDeviceAudit', 'AppLockerAudit', 'EventSubAudit', 'HotfixAudit', 'SysInfoAudit', 'LogonAudit', 'ACLAudit', 'RecoveryAudit', 'ServiceAccountAudit', 'ProxyAudit', 'PendingRebootAudit', 'PageFileAudit', 'CPUAudit', 'DefenderExclusionAudit', 'KerberosAudit', 'DHCPAudit', 'NUMAAudit', 'SymlinkAudit', 'StartupScriptAudit', 'SecureChannelAudit', 'ComObjectAudit', 'FirewallLogAudit', 'ScheduledRebootAudit', 'PowerShellAudit', 'RouteTableAudit', 'TokenPrivilegeAudit', 'WindowsCapabilityAudit', 'ARPTableAudit', 'LocaleAudit', 'TaskHistoryAudit', 'NTFSAudit', 'Win11Cleanup', 'DarkMode', 'LightMode', 'iSCSIAudit', 'NICTeamAudit', 'SMBSessionAudit', 'WindowsUpdateAudit', 'ClusterQuorumAudit', 'S2DAudit', 'VirtualSwitchAudit', 'MPIOPathAudit', 'ServiceRecoveryAudit', 'VMOvercommitAudit', 'DedupAudit', 'ClusterNetworkAudit', 'ReplicaLagAudit', 'HandleLeakAudit', 'ShadowCopyAudit', 'QoSPolicyAudit', 'LiveMigrationAudit', 'DomainTrustAudit', 'DiskLatencyAudit', 'NICOffloadAudit', 'StorageTimeoutAudit', 'EventLogCapacityAudit', 'TcpSettingsAudit', 'WinRMAudit', 'ClusterHealthScore', 'VMInventoryExport', 'VMSnapshotAudit', 'StorageHealthScore', 'CSVSpaceAudit', 'SMBConnectionAudit', 'VolumeLabelAudit', 'NICErrorAudit', 'VMResourceWaste', 'HealthDashboard', 'SCCMClientAudit', 'SCOMAgentAudit', 'WACConnectivityAudit', 'AzureADAudit', 'ServerScore', 'FleetReport', 'PasswordPolicy', 'FirewallRuleAudit', 'GPResultAudit', 'DNSCacheAudit', 'TPMAudit', 'SecureBootAudit', 'TimeSkewAudit', 'NetworkProfileAudit', 'InsecureServiceAudit', 'SelfTest', 'CheckForUpdate', 'ExportLogs', 'UpdateSelf', 'Rollback', 'ScheduleUpdateCheck', 'Dashboard', 'History', 'Replay', 'AzureArcEnroll', 'DefenderEndpointOnboard', 'WSUSSetup', 'ADCSSetup', 'StorageMigrationSetup', 'GPOBackup', 'GPODrift', 'JEAList', 'NPSSetup', 'AlwaysOnVPNSetup')]
13951395
[string]$Action,
13961396

13971397
[ValidateSet('Light', 'Standard', 'Aggressive')]

Modules/00-Initialization.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ if (-not $PSCommandPath -and $script:ScriptPath) {
225225
if (-not $script:ModuleRoot -and $script:ScriptPath) {
226226
$script:ModuleRoot = [System.IO.Path]::GetDirectoryName($script:ScriptPath)
227227
}
228-
$script:ScriptVersion = "1.104.0"
228+
$script:ScriptVersion = "1.105.0"
229229
$script:ScriptStartTime = Get-Date
230230

231231
# Post-update cleanup: UpdateSelf / Rollback leave a `.pending-delete` sibling next to RackStack.exe.

Modules/48-MenuDisplay.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,12 @@ function Show-RolesFeaturesMenu {
426426
} -CacheSeconds 120
427427
$npsColor = if ($npsStatusText -eq "Installed") { "Success" } else { "Warning" }
428428

429+
$aovpnStatusText = Get-CachedValue -Key "RemoteAccessState" -FetchScript {
430+
$r = Get-RemoteAccessStatus
431+
if ($r.VpnConfigured) { "VPN configured" } elseif ($r.Installed) { "Role installed" } else { "Not Installed" }
432+
} -CacheSeconds 120
433+
$aovpnColor = if ($aovpnStatusText -eq "VPN configured") { "Success" } elseif ($aovpnStatusText -eq "Role installed") { "Warning" } else { "Warning" }
434+
429435
Write-OutputColor "" -color "Info"
430436
Write-OutputColor " ╔════════════════════════════════════════════════════════════════════════╗" -color "Info"
431437
Write-OutputColor "$((" ROLES & FEATURES").PadRight(72))" -color "Info"
@@ -443,6 +449,7 @@ function Show-RolesFeaturesMenu {
443449
Write-MenuItem "[8] Group Policy Manager ►" -Status $gpoStatusText -StatusColor $gpoColor
444450
Write-MenuItem "[9] Just Enough Administration (JEA) ►" -Status $jeaStatusText -StatusColor $jeaColor
445451
Write-MenuItem "[10] Network Policy Server (RADIUS) ►" -Status $npsStatusText -StatusColor $npsColor
452+
Write-MenuItem "[11] Remote Access / Always-On VPN ►" -Status $aovpnStatusText -StatusColor $aovpnColor
446453
Write-OutputColor " └────────────────────────────────────────────────────────────────────────┘" -color "Info"
447454
Write-OutputColor "" -color "Info"
448455
Write-OutputColor " [B] ◄ Back to Server Config" -color "Info"

Modules/49-MenuRunner.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,10 @@ function Start-Show-RolesFeaturesMenu {
253253
"8" { Show-GPOManagerManagement }
254254
"9" { Show-JEAManagement }
255255
"10" { Show-NPSManagement }
256+
"11" { Show-RemoteAccessManagement }
256257
"back" { return }
257258
default {
258-
Write-OutputColor " Invalid choice. Enter 1-10 or B." -color "Error"
259+
Write-OutputColor " Invalid choice. Enter 1-11 or B." -color "Error"
259260
Start-Sleep -Milliseconds 500
260261
}
261262
}

Modules/50-EntryPoint.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ function Assert-Elevation {
403403
@{ Action = 'GPODrift'; Description = 'Compare live GPOs against a baseline backup folder given in -Config <folder>' }
404404
@{ Action = 'JEAList'; Description = 'List the registered JEA (Just Enough Administration) constrained endpoints on this host' }
405405
@{ Action = 'NPSSetup'; Description = 'Install the Network Policy Server (NPAS / RADIUS) role' }
406+
@{ Action = 'AlwaysOnVPNSetup'; Description = 'Install the Remote Access role and configure RRAS as a VPN server' }
406407
@{ Action = 'Batch'; Description = 'JSON-driven full configuration' }
407408
)
408409
if ($script:CLIOutputFormat -eq 'JSON') {
@@ -2005,6 +2006,11 @@ footer{text-align:center;color:#999;font-size:12px;padding:16px}
20052006
$npsOk = Start-NPSSetup
20062007
[Environment]::Exit([int](-not $npsOk))
20072008
}
2009+
'AlwaysOnVPNSetup' {
2010+
# Install the Remote Access role and configure RRAS as a VPN server.
2011+
$aovpnOk = Start-AlwaysOnVPNSetup
2012+
[Environment]::Exit([int](-not $aovpnOk))
2013+
}
20082014
'Batch' {
20092015
if (-not $script:CLIConfig) {
20102016
Write-OutputColor " ERROR: -Action Batch requires -Config <path>" -color "Error"

0 commit comments

Comments
 (0)