Given an audit token, can I get the executable path?

I can get the security path "easily" enough, but for bundles, that gives me the top director, whereas I am trying to get the name of the executable. (I would have used kern.proc.pathname.$pid on FreeBSD, but that's not there for macOS, and kern.procname only gives the current process' name. I also found eskimo's post about getting process arguments, and I could use that to get all the arguments and only care about argv[0], but since the kernel does have p->p_name it'd be nice if there were a nicer way to get just that...)

This is in the context of a network extension. Endpoint Security is much nicer in that regard. 😄

(Ok, I found librproc.h but that seems ... questionable, so is there a less questionable way?)

I generally do this using the code signing APIs. Search the forums for kSecGuestAttributeAudit.

Share and Enjoy

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

Given an audit token, can I get the executable path?
 
 
Q