Sub topic 7
Notarization: Apple's automated check
This chapter assumes you know what code signing and a Developer ID are, and that you can run a command in Terminal. It covers what notarization is, what it does and does not prove, and how to check it on a Mac.
What notarization is
Notarization is an automated scan that Apple runs on software distributed outside the Mac App Store. A developer signs the app with their Developer ID certificate and uploads it to Apple. Apple's service scans it for known malicious content and for signing problems. If the scan passes, Apple records a notarization ticket for that exact build.
Notarization is not App Review. No person judges whether the app is useful, honest, or well designed. It is a machine check on a specific build.
How the pieces fit
- The developer builds the app, signs it, and enables the hardened runtime. This is a set of runtime restrictions that notarization requires.
- The developer uploads the build to Apple's notary service.
- Apple scans it and returns a pass or a list of problems.
- On a pass, the developer usually staples the ticket to the app. Stapling attaches the ticket so it travels inside the file.
- When you first open the app, Gatekeeper looks for the ticket. It finds it attached, or it asks Apple's servers for it.
Checking notarization yourself
Two commands answer the question. Replace the path with your app.
spctl --assess --type execute --verbose=4 /Applications/Example.appA notarized app reports source=Notarized Developer ID. An app that is signed but not notarized reports source=Developer ID, and on current macOS versions Gatekeeper will usually refuse to open it without extra steps.
xcrun stapler validate /Applications/Example.appThis reports whether a ticket is stapled. If it says The validate action worked!, the ticket is attached, and Gatekeeper can accept the app even when your Mac is offline.
A missing stapled ticket does not mean the app is not notarized. Some developers skip stapling. In that case Gatekeeper checks online, and spctl can still report Notarized Developer ID.
Common errors in judging notarization
- Treating notarization as a safety guarantee. A notarized app passed an automated scan. A malicious developer can still get a harmful app through, and Apple can revoke the ticket afterward.
- Confusing it with signing. Signing says who built the app and that it has not changed. Notarization adds Apple's scan result. You need both.
- Expecting it on App Store apps. Mac App Store apps go through App Review instead.
spctlreports their source asMac App Store. - Assuming a stapler failure means danger. It can simply mean the developer did not staple. Check with
spctlbefore drawing a conclusion.
Exercise
You run spctl on a downloaded app and it reports source=Developer ID, not Notarized Developer ID. What does this tell you, and what would you do next?
Show answer
The app is signed by a developer but Apple has not notarized it, so Gatekeeper will likely block it on current macOS. Don't bypass the block. Check the developer's official site for a newer, notarized version, or ask the developer, and treat the app with extra caution until you know why it is not notarized.
Exercise
xcrun stapler validate reports that the app has no ticket, yet spctl says Notarized Developer ID. How is that possible?
Show answer
The app was notarized, but the developer did not staple the ticket to it. Gatekeeper finds the ticket by asking Apple's servers, so it works while you are online but not offline.