Sub topic 7
Notarization: Apple's automated check
This chapter assumes you know what code signing and a Developer ID are (the previous chapter), and that you can open Terminal and run a command. Notarization is the second step in how apps distributed outside the Mac App Store earn trust. It changes what Gatekeeper decides at first launch.
What notarization is
Notarization is an automated scan that Apple runs on software before a developer distributes it on the web. The developer uploads a signed build, and Apple's service analyzes it for known malicious content and for signing problems. If the build passes, Apple records a notarization ticket for it. Gatekeeper later uses that ticket to decide whether to let the app open.
Notarization is not App Review. No person evaluates the app's features, privacy practices, or design. It also doesn't apply the App Sandbox. The scan answers a narrow question: does this signed code contain known malware, and is it signed correctly? Apple can also use the record to revoke trust later.
Since macOS 10.15 Catalina, Gatekeeper expects software signed with a Developer ID to be notarized. An app that is signed but not notarized gets blocked or warned about on a default configuration. The "Gatekeeper" chapter covers the exact dialogs.
What a developer has to do
The developer's side explains what a notarized app tells you. Before submission, the developer must:
- Sign every executable inside the app, including helpers, frameworks, and plug-ins, with a Developer ID certificate.
- Enable the hardened runtime, a set of restrictions on what the process can do at runtime, such as injecting code or loading unsigned libraries. Exceptions are declared as entitlements.
- Include a secure timestamp in the signature, so the signature stays valid after the certificate expires.
- Leave out debugging entitlements such as
com.apple.security.get-task-allow.
The upload and the wait look like this with Apple's notarytool:
# Package the signed app for upload
ditto -c -k --keepParent Example.app Example.zip
# Submit and wait for Apple's verdict
xcrun notarytool submit Example.zip --keychain-profile "notary-profile" --wait
# If accepted, attach the ticket to the app
xcrun stapler staple Example.appThe --keychain-profile option refers to credentials the developer saved earlier with xcrun notarytool store-credentials. If the scan fails, notarytool log returns a JSON report listing the specific problems, such as an unsigned nested binary.
Stapled tickets and online checks
A ticket can reach your Mac in two ways:
- Stapled. The developer attaches the ticket to the app, disk image, or installer package. Gatekeeper reads it from the file, so the check works offline.
- Online lookup. If nothing is stapled, Gatekeeper asks Apple's servers whether a ticket exists for that code's signature. This needs an internet connection.
You can check both. Start with Gatekeeper's verdict:
spctl --assess --type execute --verbose=4 /Applications/Example.appA notarized app typically reports accepted along with source=Notarized Developer ID and an origin= line naming the developer and Team ID. An App Store app reports source=Mac App Store. A signed but unnotarized app is rejected, with a reason such as source=Unnotarized Developer ID.
Then check for a stapled ticket:
xcrun stapler validate /Applications/Example.appSuccess prints The validate action worked!. If the app has no stapled ticket, the tool says so.
What stapling can and cannot attach to
You can staple a ticket to an .app bundle, a .dmg, or a .pkg. You cannot staple to a plain .zip. Developers who ship a zip therefore staple the app first and zip it afterward. If you see a zip that contains an app which then validates, that is why.
A common pattern is to notarize and staple the disk image itself. The ticket then travels with the container, and the app inside is also covered when it was submitted as part of the same upload.
Limits of the guarantee
Notarization lowers risk, but it has real limits:
| Notarization tells you | Notarization does not tell you |
|---|---|
| Apple scanned this exact signed code and found no known malware at the time | The app is free of bugs, tracking, or aggressive data collection |
| The code is signed by an identifiable developer (Team ID) | The developer is who you think they are. Check the name and Team ID yourself |
| The code hasn't been modified since signing | The website you downloaded from is legitimate |
| Apple can revoke the ticket if the app is later found abusive | Apple has reviewed the app's behavior as App Review does |
Attackers have obtained Developer ID certificates and passed notarization with malicious software. Apple responds by revoking tickets and certificates, and Gatekeeper and XProtect then block the affected code. That response happens after the fact, so the checks in later chapters (vetting the source, verifying the checksum, reviewing permissions) still matter.
Notarization also doesn't replace the sandbox. A notarized app is usually not sandboxed, so it has the broad file and system access of your user account unless macOS privacy controls limit it.
Common errors and what they mean
- "Apple could not verify ... is free of malware" at launch. Gatekeeper found no valid ticket. Causes include a build that was never notarized, a ticket revoked after the fact, or an offline Mac with nothing stapled. Don't bypass this by default. The "What to do when Gatekeeper blocks an app" chapter walks through the decision.
spctlsaysrejectedwithsource=Unnotarized Developer ID. The app is signed correctly, but Apple has no ticket for it. Treat it as an app whose developer skipped a safeguard.stapler validatereports no ticket on an app thatspctlaccepts. This is normal when the developer relies on online lookup.spctlaccepts the app, but the app was modified after you installed it. Runcodesign --verify --deep --strictas covered earlier. A changed bundle fails the signature check even if the original was notarized.- Developer-side rejection for hardened runtime or timestamp. If you build software yourself,
notarytool lognames the failing file. A nested helper that was not signed with--options runtimeand--timestampis the usual cause.
Exercise
You run spctl --assess --type execute --verbose=4 on an app and get accepted with source=Notarized Developer ID. Then xcrun stapler validate on the same app says it has no ticket stapled. Is the app notarized, and will it open when your Mac is offline?
Show answer
Yes, it is notarized, because Gatekeeper's verdict shows a notarized source, which it found through an online lookup of the ticket. Without a stapled ticket, Gatekeeper can only confirm that online. On an offline Mac, the first launch may therefore be blocked or warned about. Once the app has passed its first launch check, it generally keeps opening.
Exercise
Name two things notarization cannot tell you about an app, and one thing you should check yourself.
Show answer
It cannot tell you that the app is free of privacy-invasive behavior, and it cannot tell you that the website you downloaded from is legitimate. A fake app with its own valid Developer ID can also be notarized. You should confirm that the developer name and Team ID shown by codesign -dv or spctl match what the vendor publishes on its official site.