Validating Your Version of Xcode
developer.apple.com
developer.apple.com
That's unbelievably stupid dev behavior, if true.
That said, I have no idea why anybody would download XCode from a third party...
Easily explainable really. Went to [their favorite search engine], searched for "Xcode download" and clicked the first result which may not be from Apple (or an advertising).
If it were just unsigned apps I wouldn't mind so much, but it's the stupid, "This application came from the internet..." dialog box that drives me nuts most of the time.
Well it would have stopped this actual piece of malware! How often are you installing unsigned applications that a single right click to add to a whitelist is too much effort?
And I'm not infected by this piece of malware, so I still trust myself over Gatekeeper.
> How often are you installing unsigned applications that a single right click to add to a whitelist is too much effort?
Far more often than I install things from the app store. I don't find it to be a useful feature, so I disable it.
That's idiotic.
Downloading Xcode from a third party, now that's stupid.
EDIT: I should mention that I work as an iOS engineer. Gatekeeper has not once impeded my work.
Without those local caches the xcode download can sometimes take days or never finish at all.
Downloading from a 3rd party is fine IMO (after all the internet is just a big game of whisper-down-the-lane), but verifying checksums and signatures is incredibly important.
Baidu isn't a very effective search engine and there are tons of people trying to get their mitts on user data including the government themselves.
Is the "right-click and open" trick that disables Gatekeeper for that app generally unknown? Or do people value not being assed to do it more than (potential) security upsides?
Is it possible that the malware version of Xcode had its signature removed?
Don't open it if the signature is invalid.
Not necessarily - they might have disabled GateKeeper a long time ago and never re-enabled it. I have the same complain with Android's "allow software from third parties" checkbox - it's a little useless because you uncheck it for one specific app you downloaded, but probably leave it unchecked forever more.
$ spctl --assess --verbose /Applications/Sublime\ Text.app
/Applications/Sublime Text.app: accepted
source=Developer ID
Or have you downloaded a special version from a Chinese file sharing website? :)No.
Every unsigned app you download needs to be whitelisted. Right click the app, click open. It will remember your choice and whitelist the app forever more.
Solving the unsigned app problem by silently ignoring clearly invalid signatures is like solving an ant problem by burning down your house.
(but I also don't download Xcode from random places)
I suppose you can argue that, if that's the case, what's the point? Well, if you think that a piece of software should be signed but it is in fact not signed properly, then that's a clue that it's been tampered with. If the software isn't signed at all, then at least I can decide whether I trust the source enough to install it.
This is generally known as hubris. We think we're smart and that the rules don't apply to us, because we know better than the other people. Turns out they can protect us too. Who knew?
In this instance, I'd give the Chinese developers the benefit of the doubt, having recently had first hand experience myself of just how obstructive and irritating the great firewall can be (I was struggling to download small files my entire visit, like a 10MB pdf; I can't imagine trying to download a multi-gigabyte file). So perhaps this was the only way they could get work done–in which case it's on Apple to improve their CDN within China.
More broadly, it seems like though there's a careful line to be walked between locking down a computer (e.g. gatekeeper, system integrity protection) and keeping it 'open', I'm personally much more in favour of the former by default provided that the end user can disable it if necessary. It seems like the only realistic option going forward. Perhaps Xcode should be included under the SIP umbrella too?
:-(
I'm not quite sure why it's up to anyone outside of China, Apple included, to bear the cost of China's firewall dickery.
This is on China to turn off their firewall or bear the costs, commercial and otherwise, of this stupidity. Perhaps Chinese developers shouldn't be allowed to submit apps to the non-Chinese app store?
Developers as a group are at least as stupid about security as everyone else.
I should look at it (on iPad currently), but it seems like the right combination of a custom Certificate Authority added to the keychain and signing your malicious Xcode with a certificate signed by the CA would help. Maybe also change the quarantine metadata on the file?
nope. Gatekeeper only accepts certificates issued by Apple. The trojan would have to patch gatekeeper itself which will be difficult once people upgrade to 10.11 and keep the System Integrity Protection enabled.
Even with all the bad feelings about Apple taking more and more control away from us, there's also a huge upside to this practice, I have to admit.
I guess as long as stuff is turnoffable in emergencies, I can live with the restrictions.
https://developer.apple.com/library/mac/technotes/tn2206/_in...
Gatekeeper seems to really be tied to Apple's CAs.
Of course, if you're willing to download XCode from a shady source, you're also willing to disable Gatekeeper when it prevents you from launching your shady copy, so the point is moot I guess.
edit: Stackoverflow seems to agree: http://stackoverflow.com/questions/11833481/non-apple-issued...
...mind you, I guess that doesn't matter. If I unknowingly had a hacked version and it prompted me for my password at install, I would enter it.
https://stackoverflow.com/questions/26197347/agreeing-to-the...
This seems to even be required to run things like the stock git or gcc, which I've always wondered how that isn't a violation of the GPL.
So, then you have to run sudo make to invoke the global license agreement console interface, then you manually type 'agree', then it runs the original command, except now you're running under sudo. In this case, that means it ran make as root, leaving root-owned artifacts all over my source tree.
The real question is whether the spctl tool displays "Apple" in case of a valid (relative to generic CAs) certificate issued to "Apple". Hopefully that's not the case.
Another risk is a specifically designed executable capable of compromising spctl.
I think that's what SIP is for: https://en.wikipedia.org/wiki/System_Integrity_Protection
http://www.rovio.com/en/news/press-releases/621/rovio-gets-w...
Can you imagine the damage done to Rovio's credibility, simply because their licensee got hit? The news sites only talk about "You should delete Angry Birds 2". Nobody ever mentions or explains this third party.
$ spctl --assess --verbose /Applications/Xcode.app
/Applications/Xcode.app: rejected
source=obsolete resource envelope
I downloaded XCode via the app store, but have disabled gatekeeper (re-enabled it before running this command). /Applications/Xcode.app: accepted
source=Mac App Store
/Applications/Xcode.app: accepted
source=Apple
/Applications/Xcode.app: accepted
source=Apple System
Are the only valid options. You should remove XCode and reinstall it from Apple. $ spctl --assess --verbose /Applications/Xcode.app
/Applications/Xcode.app: accepted
source=Mac App Store /Applications/Xcode.app: accepted
source=Mac App Store
override=security disabled
Which I think means I have Gatekeeper disabled, but it still gave me the 'accepted' response.jzollars$ spctl --assess --verbose /Applications/Xcode.app /Applications/Xcode.app: accepted source=Mac App Store
$ codesign --verify --verbose --deep --test-requirement "=anchor apple" /Applications/Xcode.app/
The "anchor apple" means Apple’s own code, signed by Apple ("anchor apple generic" for developer IDs too).Add verbosity for all the gory details:
$ codesign --verify --verbose=999 --deep --test-requirement "=anchor apple" /Applications/Xcode.app/ file added: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man/whatis
file added: /Applications/Xcode.app/Contents/Developer/usr/share/man/whatis
That should be safe.It's a bit of a shock that Apple:
1) is modifying sealed containers post-install (it's the weekly periodic job that rebuilds whatis database from installed man pages)
2) doesn't realize this and has put out instructions that will cause lots of false positives
But my biggest question of why, Apple manage to get CDN for their Live Streaming Event, App Store, and Mac Apps but not for their developer references and tools.
A honest mistake? Or Sloppiness from their Cloud "Services" again?
Heh.