Skip to content

Add Remote Access / Always-On VPN module (74-AlwaysOnVPN) - #39

Merged
TheAbider merged 1 commit into
masterfrom
feature/v1.105.0-aovpn
May 29, 2026
Merged

Add Remote Access / Always-On VPN module (74-AlwaysOnVPN)#39
TheAbider merged 1 commit into
masterfrom
feature/v1.105.0-aovpn

Conversation

@TheAbider

Copy link
Copy Markdown
Owner

Summary

New module 74-AlwaysOnVPN adds the Windows Remote Access (RRAS) VPN server and Always-On VPN profile generation — the 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 Remote Access role — DirectAccess and VPN (RAS), reversible via Install-WindowsFeatureWithTimeout with a registered undo.
  • Configure the VPN serverInstall-RemoteAccess -VpnType Vpn (SSTP + IKEv2). Undo tears the configuration back down.
  • RADIUS (NPS) authentication — register an NPS server as the VPN's RADIUS auth source. The shared secret is a SecureString, converted to plaintext only for the Add-RemoteAccessRadius call and zeroed after — never in the Dry-Run queue, its JSON export, or any file. Undo removes the RADIUS server and reverts auth back to Windows (so it can't be left pointing at a removed server).
  • Generate Always-On VPN profiles — device-tunnel (machine-cert) or user-tunnel (EAP-TLS) ProfileXML from prompts: server FQDN, protocol (IKEv2/SSTP/Automatic), split- vs force-tunnel, DNS suffix, split-tunnel routes.
  • Show the current Remote Access / VPN configuration.

Security

  • ProfileXML is written through Get-RackStackSecureStateDir (Admins S-1-5-32-544 + SYSTEM S-1-5-18-only DACL), not a world-readable temp path.
  • All user-supplied values flowing into the ProfileXML (FQDN, DNS suffix, routes) are XML-escaped via SecurityElement::Escape, so a stray </&/</...> can't break out of an element or extend the profile. (Caught by the pre-ship security review, along with the undo auth-revert.)

Integration

Wired into all 9 points: loader, -Action ValidateSet, entry-point dispatch (AlwaysOnVPNSetup), Roles & Features menu (item 11), menu runner, version (4 files), test suite (Section 171), and the monolithic build's module count.

Validation

  • Module count 74 → 75
  • 4944 / 4944 tests pass, 0 failures
  • PSScriptAnalyzer: 0 errors / 0 warnings
  • Monolithic build parses clean; hostile-input XML escaping verified well-formed

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.
@TheAbider
TheAbider merged commit e7011cd into master May 29, 2026
6 checks passed
@codecov

codecov Bot commented May 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@TheAbider
TheAbider deleted the feature/v1.105.0-aovpn branch May 29, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant