Skip to content

Protect setup files and avoid publisher trust prompts - #103

Merged
AmirMS (AmelBawa-msft) merged 2 commits into
mainfrom
user/amelbawa/dev-config-pe
Sep 17, 2026
Merged

AmirMS (AmelBawa-msft) merged 2 commits into
mainfrom
user/amelbawa/dev-config-pe

Conversation

@AmelBawa-msft

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Signature verification currently fails on supported PowerShell versions before 7.4, and existing install roots may prevent reboot resume.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Secures Calm OS setup files and replaces AllSigned launches with verified, prompt-free RemoteSigned execution.

Changes:

  • Adds signature and ACL validation.
  • Installs under protected %ProgramData%\CalmOS.
  • Updates bootstrap, relaunch behavior, and documentation.
File summaries
File Description
src/windows-dev-config/steps/_security.ps1 Adds signature and permission checks.
src/windows-dev-config/steps/_elevation.ps1 Uses RemoteSigned for relaunches.
src/windows-dev-config/dev-config.ps1 Validates files before loading helpers.
src/windows-dev-config/bootstrap.ps1 Adds protected download, installation, and elevation.
src/windows-dev-config/README.md Documents the new security model.
src/docs/development.md Updates contributor guidance.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/windows-dev-config/bootstrap.ps1
Comment thread src/windows-dev-config/dev-config.ps1
Comment thread src/windows-dev-config/steps/_security.ps1

@JohnMcPMS JohnMcPMS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the lack of support for the memory-based signature check, I think the path is:

  1. First run creates directory under install root, copies all scripts there.
  2. Changes owner and ACLs to admin only write with everyone read/execute
  3. Verifies signature on the entry point script one more time
  4. Invokes the entry point script with signature validation elevated
  5. Elevated script revalidates signatures for all files
  6. Continue with actual work

Comment thread src/windows-dev-config/bootstrap.ps1 Outdated

@ranm-msft ranm-msft left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read this end to end against the head commit. The hardening looks solid, and several details are clearly deliberate: rejecting reparse points, walking every ancestor with DeleteSubdirectoriesAndFiles in the ancestor mask, creating the root atomically with its ACL instead of create-then-ACL, and having dev-config.ps1 verify and execute the same in-memory text of _security.ps1 so there is no file-swap window. I also confirmed the earlier AllSigned concern is resolved in 8c21cce - the pre-rejection is gone, _elevation.ps1 relaunches with RemoteSigned, and only an org-enforced Restricted still blocks.

Two things I would like your read on:

  1. An existing install root never gets its ACL reconciled. New-DevConfigProtectedDirectory applies the hardened ACL only inside if (-not (Test-Path -LiteralPath $Path)), and Assert-DevConfigProtectedTree only proves non-admins lack dangerous rights - never that the resume identity has traverse/read/execute. So a pre-existing Administrators-only %ProgramData%\CalmOS passes every check and the elevated run finishes normally. But the resume task is registered -RunLevel Limited, and after the reboot PowerShell has to open dev-config.ps1 before any in-script elevation runs, so it can fail before it ever reaches UAC or the setup log. Could the existing-root path reconcile a canonical ACL, or otherwise verify effective RX for the resume principal? (This expands the still-open Copilot comment on _security.ps1.)

  2. Resume identity under over-the-shoulder elevation. Suspend-DevConfigForReboot reads [WindowsIdentity]::GetCurrent().Name while already elevated, so if a standard user starts setup and supplies a different administrator's credentials, the -AtLogOn trigger is registered for that administrator and will not fire when the original user signs back in. Is that scenario in scope?

@AmelBawa-msft
AmirMS (AmelBawa-msft) marked this pull request as ready for review September 17, 2026 20:17
@AmelBawa-msft
AmirMS (AmelBawa-msft) merged commit 46b708a into main Sep 17, 2026
12 checks passed
@AmelBawa-msft
AmirMS (AmelBawa-msft) deleted the user/amelbawa/dev-config-pe branch September 17, 2026 21:51
Laurent Zogaj (26zl) added a commit to 26zl/WindowsDeveloperConfig that referenced this pull request Sep 22, 2026
Brings in bf74ae3 (microsoft#103, microsoft#105, microsoft#106, microsoft#107). .gitattributes keeps both
sides: the fork's *.sh eol=lf rule and upstream's -text rules for the
signed release copies.
Laurent Zogaj (26zl) added a commit to 26zl/WindowsDeveloperConfig that referenced this pull request Sep 22, 2026
- Last merged upstream commit is now bf74ae3.
- The signed flow no longer depends on AllSigned; since microsoft#103 it checks
  signatures and an Administrator/SYSTEM-only folder instead. Both are
  skipped with -AllowUnsigned, so apply-ps-flow.ps1 keeps working
  (verified with -NoLaunch against the merged tree).
- New caveat: upstream's -text rule checks out the Workloads\ and
  wsl-comfort\ signed copies as LF, so they are NotSigned in a fresh
  clone or ZIP.
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.

4 participants