News for hackers. Stuff that matters.
Re:MacOS Catalina: Slow by Design? by davidvartan on Friday May 22, 2020 @11:53AM (#23273396)
> a degraded user experience, as the first time a user runs a new executable, Apple delays execution while waiting for a reply from their server.

The way to avoid this behavior is to staple the notarization ticket to your bundle (or dmg/pkg), i.e. "/usr/bin/stapler staple <path>." Otherwise, Gatekeeper will fetch the ticket and staple it for the user on the first run.

(I'm the author of xcnotary [1], a tool to make notarization way less painful, including uploading to Apple/polling for completion/stapling/troubleshooting various code signing issues.)

[1] https://github.com/akeru-inc/xcnotary

Re:MacOS Catalina: Slow by Design? by xenadu02 on Friday May 22, 2020 @12:30PM (#23273867)
Xcode (the UI) is able to bypass GateKeeper checks for things it builds.

The "Developer Tool" pane in System Prefs, Security, Privacy is the same power. Drag anything into that list you'd like to grant the same privilege (such as xcodebuild). This is inherited by child processes as well.

The point of this is to avoid malware packing bits of Xcode with itself and silently compiling itself on the target machine, thus bypassing system security policy.

Re:MacOS Catalina: Slow by Design? by indemnity on Friday May 22, 2020 @03:21PM (#23275865)
Reminds me of the AV exception folder our corporate IT created for developers. Soon absolutely everything developers needed or created was installed into that folder. Applications, IDEs, you name it.
Re:MacOS Catalina: Slow by Design? by kunday on Sunday May 24, 2020 @06:18AM (#23290529)
Guilty as accused. I try to keep to an absolute minimum. Like docker data-dir and IDE. With that i can atleast use my machine.

otherwise this macos notarisation, along with a possibly of cpu heating issues with left thunderbolt usage and corporate av scanning, makes my machine, next to useless

Re:MacOS Catalina: Slow by Design? by LeoPanthera on Friday May 22, 2020 @02:27PM (#23275307)
Putting Terminal (and your favorite text editor) in this category and in "Full Disk Access" will change your life.
Re:MacOS Catalina: Slow by Design? by MrBuddyCasino on Saturday May 23, 2020 @02:45AM (#23280562)
How does "Full Disk Access" help?
Re:MacOS Catalina: Slow by Design? by lloeki on Saturday May 23, 2020 @05:17AM (#23281431)
You can browse Time Machine backup directory trees from the CLI again.
Re:MacOS Catalina: Slow by Design? by sneak on Friday May 22, 2020 @04:06PM (#23276327)
Yes, falling victim to ransomware is definitely lifechanging if you don’t have good backups.
Re:MacOS Catalina: Slow by Design? by LeoPanthera on Friday May 22, 2020 @05:11PM (#23277089)
That is a non-sequitur.
Re:MacOS Catalina: Slow by Design? by mperham on Friday May 22, 2020 @06:19PM (#23277717)
It's not; they are stating that if you bypass these security checks, you open the machine up to ransomware.
Re:MacOS Catalina: Slow by Design? by justinmeiners on Saturday May 23, 2020 @01:04AM (#23280063)
better not turn on it at all, to be extra safe
Re:MacOS Catalina: Slow by Design? by grishka on Friday May 22, 2020 @02:32PM (#23275358)
So since these permissions apply to process trees, what happens if you put launchd in there?
Re:MacOS Catalina: Slow by Design? by aasasd on Friday May 22, 2020 @04:28PM (#23276564)
The computer will probably hang while it tries to solve the chicken-egg problem.

Isn't launchd Mac's ‘init’? I.e. run before anything else.

Re:MacOS Catalina: Slow by Design? by grishka on Friday May 22, 2020 @05:16PM (#23277155)
Yes, and that's the point — everything you run will theoretically inherit the permission from it.
Re:MacOS Catalina: Slow by Design? by acecilia on Saturday May 23, 2020 @10:33AM (#23283242)
Can you advise on how to make the "Developer Tool" panel in "System Prefs, Security, Privacy" appear if it is not present? Cant find a way: https://stackoverflow.com/questions/60176405/macos-catalina-...
Re:MacOS Catalina: Slow by Design? by saagarjha on Sunday May 24, 2020 @04:05AM (#23289992)
Re:MacOS Catalina: Slow by Design? by acecilia on Sunday May 24, 2020 @06:46AM (#23290651)
Thanks for the link. Tried it, but that did not work
Re:MacOS Catalina: Slow by Design? by wila on Friday May 22, 2020 @07:07PM (#23278110)
GateKeeper only triggers the check for things downloaded from the internet. IOW, it checks if your binary has a quarantine flag attached via an extended attribute.
Re:MacOS Catalina: Slow by Design? by xenadu02 on Friday May 22, 2020 @08:16PM (#23278576)
That is not correct starting with Catalina.
Re:MacOS Catalina: Slow by Design? by make3 on Saturday May 23, 2020 @01:56PM (#23284958)
How do I get a "Developer Tool" pane in System Prefs? Do I have to install X-Code? I would really rather not
Re:MacOS Catalina: Slow by Design? by saagarjha on Sunday May 24, 2020 @04:05AM (#23289991)
Re:MacOS Catalina: Slow by Design? by closeparen on Friday May 22, 2020 @01:49PM (#23274912)
This is life-changing. Thank you!
Re:MacOS Catalina: Slow by Design? by pindab0ter on Friday May 22, 2020 @05:58PM (#23277547)
What did you notice?
Re:MacOS Catalina: Slow by Design? by scottlamb on Friday May 22, 2020 @12:36PM (#23273940)
> The way to avoid this behavior is to staple the notarization ticket to your bundle (or dmg/pkg)

Maybe in some cases, but the article says "even if you write a one line shell script and run it in a terminal, you will get a delay!"

Shell scripts don't come in bundles. I don't think this kind of stapling is possible for them? I don't think it'd be reasonable to expect users to do this anyway.

Re:MacOS Catalina: Slow by Design? by davidvartan on Friday May 22, 2020 @12:44PM (#23274045)
The Gatekeeper behavior is specific to running things from Finder (not Terminal), and only if you downloaded it via a browser that sets the com.apple.quarantine xattr.

Two posts from Apple dev support (Cmd+F "eskimo") describe this in more detail.

https://forums.developer.apple.com/thread/127709

https://forums.developer.apple.com/thread/127694

Re:MacOS Catalina: Slow by Design? by nemosaltat on Friday May 22, 2020 @12:51PM (#23274142)
I recently learned that `xattr -cr path/to/my.app` solves the “this App is damaged would you like to move it to the trash” you get when you copy an app from one Mac to another.
Re:MacOS Catalina: Slow by Design? by rhizome on Friday May 22, 2020 @01:06PM (#23274362)
That might be the Windows-iest feature of OSX I've ever heard of.
Re:MacOS Catalina: Slow by Design? by cosmojg on Friday May 22, 2020 @01:47PM (#23274887)
It seems macOS is going downhill fast these days.
Re:MacOS Catalina: Slow by Design? by withinboredom on Friday May 22, 2020 @02:38PM (#23275418)
No, it’s just that they’re becoming more popular. When you become a popular desktop OS, governments and militaries want to start using it which comes with some strange requirements. It also means that you can’t rely on “obscurity” to provide any sort of security, where before you could overlook some things.
Re:MacOS Catalina: Slow by Design? by catalogia on Friday May 22, 2020 @03:07PM (#23275723)
Can you cite any sources for your claim that these things are being implemented to satisfy government/military requirements?
Re:MacOS Catalina: Slow by Design? by o-__-o on Friday May 22, 2020 @03:56PM (#23276209)
DISA?

I don’t know why grand op is downvoted. DoD requirements literally require a timeout setting for screensavers to begin locking. This has caught systems which have a race condition where you can move your mouse quickly and gain desktop access before it locks.

The long term effects come from the required changes to the development security model to remain productive and profitable (took MSFT a few OOB hotfixes and service packs to fix that example above, look when gnome kde xscreensaver etc introduced that feature etc)

Re:MacOS Catalina: Slow by Design? by saagarjha on Friday May 22, 2020 @07:05PM (#23278090)
> This has caught systems which have a race condition where you can move your mouse quickly and gain desktop access before it locks.

I fail to see how this is a race condition rather than how a screensaver is supposed to work?

Re:MacOS Catalina: Slow by Design? by o-__-o on Friday May 22, 2020 @08:19PM (#23278603)
Because it’s not, that’s why I pointed to xscreensaver feature implementation. Lock time is separate from screensaver activation time which is separate from energy saving activation time.

What defines when a locking screen saver is “locked”? 10m? Or 10m1s? You are making assumptions and that is what DISA spells out. Which forces the OS design to change in subtle ways. Like xattrs on files as great grand op was alluding to.

Does that provide clarity into how development security models evolve over the lifetime of an application?

Re:MacOS Catalina: Slow by Design? by noisem4ker on Friday May 22, 2020 @01:59PM (#23275013)
What would that mean?
Re:MacOS Catalina: Slow by Design? by bobbylarrybobby on Friday May 22, 2020 @02:25PM (#23275283)
It would appear to mean it's a hacky, over-technical solution to a problem that shouldn't exist in the first place, as copying things from one computer to another should just work™. This is one place where macOS used to shine and seems to be increasingly falling behind in.
Re:MacOS Catalina: Slow by Design? by JadeNB on Friday May 22, 2020 @01:09PM (#23274402)
> The Gatekeeper behavior is specific to running things from Finder (not Terminal), and only if you downloaded it via a browser that sets the com.apple.quarantine xattr.

The article says the described problem isn't limited in this way:

> This is not just for files downloaded from the internet, nor is it only when you launch them via Finder, this is everything. So even if you write a one line shell script and run it in a terminal, you will get a delay!

Re:MacOS Catalina: Slow by Design? by staticfloat on Friday May 22, 2020 @03:21PM (#23275861)
If you read the comments of the article and do your own testing, you will find that reality appears to be more complicated than the article suggests. Users have shown using both timing and wireshark that the shell scripts do not appear to be triggering notarization checks.
Re:MacOS Catalina: Slow by Design? by reuben_scratton on Friday May 22, 2020 @02:41PM (#23275448)
Quinn The Eskimo at Apple's forums is a 10x support engineer, his posts have helped me fix dozens of problems.
Re:MacOS Catalina: Slow by Design? by Someone on Friday May 22, 2020 @03:53PM (#23276175)
Unless somebody took over his name he’s been at Apple for almost 25 years, and was already being interviewed as such 20 years ago (http://preserve.mactech.com/articles/mactech/Vol.16/16.06/Ju...)

His site (http://www.quinn.echidna.id.au/Quinn/WWW/) supports its claim “I'm not a great believer in web” :-)

Re:MacOS Catalina: Slow by Design? by saagarjha on Friday May 22, 2020 @07:07PM (#23278111)
It's interesting to see a time when Apple seemed to allow employees to have side projects…
Re:MacOS Catalina: Slow by Design? by saagarjha on Friday May 22, 2020 @02:54PM (#23275574)
He needs to be, because Apple Developer Technical Support is chronically understaffed.
Re:MacOS Catalina: Slow by Design? by xenadu02 on Friday May 22, 2020 @08:17PM (#23278587)
This is the way things worked prior to Catalina but is no longer the case.
Re:MacOS Catalina: Slow by Design? by oefrha on Friday May 22, 2020 @12:04PM (#23273530)
I mean, when I’m developing in a compiled language with the workflow edit code -> compile -> run (with forced stapling), changing it to edit code -> compile -> staple -> run doesn’t make it any less slow...
Re:MacOS Catalina: Slow by Design? by oefrha on Friday May 22, 2020 @01:49PM (#23274903)
An update: flat out denying network access to syspolicyd using Little Snitch could cut down on the delay. (Yes, syspolicyd does send a network request to apple-cloudkit.com for every single new executable. Denying its access to apple-cloudkit.com only isn't sufficient either since it falls back to IP address directly.) Note that this might not be a great idea, and it still has nonzero cost — a network request has to be made and denied by Little Snitch.

Here's my benchmarking script:

  #!/bin/zsh
  tmpfile=$(mktemp)
  cat >$tmpfile <<EOF
  #!/bin/sh
  echo $RANDOM  # Use a different script each time in case it makes a difference.
  EOF
  chmod +x $tmpfile
  setopt xtrace
  time ( $tmpfile )
  time ( $tmpfile )
  unsetopt xtrace
  rm -f $tmpfile
If your local terminal emulator is immune with "Developer Tools" access (interestingly, toggling it off doesn't bring back the delay for some reason), you should be able to reproduce the delay over ssh.
Re:MacOS Catalina: Slow by Design? by davidvartan on Friday May 22, 2020 @02:05PM (#23275076)
I can repro this locally as well. Interesting if it's inconsistent with Apple docs and when Gatekeeper should be firing, as running stuff locally without distributing/downloading is somewhat out of scope for notarization.

Reached out about this to Apple dev support, hope to get more insight.

Re:MacOS Catalina: Slow by Design? by abathur on Sunday May 24, 2020 @10:29AM (#23291756)
> interestingly, toggling it off doesn't bring back the delay for some reason

Noticed the same; it should come back if you disable it and reboot.

Re:MacOS Catalina: Slow by Design? by davidvartan on Friday May 22, 2020 @12:07PM (#23273583)
Notarization/stapling/etc. is for distribution only, not generally part of your dev workflow.
Re:MacOS Catalina: Slow by Design? by oefrha on Friday May 22, 2020 @12:10PM (#23273609)
But TFA and my personal experience do point to a noticeable delay after each recompile in dev workflows, and TFA claims this is due to notarization checks... So I guess I’m confused and you’re talking about something else?
Re:MacOS Catalina: Slow by Design? by rgrs on Friday May 22, 2020 @12:27PM (#23273823)
How does mac identify a dev workflow and normal workflow?
Re:MacOS Catalina: Slow by Design? by jmercouris on Friday May 22, 2020 @12:32PM (#23273888)
When you use XCode you have different compilation options.
Re:MacOS Catalina: Slow by Design? by ihiulll on Friday May 22, 2020 @03:13PM (#23275792)
I'm confused. does macbook send executable to apple servers or just the hash?
Re:MacOS Catalina: Slow by Design? by saagarjha on Friday May 22, 2020 @07:07PM (#23278114)
Just the hash.
Re:MacOS Catalina: Slow by Design? by dahfizz on Friday May 22, 2020 @10:39PM (#23279360)
The way to avoid this behavior is to not buy a machine from a company that actively hates it's users.