Sign and notarize macOS releases to avoid Gatekeeper “Allow Anyway”

Aperta
#967 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp, github-actions, macos, powershell
Ambito
devops, release

Direzione di ricerca

Start with .github/workflows/build.yml and the existing release scripts, then trace where the two self-contained macOS ZIPs are built and where checksums, manifests, and Homebrew cask checksums are generated. Map the signing and notarization steps onto that release flow, including protected CI secrets and diagnostic artifacts. Done means both final downloadable architectures pass signature and notarization checks and run through a quarantined browser download on a clean Mac without Allow Anyway; record OS and architecture coverage and document credential setup and ticket delivery.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is your feature request related to a problem? Please describe.

macOS Gatekeeper blocks the downloaded grate executable, requiring users to open System Settings → Privacy & Security and select Allow Anyway before running it.

A user-provided screenshot shows:

  • “'grate' was blocked to protect your Mac.”
  • “Apple could not verify 'grate' is free of malware that may harm your Mac or compromise your privacy.”

The screenshot also shows an administratively managed “App Store & Known Developers” policy. Additional enterprise restrictions may apply independently.

Reported reproduction: download a macOS distribution, extract it and attempt to run grate. The exact release, macOS version, architecture and download channel were not supplied; this report has not been independently reproduced.

Describe the solution you'd like

Sign the macOS release executables with an Apple Developer ID Application certificate and notarize the resulting distributions with Apple as part of the release workflow. Users downloading an official release should be able to run it under normal Gatekeeper settings without selecting Allow Anyway or removing quarantine attributes.

Cover both existing self-contained release assets:

  • grate-osx-arm64-self-contained-<version>.zip
  • grate-osx-x64-self-contained-<version>.zip

Integrate with .github/workflows/build.yml and the existing release scripts. Signing/notarization must happen before final checksums, release manifests and Homebrew cask checksums are generated. Use PowerShell 7 for new repository automation, following the repository conventions.

Acceptance criteria

  • Both macOS architectures are signed with the intended Developer ID identity and accepted by Apple's notarization service. Include the required runtime-signing options and bundled native code, as applicable to the actual published output.
  • A release cannot publish macOS assets as successfully verified if signing, notarization or final signature verification fails. Retain useful notarization diagnostics in CI artifacts.
  • Verify the exact final downloadable artifacts on macOS, including a browser download/extraction path that preserves quarantine. On a clean user/VM with standard Gatekeeper settings and internet access, grate --version and grate --help run without Allow Anyway, quarantine removal or disabling Gatekeeper. Record tested OS versions and architecture coverage.
  • Handle notarization-ticket delivery for the actual CLI/ZIP format: account for stapling limitations and document first-run network requirements. If offline first launch requires an additional supported container, document the tradeoff before changing the distribution format.
  • Store signing credentials and notarization authentication in protected CI secrets, clean up temporary signing material, and allow untrusted pull-request builds to run without access to those secrets.
  • The published release manifest/checksums and Homebrew cask refer to the final signed artifacts. Document certificate/authentication setup, renewal and release verification in the release configuration/runbook.

Describe alternatives you've considered

Manually selecting Allow Anyway is the current workaround. Requiring users to disable Gatekeeper or strip quarantine attributes should not be the normal installation path.

Additional context

The maintainer reports having an Apple developer account. Confirm active Developer Program membership, the signing identity and CI authentication during implementation; account creation alone does not establish that these are configured.

Scope: official standalone macOS CLI distributions and their release/Homebrew integration. Existing enterprise policies remain outside the release pipeline's control.

Apple references:

Lingua principale
C#
Stelle
305
Fork
59
Merge medio
1g 27m
PR unite (30g)
79

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di grate-devs/grate

Tutte le issue di grate-devs/grate

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.