I am trying to write non-system extension EndpointSecurity client. As recommended by “eskimo”, I have made an app in xcode, gutting it so that main runs the ES client.
However I do not know how to add EndpointSecurity entitlement. In December we have received a mail from Apple notifying us that we can now use this entitlement. In the attached email, there was a description how to add the entitlement to provisioning profile: “When you create a Development or Distribution provisioning profile for your Bundle ID, you'll be prompted to select additional entitlements. Click Profiles on the sidebar, then click the Add button in the upper-left corner. Choose a provisioning profile type and follow the prompts until you see ‘Additional Entitlements.’ Select the Endpoint entitlement from the dropdown to include the Endpoint Security entitlements in your new profile. Click Continue to finish the process.” This seems out of date; there does not seem to be a way how to add entitlements when generating provisioning profile. I can see System Extension and Network Extension entitlements when setting up app id, however even there the EndpointSecurity entitlement is not present.
Surprisingly, I am able to sign the app with a provisioning profile that does not contain ES client entitlement (I have thought it would fail, as the profile is supposed to be a whitelist of entitlements), and the app itself seems to have the entitlement:
$ codesign -d --entitlements :- com.whatever.test.app/
contains key com.apple.developer.endpoint-security.client set as true
however trying to run this unsurprisingly fails (i guess now the profile is applied?):
taskgated-helper: com.whatever.test: Unsatisfied entitlements: com.apple.developer.endpoint-security.client
taskgated-helper: Disallowing: com.whatever.test
amfid: /path/to/com.whatever.test.app/Contents/MacOS/com.whatever.test signature not valid: -67671
kernel: proc 73552: load code signature error 4 for file "com.whatever.test"
Please anyone knows what should be done to add the Endpoint Security client entitlement to an app?