Skip to content

Check the SCOrch transport in both switch directions - #785

Merged
Sev7eNup merged 3 commits into
mainfrom
fix/audit-switcher-transport
Nov 3, 2026
Merged

Sev7eNup merged 3 commits into
mainfrom
fix/audit-switcher-transport

Conversation

@Sev7eNup

@Sev7eNup Sev7eNup commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Third of three setup/switcher PRs from the 2026-10-28 audit. Stacked on #783 and #784; the change of its own is the last commit.

What changes

Switching to NodePilot also calls SCOrch, to stop its running jobs, but the preflight only validated the NodePilot side. A remote http:// SCOrch URL was therefore accepted in that direction and used with Windows credentials, while the other direction rejected it.

  • The preflight validates the SCOrch configuration for both targets.
  • The loopback-or-HTTPS rule moves into SwitcherConfigurationValidator.RequireScorchTransport, and the ScorchApiClient constructor enforces it as well, so no other caller can bypass it.

docs/switcher.md already states the rule; the code now matches it in both directions.

Testing

  • dotnet test tests/NodePilot.Switcher.Tests: 175 of 175 pass. They include the new preflight case for both directions, which must fail before a SCOrch client is created, and the constructor cases (remote HTTP and non-HTTP schemes rejected; loopback HTTP and HTTPS accepted).
  • Lab: the CM1 configuration uses http://localhost:81, which stays allowed. No live preflight was run against SCOrch.

Closes #728

🤖 Generated with Claude Code

Sev7eNup and others added 3 commits November 3, 2026 21:31
- Setup health probe and first login pin the configured server
  certificate per request and reject redirects, instead of switching
  off certificate validation for the whole process (D01).
- A failed reinstall that changes the service account restores the
  install root DACL before the old binaries come back (#735).
- Uninstall stops when the service cannot be deleted, keeps the
  marker and deploy\ until everything else is gone, and the Inno
  uninstaller aborts on a failed cleanup so it can be repeated (#714,
  server part).
- PurgeData takes ownership with takeown /A item by item, so it works
  on German Windows, and deletes nothing when a native step fails
  (#731).
- The gMSA repair command reads the existing retrieval principals and
  adds this host; the deploy README drops the blanket RBCD recipe
  (#713).

Closes #713
Closes #731
Closes #735
Refs #714

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Update-Desktop.ps1 passes the custom data path and service names to
  re-provisioning instead of letting it fall back to defaults (#709).
- The staged update snapshots both service registrations and the
  component ACLs; the rollback registers the services again before the
  database restore and fails explicitly when one is missing (#710).
- Setup identifies the account that started it (ExecAsOriginalUser) and
  passes its SID as -HandoffUserSid; the provisioner no longer falls
  back to the console user or its own profile (#732).
- The desktop uninstaller aborts on a failed or missing cleanup, so the
  uninstall can be repeated (#714, desktop part).

Closes #709
Closes #710
Closes #714
Closes #732

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Switching to NodePilot also stops SCOrch jobs, but the preflight only
validated the NodePilot side, so a remote http:// SCOrch URL was used
with Windows credentials. The preflight now validates SCOrch for both
targets, and the ScorchApiClient constructor enforces the same
loopback-or-HTTPS rule.

Closes #728

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
public async Task Preflight_RejectsRemoteHttpScorchSourceOrDestination(bool toNodePilot)
{
var target = toNodePilot ? SwitchTarget.NodePilot : SwitchTarget.SystemCenterOrchestrator;
File.WriteAllText(Path.Combine(_directory, "np.exe"), string.Empty);
{
var target = toNodePilot ? SwitchTarget.NodePilot : SwitchTarget.SystemCenterOrchestrator;
File.WriteAllText(Path.Combine(_directory, "np.exe"), string.Empty);
var config = Path.Combine(_directory, "custom.json");
@Sev7eNup
Sev7eNup merged commit 2020a88 into main Nov 3, 2026
17 checks passed
@Sev7eNup
Sev7eNup deleted the fix/audit-switcher-transport branch November 3, 2026 21:32
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.

Validate the SCOrch source connection before switching workloads

2 participants