Skip to content

Relax Windows Trusted Signing issuer check#589

Merged
AnthonyRonning merged 1 commit into
masterfrom
fix/windows-authenticode-issuer-pattern
Jun 26, 2026
Merged

Relax Windows Trusted Signing issuer check#589
AnthonyRonning merged 1 commit into
masterfrom
fix/windows-authenticode-issuer-pattern

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • accept Microsoft Trusted Signing's rotating numbered ID-verified issuer CA by default
  • keep exact signer CN verification against the configured Azure certificate profile name
  • keep an exact issuer override for emergency pinning if needed

Why

The master signed Windows build reached successful Azure signing, then failed our post-sign Authenticode verification because Microsoft issued from CA 04 while the verifier default pinned CA 03.

Validation

  • bash -n scripts/ci/_common.sh scripts/ci/desktop-windows-release.sh
  • git diff --check
  • nix flake check
  • pre-commit hook via nix develop .#ci -c git commit, including frontend format/build/tests

Open in Devin Review

Summary by CodeRabbit

  • Bug Fixes
    • Made Windows signature verification more flexible, allowing valid certificates from rotating Microsoft issuer names to pass.
    • Added support for an optional strict issuer check when a specific issuer is provided, while avoiding unnecessary failures for otherwise valid signatures.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@AnthonyRonning, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 36 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d2697f47-cad5-49e2-843d-8e65f739bbef

📥 Commits

Reviewing files that changed from the base of the PR and between a6cf6af and 01efd9b.

📒 Files selected for processing (1)
  • scripts/ci/_common.sh
📝 Walkthrough

Walkthrough

Windows Authenticode verification now passes an optional issuer override and a default issuer regex into the embedded PowerShell check. The signer loop uses exact issuer matching when the override is set, otherwise it matches the issuer against the pattern.

Changes

Windows Authenticode issuer policy

Layer / File(s) Summary
Issuer controls and matching
scripts/ci/_common.sh
The shell wrapper passes an optional exact issuer override and a default issuer pattern into PowerShell, and the signer loop uses exact comparison or regex matching based on the override value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • OpenSecretCloud/Maple#588: Changes the same Windows Authenticode verification path in scripts/ci/_common.sh, including issuer-based signer validation.
  • OpenSecretCloud/Maple#586: Also updates Authenticode verification behavior around signer identity handling in the same script.
  • OpenSecretCloud/Maple#587: Modifies the same verification function and PowerShell-based signature checking flow.

Poem

I hop by moonlit signing trails,
With regex whiskers and carrot sails.
If an issuer changes its name tonight,
My little nose still sniffs it right.
Thump-thump—verified delight.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: relaxing the Windows Trusted Signing issuer check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/windows-authenticode-issuer-pattern

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 26, 2026

Copy link
Copy Markdown

Deploying maple with  Cloudflare Pages  Cloudflare Pages

Latest commit: 01efd9b
Status: ✅  Deploy successful!
Preview URL: https://c090b1a9.maple-ca8.pages.dev
Branch Preview URL: https://fix-windows-authenticode-iss.maple-ca8.pages.dev

View logs

devin-ai-integration[bot]

This comment was marked as resolved.

@AnthonyRonning
AnthonyRonning force-pushed the fix/windows-authenticode-issuer-pattern branch from a73ea20 to a6cf6af Compare June 26, 2026 04:07

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
scripts/ci/_common.sh (1)

3663-3663: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Make the default issuer pattern tolerant of CA-number width and RDN spacing.

The default pattern bakes in two brittle assumptions that can reproduce the exact failure this PR addresses:

  • [0-9][0-9] matches exactly two digits. It works for CA 03/CA 04 today, but a single- or triple-digit rotation (CA 5, CA 100) would fail verification again.
  • The literal , separator requires one space after each comma. Note the CN check on Line 3700 deliberately tolerates spacing with (^|,\s*)…(\s*,|$). If X509Certificate2.Issuer renders the DN with different spacing on the runner, the issuer pattern fails while the CN check would not.
♻️ Proposed more tolerant default pattern
-    MAPLE_WINDOWS_AUTHENTICODE_EXPECTED_ISSUER_PATTERN="${MAPLE_WINDOWS_AUTHENTICODE_EXPECTED_ISSUER_PATTERN:-^CN=Microsoft ID Verified CS AOC CA [0-9][0-9], O=Microsoft Corporation, C=US$}" \
+    MAPLE_WINDOWS_AUTHENTICODE_EXPECTED_ISSUER_PATTERN="${MAPLE_WINDOWS_AUTHENTICODE_EXPECTED_ISSUER_PATTERN:-^CN=Microsoft ID Verified CS AOC CA [0-9]+,\s*O=Microsoft Corporation,\s*C=US$}" \

You may also want case-insensitive matching ([regex]::IsMatch($issuer, $expectedIssuerPattern, 'IgnoreCase')) if the DN casing isn't guaranteed.

Worth confirming the exact DN string Get-AuthenticodeSignature(...).SignerCertificate.Issuer emits on the CI runner (separator spacing, component order, and casing) so the default pattern matches what Microsoft Trusted Signing actually produces.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/ci/_common.sh` at line 3663, The default issuer regex in
MAPLE_WINDOWS_AUTHENTICODE_EXPECTED_ISSUER_PATTERN is too strict; update the
pattern to tolerate variable CA-number width and flexible RDN spacing. In
scripts/ci/_common.sh, adjust the default used by the Authenticode issuer check
so the Microsoft ID Verified CS AOC CA segment matches one or more digits
instead of exactly two, and make comma/space handling consistent with the more
permissive CN matching logic used elsewhere in the signing verification flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@scripts/ci/_common.sh`:
- Line 3663: The default issuer regex in
MAPLE_WINDOWS_AUTHENTICODE_EXPECTED_ISSUER_PATTERN is too strict; update the
pattern to tolerate variable CA-number width and flexible RDN spacing. In
scripts/ci/_common.sh, adjust the default used by the Authenticode issuer check
so the Microsoft ID Verified CS AOC CA segment matches one or more digits
instead of exactly two, and make comma/space handling consistent with the more
permissive CN matching logic used elsewhere in the signing verification flow.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d5c2c8b0-c02b-4462-a5ee-3fba35d50e3a

📥 Commits

Reviewing files that changed from the base of the PR and between 37c0662 and a6cf6af.

📒 Files selected for processing (1)
  • scripts/ci/_common.sh

@AnthonyRonning
AnthonyRonning force-pushed the fix/windows-authenticode-issuer-pattern branch from a6cf6af to 01efd9b Compare June 26, 2026 04:24
@AnthonyRonning
AnthonyRonning merged commit 7b2711b into master Jun 26, 2026
18 checks passed
@AnthonyRonning
AnthonyRonning deleted the fix/windows-authenticode-issuer-pattern branch June 26, 2026 04:41
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