I'm writing a Kernel Extension Socket Filter for Mac which should be able to block internet access for certain Applications.
If any process starts a new TCP socket, this Socket Filter gets attached and internet access is either granted or blocked based on the process' selfname.
Example: In order to block internet access for Safari, I tell my Kernel Extension to block all TCP Sockets if the process' selfname is 'Safari'.
It works well for the 'Safari' process, but the problem is that Safari gets internet access via XPC Service ("Safari Networking", resp. "com.apple.WebKit").
How can my Kernel Extension know that "com.apple.WebKit" is related and communicates to Safari? Using the parent process does not work because it is "launchd" for all XPC Services.