To check the codesigning flags of a process after receiving an endpoint security event, the header cs_blobs.h is needed (see https://developer.apple.com/documentation/endpointsecurity/es_process_t/3334987-codesigning_flags).
Unfortunately, the header is not found even if Kernel.framework is added to the target. Using a hack, however works.
The way it is supposed to work, i.e. it should build but does not:
- Add Kernel.framework to the project.
- Use the directive "#include <kern/cs_blobs.h>“
The way it works, i.e. it builds and works although it should not:
- Do NOT Add Kernel.framework to the project.
- Use the directive "#include <Kernel/kern/cs_blobs.h>“
Does anyone have an idea as to why the hack works?
P.S.: I created a feedback item for this issue (FB12016572).