Live data from Hacker News

The Gates to Hell: Apple’s Notarizing

cdfinder.de

111–120 of 214 posts

Re: The Gates to Hell: Apple’s Notarizing

#111
post #38

Earlier quoted context omitted.

No, if your subscription lapses previously released software won't stop working. If you are offering free software you can sign with an ad-hoc certificate, and instruct the user on how to bypass gatekeeper, which isn't great at all but it doesn't cost any $$.

Looks like this explains how: https://www.digicert.com/kb/code-signing/mac-os-codesign-too... but... "only Apple Developer code signing certificates are compatible with GateKeeper" Does code-signing with an ad hoc certificate and no notarization provide any better experience than just unsigned code? Do you get a friendlier message (c/f "malicious software: Move to Trash") when Gatekeeper blocks it?

Unsigned (arm64) binaries don't run at all on M1 Macs, so yes, an ad-hoc certificate provides a better experience ;)

Re: The Gates to Hell: Apple’s Notarizing

#112
post #35

For our small software company, notarization took at least 40 hours of additional work, and slows down releases. Anyone knows if "stapling" the distributed bundles files (.app .pkg executable files etc.) is useful in any way ?

I rearranged my CI graph to run notarization in parallel with my unit tests, and turned on GitLab's DAG to allow jobs from different stages to run at the same time as long as their dependencies are satisfied, so the impact of the notarization step has been small.

My CI pipeline is build -> test -> deploy. The Mac "build" job uploads the app for notarization as a side effect. There is an additional "mac archive" job during the test stage. This job runs general tests on the DMG (checks code signing is valid, makes sure I'm not depending on system libraries), then waits for notarization to finish and staples the DMG. By the time I'm done mounting and checking the DMG, notarization is almost done anyway.

My typical release time right now (from git push to having a fresh app available to install for windows/linux/mac) is 7 minutes. I think I could get it down to around 3 minutes with optimizations.

My primary bottleneck right now is building / xz-compressing a windows installer (which means my windows tests finish last).

Re: The Gates to Hell: Apple’s Notarizing

#113
post #2

Apple devices are becoming increasingly unusable for developers. Fantastic opportunity for Linux apps to gain more dev resources, as anyone with a bit of foresight sees little future in macOS, iOS, Windows, or Android as development platforms.

> Fantastic opportunity for Linux apps to gain more dev resources

The problem is that they’d rather complain about systemd or reinvent the wheel in 10 different ways which in the end means their resources are spread thin and nothing gets done.

Re: The Gates to Hell: Apple’s Notarizing

#114
post #25

Earlier quoted context omitted.

Why do users choose a platform? Apps. Who makes the apps? Developers embraced Windows over Mac, users followed. (Until iOS development made Mac's the default dev machine.) Developers embraced iOS and Android over Symbian and webOS. Windows and Mac were great development platforms ten years ago, and iOS and Android were way better than the now-dead competition.

> Until iOS development made Mac's the default dev machine. I'd argue Mac's were the default developer machine before iOS. E.g., Paul Graham from 2005 ( http://www.paulgraham.com/mac.html ): > All the best hackers I know are gradually switching to Macs. My friend Robert said his whole research group at MIT recently bought themselves Powerbooks. These guys are not the graphic designers and grandmas who were buying Mac…

HN ist a bubble. There are millions of developers writing software for embedded controllers and other hardware which is done on Windows and Linux. Plus a plethora of B2B software HN never heard of because it runs in corporate environments powered by Windows.

Re: The Gates to Hell: Apple’s Notarizing

#115
My advice from years of notarizing my apps is to make sure you do it at least once per day for each of your apps. If you only notarize once every release (say, every month or so), you are almost guaranteed to encounter some new cryptic error that you've never seen before, either due to some glitch in signing your app or frameworks, or else some server-side error such as new terms & conditions that you are being "encouraged" to agree to. It will take you hours to research and resolve them if they aren't spotted right away.

As others pointed out, https://github.com/mitchellh/gon is a great tool for doing this on your local machine (e.g., with a cron job). In addition, if you are building your app using a GitHub action (which I highly recommend if it is open-source), you can use my https://github.com/hubomatic/hubomat action to package, notarize, and staple a release build in one shot. The sample/template app does this automatically on every commit as well as once per day: https://github.com/hubomatic/MicroVector/actions.

So when this fails from a scheduled job, you at least know that something has changed on the Apple side and can investigate that right away. And if it fails as a result of a commit, then at least you can start looking at what changes you may have made to your entitlements or code signing settings or embedded frameworks or any of the other million things that can cause it to fail.

Re: The Gates to Hell: Apple’s Notarizing

#116

And, not mentioned in the article... you have to have an Apple Developer ID which costs £79/year ($99). Presumably if your subscription lapses any previously released software will stop working? That is the part I find most offensive, if it was just difficult and buggy I would suck it up and work around it. But having to pay for the privilege is too painful, particularly if you're offering free software. For my case…

Code signing isn’t linked to an active developer subscription, if it lapses all existing signatures are still valid - you just can’t sign more.

What happens when the cert root expires? Does it not expire or does Apple grant an eternal valid signature when apps were signed before the root expired?

Re: The Gates to Hell: Apple’s Notarizing

#117
post #3

If you're going to rant about details, it helps to actually get the details right. For example, showing a screenshot that doesn't contain the word "malware" and then saying: > Using my application name and the word "malware" in one sentence is suggestive and extremely offensive by Apple. Does not fill me with much hope that the author is detail-oriented. I'll keep reading, and I know already that the notarizing proce…

I had the same initial reaction about misquoting. However, Apple also uses dialog boxes that use the word "malware", specifically: "macOS cannot verify that this app is free from malware." See screenshots at https://support.apple.com/en-us/HT202491

Re: The Gates to Hell: Apple’s Notarizing

#118

Earlier quoted context omitted.

In python there are a handful of .so files in subdirectories you need to sign. You can basically `find . -name \*.dylib -o -name \*.so` and codesign those.

I'm fairly certain that you just need to codesign --deep here, as that's all I've ever done.

That seems to work if you put the entire Python stdlib under Frameworks but not if it's somewhere else.

I do the `find` thing because I pre-sign my libraries when I build them to save a bit of time during app build.

Re: The Gates to Hell: Apple’s Notarizing

#119

My advice from years of notarizing my apps is to make sure you do it at least once per day for each of your apps. If you only notarize once every release (say, every month or so), you are almost guaranteed to encounter some new cryptic error that you've never seen before, either due to some glitch in signing your app or frameworks, or else some server-side error such as new terms & conditions that you are being "enco…

I auto notarize my app when I push to a release-candidate branch even if I don't deploy it. I also have a general code signing CI test that catches stuff before notarization would. I believe I've never, in thousands of pushes to this branch, hit a non-obvious notarization issue.

The main annoying thing so far for me using notarization long term is the terms and conditions signing step, which is silly because they're only updating the paid apps contract and we're notarizing explicitly so we can distribute outside the app store.

Re: The Gates to Hell: Apple’s Notarizing

#120
post #13

I wrote a little sh script to notarize HandBrake two (or maybe three) years ago, and that's was it. It's not rocket science. But like every new thing, it required a bit of time to read the documentation and to understand what's going on. The plugin issue described in the article is probably related to the hardened runtime, so it's unrelated to the actual notarisation process.

I got all the Airwindows audio unit plugins notarized in about a week (that's several hundred distinct plugins), and used third party apps to do it (DropDMG and SD Notary)

The trouble I ran into was this: Apple wants the process to be a little mystifying as a barrier to people trying to find exploits within it, I think. I disagree: for instance, using a shell script and the Apple terminal tools is very much the Apple-intended approach, but integrating the third party tool got me sending code to Apple's servers quicker, and it's those servers that matter. I wasn't considered a significant developer to Apple, nor will I ever be, but I code open source software that's being adopted by other projects and used as an on-ramp for would-be DSP coders: my choices and attitudes matter.

Apple in the form of a key Gatekeeper dev had very specific intentions for me: I was strongly advised to use automatic code signing in XCode and use Terminal and a separate workflow to remove the incorrect cert that Xcode assigns, and put in the correct one (Developer ID Application, in this case).

Apple's defaults for an XCode application (written in Swift, because of course it is) and automatic signing, work perfectly first time for something like their example 'hello world' app. For any Audio Unit, this fails every time. You can set it correctly inside XCode from the start, using manual settings. I chose to do this.

Near as I can tell, I am expected to have a manager to whom I will turn over code, and who is the only one with a code signing ID, because as a lowly DSP coder I'm not expected to be allowed to put code out into the wild without supervision. There's a clear expectation that if I mattered, I'd either be the boss of (not necessarily trustworthy) coders, or I'd have a boss whose job it is to be more trustworthy and oversee my code in case I have a wild hair some day and code a bomb into things. I feel there's a resistance at Apple to putting the keys to distribution into the hands of untrustworthy people. Perhaps a belt and suspenders approach? I'm not convinced this is in any way a good thing, though.

Doing the code signing correctly, which is not the same thing as having an Apple-specified process, means every bit of code I generate gets checked for malware by an Apple process. This could save my butt if I got owned by some extremely clever second-level malware that tried to commandeer my XCode and build malware into everything I make. I get that there are also possible risks with having every executable sent to the mothership to be studied: if I competed with them, that's wildly anticompetitive and lets them decompile and pirate anything I do (given sufficient effort). I'm literally sending them all my work before anybody else ever runs it.

I feel that this type of risk (which I'm not convinced is a currently active threat) is better handled by government, regulation, and the law, than by forcing the software ecosystem to normalize running any old code from anywhere.

Doing Apple notarization the way Apple wants it done, should be a nontrivial factor in keeping Apple products from being a giant pile of malware, spyware, and user-manipulation in future. If you're able to do it properly (as in, get the code AUDITED, not 'do it only the way Apple says') the result is distributed plugins and applications that 'just work' the way they used to, but without the same level of risk to the end user.

I think it's worth the trouble to do this. The benefit is clear, and possible dangers of the approach belong to the legal sphere rather than being a technical reason to avoid code signing, or normalize having everybody avoid code signing on your behalf.

Post reply on HN