Repository navigation
Add a consolidated security guidance page for developers - #735
Conversation
Certificate and Developer Mode guidance was spread across individual framework guides, which showed the commands to run but rarely explained what they change on the machine. Several consequences had no coverage at all: what trusting a certificate into LocalMachine\TrustedPeople actually grants and how to undo it, what Developer Mode enables, how to handle devcert.pfx, and why the documented default PFX password is only acceptable for a throwaway local test certificate. Add docs/security.md as the single authoritative page covering the development certificate lifecycle, Developer Mode, and production signing options, so a reader understands the consequence of each command before running it. Link it from the docs index, llms.txt, and SECURITY.md (keeping the existing reporting boilerplate intact), and update the Electron Forge example so the default certificate password is shown as a development-only value rather than a fine default.
There was a problem hiding this comment.
Pull request overview
Adds consolidated security guidance for development certificates, Developer Mode, and production signing.
Changes:
- Adds security guidance and cleanup instructions.
- Links the guidance from documentation indexes.
- Improves Electron signing-password handling.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
SECURITY.md |
Links developer security guidance. |
llms.txt |
Adds the security page. |
docs/security.md |
Documents certificates, Developer Mode, and signing. |
docs/README.md |
Adds navigation links. |
docs/guides/electron/packaging.md |
Uses an environment-based certificate password. |
Suppressed comments (2)
docs/security.md:173
- These are
winapp packoptions, notwinapp signoptions.winapp signrequires the certificate path as its second positional argument and uses--password, so following this production-signing guidance currently fails argument parsing.
- **A code-signing certificate from a trusted certificate authority** — use [`winapp sign`](usage.md#sign) with `--cert` and `--cert-password`. You are then responsible for storing the key material safely; keep it in a hardware token, a key vault, or your CI provider's secret store, and never in the repository.
docs/security.md:184
- This example uses options that
winapp signdoes not accept. Pass the certificate path positionally and use--password; otherwise the documented CI command exits with parse errors.
winapp sign .\MyApp.msix --cert $env:SIGNING_CERT_PATH --cert-password $env:SIGNING_CERT_PASSWORD
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Build Metrics ReportBinary Sizes
Test Results✅ 4562 passed, 5 skipped out of 4567 tests in 575.6s (+7 tests, -258.0s vs. baseline) Test Coverage✅ 89.1% line coverage, 82.4% branch coverage · ✅ no change vs. baseline CLI Startup Time48ms median (x64, Try This BuildInstalls the MSIX for your architecture, replacing any previously installed build. Needs the GitHub CLI — the command offers to install it and sign you in if it is missing. & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) 735Switching between builds often?Put the tool on your PATH once: & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) -AddToPathThen this build is just: winapp-pr 735Run Updated 2026-08-12 19:31:19 UTC · commit |
…context Three problems in the new security page taught commands that do not work, or that leave state behind. winapp sign takes the certificate as a positional argument with --password; the page described a --cert-password option that only exists on winapp package. A systematic pass over every command mentioned also turned up --no-prompt on winapp init, which does not exist either -- only --use-defaults does, and its documented behavior of leaving Developer Mode untouched is correct. The certificate cleanup told the reader to remove the CurrentUser copy from an elevated prompt. If elevation uses a different administrator account, that path resolves to the administrator store and the private key survives in the generating user account. Split the two removals and state which context each one runs in. The Electron guide linked ../security.md from docs/guides/electron/, which resolves one directory short of the new page.
|
Thanks — all three were real. Fixed, plus two more of the same class that I found by checking the rest of the page systematically rather than only the flagged lines. 1. 2. 3. Broken Additionally found while checking the rest of the page:
Verification performed:
|
usage.md documented winapp sign as taking --cert and --cert-password. Neither exists on that command: the certificate is a second positional argument and the password option is --password. It also omitted cert-path and --timestamp. This is where the same error in the new security page came from, and the security page links to this anchor, so a reader who followed the link still got instructions that fail. Verified against docs/cli-schema.json, which is generated from the CLI: sign args=[file-path,cert-path] opts=[--password,--quiet,--timestamp,--verbose].
port-mslearn-docs.ps1 keeps a curated nav tree, and the Pester suite asserts every ported page appears as a toc href. security.md is picked up by the port glob, so adding the page without a nav entry broke that test -- which is the check doing its job: a page that ports but never appears in the left nav is invisible on Learn. Listed top level after UI Automation, labelled from its H1.
Resolves #902 ## What Adds a direct link to `docs/security.md` from the top-level `README.md`, placed as a "See also" line under the **Certificates & Signing** section of the Commands Overview — matching the existing pattern used for the Debugging Guide. ## Why `docs/security.md` (the consolidated security guidance page from #735) was only reachable indirectly via the docs hub (`docs/README.md`), so a developer starting from the repo root was unlikely to discover it. Its content (certificates, Developer Mode, signing, trust) maps naturally to the Certificates & Signing section. The link points to the canonical page rather than duplicating any content, per the repo's "state each user-facing fact once on its canonical surface" guidance. Docs-only change; no build impact. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
What was missing
The repo had no consolidated security guidance.
SECURITY.mdwas only the standard vulnerability-reporting boilerplate, and certificate / Developer Mode guidance was spread across individual framework guides — they show the commands, but rarely the consequence of running them.Several things had no coverage anywhere:
LocalMachine\TrustedPeopleactually grants, and how to remove it later.devcert.pfx— keeping it out of source control and out of the packaged output.password) leaves the private key effectively unprotected, and that this is fine only for a throwaway local test certificate.What this adds
A single new page,
docs/security.md, rather than warnings scattered through every guide:winapp cert generateproduces (RSA-2048 / SHA-256, code-signing EKU, non-CA, 365-day default, exportable key, plus a copy inCert:\CurrentUser\My), what the default password means, whydevcert.pfxmust stay out of both git and the packaged folder, whatwinapp cert installgrants viaLocalMachine\TrustedPeople, and how to remove a certificate when you are done with it.HKLM\...\AppModelUnlockvalues the CLI writes, why there is a UAC prompt, what the machine will then accept, howwinapp initprompts (and skips the prompt under--use-defaults/ non-interactive, so CI is unaffected), and how to turn it back off.winapp az-sign, a CA-issued certificate viawinapp sign, or Store submission, plus keeping certificate passwords in a CI secret store.Supporting changes
docs/README.md— links the new page from the additional-guides list and Related topics (hand-maintained index, no auto-discovery).llms.txt— adds the page to the Docs list.SECURITY.md— adds a short section linking the new page. The existing Microsoft reporting block is untouched.docs/guides/electron/packaging.md— the Electron Forge example previously showedcertificatePassword: 'password'with no comment. The example still works, but now reads the password from an environment variable with the dev-certificate default as a fallback, and an admonition explains why a real signing password must never live in a committedforge.config.js.Tone
Factual and proportionate. Development certificates and Developer Mode are the normal path for local testing and the page says so; the goal is that a reader understands the consequence of each command before running it.
Validation
No CLI or build surface changed, so nothing needed rebuilding. Every relative link and
usage.mdanchor referenced by the new page was verified to resolve against a real file/heading in the tree. The page satisfies the MS Learn front-matter rules used byscripts/validate-mslearn-docs.ps1:<!-- mslearn: true -->marker present, H1 title, a distinct<!-- description: ... -->of 137 characters (within the 115–145 range), YAML-safe as a plain scalar, no banned marketing words, and all callouts use MS Learn alert syntax.