Sample Endpoint Security App will not run

I have gone through the sample code a dozen times. This time, I've followed all previous advice, I'm using an Apple Developer ID, etc. Still, I'm getting errors trying to run the sample.

2022-08-02 14:43:57.703315-0700 0xf6e9bc  Error    0x0         55202 0  taskgated-helper: (ConfigurationProfiles) [com.apple.ManagedClient:ProvisioningProfiles] com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension: Unsatisfied entitlements: com.apple.developer.endpoint-security.client 2022-08-02 14:43:57.703354-0700 0xf6e9bc  Error    0x0         55202 0  taskgated-helper: (ConfigurationProfiles) [com.apple.ManagedClient:ProvisioningProfiles] Disallowing: com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension 2022-08-02 14:43:57.703925-0700 0xf6ee5b  Default   0x0         213  0  amfid: /Library/SystemExtensions/20882B24-F907-4515-9C3D-ADC6E61F486F/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension.systemextension/Contents/MacOS/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension signature not valid: -67671 2022-08-02 14:43:57.704076-0700 0xf6ef8d  Default   0x0         0   0  kernel: mac_vnode_check_signature: /Library/SystemExtensions/20882B24-F907-4515-9C3D-ADC6E61F486F/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension.systemextension/Contents/MacOS/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension: code signature validation failed fatally: When validating /Library/SystemExtensions/20882B24-F907-4515-9C3D-ADC6E61F486F/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension.systemextension/Contents/MacOS/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension: 2022-08-02 14:43:57.704105-0700 0xf6ef8d  Default   0x0         0   0  kernel: proc 54551: load code signature error 4 for file "com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension" 2022-08-02 14:43:57.704926-0700 0xf6ef8e  Default   0x0         0   0  kernel: com.example.apple-samplecode.Sam[54551] Corpse allowed 1 of 5 2022-08-02 14:43:57.738424-0700 0xf6edc0  Default   0x0         87   0  systemstats: Doing SMC sample (queued) 2022-08-02 14:44:00.185997-0700 0xf6edcf  Default   0x0         921  0  ReportCrash: Formulating fatal 309 report for corpse[54551] com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extensi 2022-08-02 14:44:00.187059-0700 0xf6edcf  Default   0x0         921  0  ReportCrash: Unable to find store record for 'file:///Library/SystemExtensions/20882B24-F907-4515-9C3D-ADC6E61F486F/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension.systemextension/': Error Domain=NSOSStatusErrorDomain Code=-10811 "kLSNotAnApplicationErr: Item needs to be an application, but is not" UserInfo={_LSLine=175, _LSFunction=_LSFindBundleWithInfo_NoIOFiltered} 2022-08-02 14:44:00.197169-0700 0xf6edcf  Default   0x0         921  0  ReportCrash: com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension is not a MetricKit client 2022-08-02 14:44:00.197939-0700 0xf6edcf  Default   0x0         921  0  ReportCrash: (CoreAnalytics) [com.apple.CoreAnalytics.stability-event:event-send] Sending event: com.apple.stability.crash {"bundleID":"com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension","bundleVersion":"1","exceptionCodes":"0x0000000000000000, 0x0000000000000000(\n  0,\n  0\n)EXC_CRASHSIGKILL (Code Signature Invalid)","incidentID":"D4F821FA-40AC-4897-8C20-84895D264CDD","logwritten":0,"process":"com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extensi","terminationReasonExceptionCode":"0x1","terminationReasonNamespace":"CODESIGNING"} 2022-08-02 14:44:00.199307-0700 0xf6ec8f  Default   0x0         166  0  analyticsd: [com.apple.CoreAnalytics.stability-event:event-recv] Received event: com.apple.stability.crash {"bundleID":"com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension","bundleVersion":"1","exceptionCodes":"0x0000000000000000, 0x0000000000000000(\n  0,\n  0\n)EXC_CRASHSIGKILL (Code Signature Invalid)","incidentID":"D4F821FA-40AC-4897-8C20-84895D264CDD","logwritten":0,"process":"com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extensi","terminationReasonExceptionCode":"0x1","terminationReasonNamespace":"CODESIGNING"}

Please help!

Have you applied for and been granted access to the Endpoint Security entitlement (com.apple.developer.endpoint-security.client)?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Yes. Please refer to this post to see previous communications about this. I decided to start fresh on a new mac.

I have looked at the codesign information:

/Applications % codesign -dv --verbose=4 ./SampleEndpointApp.app 
Executable=/Applications/SampleEndpointApp.app/Contents/MacOS/SampleEndpointApp
Identifier=com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6
Format=app bundle with Mach-O thin (arm64)
CodeDirectory v=20500 size=868 flags=0x10000(runtime) hashes=15+7 location=embedded
VersionPlatform=1
VersionMin=720896
VersionSDK=786688
Hash type=sha256 size=32
CandidateCDHash sha256=7596c38c1169ea807385bc1751506a993d08f615
CandidateCDHashFull sha256=7596c38c1169ea807385bc1751506a993d08f615944fa87b47681c57703b1fc7
Hash choices=sha256
CMSDigest=7596c38c1169ea807385bc1751506a993d08f615944fa87b47681c57703b1fc7
CMSDigestType=2
Executable Segment base=0
Executable Segment limit=16384
Executable Segment flags=0x1
Page size=4096
CDHash=7596c38c1169ea807385bc1751506a993d08f615
Signature size=4796
Authority=Apple Development: Darrell Burns (Z28Q26L68P)
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=Aug 2, 2022 at 2:40:28 PM
Info.plist entries=24
TeamIdentifier=AMLU8UA7F6
Runtime Version=12.1.0
Sealed Resources version=2 rules=13 files=9
Internal requirements count=1 size=220

And for the extension:

 /Applications % codesign -dv --verbose=4 ./com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension.systemextension 
Executable=/Applications/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension.systemextension/Contents/MacOS/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension
Identifier=com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension
Format=bundle with Mach-O thin (arm64)
CodeDirectory v=20500 size=814 flags=0x10000(runtime) hashes=13+7 location=embedded
VersionPlatform=1
VersionMin=720896
VersionSDK=786688
Hash type=sha256 size=32
CandidateCDHash sha256=84a463d75d20dda7d3f6cb06b0e0918c97abcd11
CandidateCDHashFull sha256=84a463d75d20dda7d3f6cb06b0e0918c97abcd11f06e22935170b78ada232113
Hash choices=sha256
CMSDigest=84a463d75d20dda7d3f6cb06b0e0918c97abcd11f06e22935170b78ada232113
CMSDigestType=2
Executable Segment base=0
Executable Segment limit=16384
Executable Segment flags=0x1
Page size=4096
CDHash=84a463d75d20dda7d3f6cb06b0e0918c97abcd11
Signature size=4796
Authority=Apple Development: Darrell Burns (Z28Q26L68P)
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=Aug 2, 2022 at 2:29:15 PM
Info.plist entries=22
TeamIdentifier=AMLU8UA7F6
Runtime Version=12.1.0
Sealed Resources version=2 rules=13 files=1
Internal requirements count=1 size=232

This seems correct to me. I am also allowing xcode to do automatic signing.

I deleted the old copies in /Applications, then copied them in new. Still would not work. Then I rebooted the machine, and it is now working.

This is extremely confusing, why should I need to reboot to get this working?

Sample Endpoint Security App will not run
 
 
Q