Hi, in my ES application I am trying to ignore execution events of apple processes. I think the way to do this is to check for the is_platform_binary attribute of es_message_t but i found that when executing Xcode this attribute is false, is it because I downloaded it from the app store?
Also would checking for the "com.apple" prefix of the signing id be a good way to identify apple signed processes?
is it because I downloaded it from the app store?
Yes. I’m a little hazy on the details but AFAIK is_platform_binary
is only set on code that’s built in to the OS itself.
Also would checking for the
com.apple
prefix of the signing id be a good way to identify apple signed processes?
No. Consider:
% codesign -s - -i com.apple.finder -f test
Oh look, I’m the Finder!
The canonical way to test whether code is signed by Apple is using a code signing requirement:
% codesign -v -v --test-requirement "=anchor apple" test
test: valid on disk
test: satisfies its Designated Requirement
test-requirement: code failed to satisfy specified code requirement(s)
%
% codesign -v -v --test-requirement "=anchor apple" /Applications/Xcode.app
/Applications/Xcode.app: valid on disk
/Applications/Xcode.app: satisfies its Designated Requirement
/Applications/Xcode.app: explicit requirement satisfied
You can do this in code using the SecCode
API.
For a big app like Xcode, this will be slow. You can cache the result using the cdhash
as the key (this is the same key used by our notarisation system).
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"