Here's what I understand of the log messages that I pasted in my previous reply. Remember that the process id of interest is 58700
. In the log above, you will notice that the only place where this proces id 58700
is present is the line:
cfprefsd [0x74c933e80] activating connection: mach=false listener=false peer=true name=com.apple.cfprefsd.daemon.peer[58700].0x74c933e80
That line isn't too interesting and I don't know if it's relevant in this discussion, so I'll skip that one. The good thing however is that these logs appear to have captured enough details about the "Local Network" restriction's implementation. Several of those above log messages have something interesting, and I think it can be summarized by these few:
| UserEventAgent Got local network blocked notification: pid: 7384, uuid: 4E7709E7-AD5C-38B8-9ED0-0354767877BD, bundle_id: (null) |
| UserEventAgent LocalNetwork: found bundle id marco-foobar by PID |
| UserEventAgent LocalNetwork: did not find bundle ID for UUID 4E7709E7-AD5C-38B8-9ED0-0354767877BD |
| UserEventAgent Found bundle ID: marco-foobar |
| nehelper application record search init. Node: (null) bundleID: <private> itemID: 0 |
| ... |
| 708 info 2025-03-13 09:53:42.446497 +0000 runningboardd _executablePath = /opt/marco-foobar/start-marco-foobar.bash |
| 708 info 2025-03-13 09:53:42.446500 +0000 runningboardd no additional launch properties found for <private> |
| 708 default 2025-03-13 09:53:42.446543 +0000 runningboardd _resolveProcessWithIdentifier pid 7384 euid 0 auid 0 |
| 708 default 2025-03-13 09:53:42.446584 +0000 runningboardd Resolved pid 7384 to [osservice<polo-foobar>:7384] |
| ... |
| runningboardd [osservice<polo-foobar>:7384] is not RunningBoard jetsam managed. |
| runningboardd [osservice<polo-foobar>:7384] This process will not be managed. |
| runningboardd PERF: Received request from [osservice<com.apple.nehelper>:726] (euid 0, auid 0) (persona (null)): lookupProcessName:error: |
| nehelper No team ID found for (bundleID: marco-foobar, name: marco-foobar) |
| |
So when the java program (in process 58700) intitated the sendto()
local network operation, it appears to have triggered a "local network blocked notification". I'm not sure if that log line from UserEventAgent means that the notification pop-up (asking the user to allow/disallow the operation) was generated or whether it is determining if the pop-up needs to be generated. In any case, that log message indicates that the pid is 7384. Looking at the additional data I collected from that system and the documentation of "Local Networking" which states:
When a process performs a local network operation, macOS tries to track down the responsible code. For example, if your app spawns a helper tool and the helper tool performs a local network operation, macOS considers the app to be the responsible code.
So what that log tells me is that the local network restriction has identified 7384 process as the top level root application for the 58700 java process which is doing the networking operation. So I went back and looked into the process and launch hierarchy on this setup.
7384 is a process launched through launchd
with the /opt/marco-foobar/start-marco-foobar.bash
bash script file as the executable. When I say launchd
, I may not be using the right term here. I think the /opt/marco-foobar/start-marco-foobar.bash
bash script gets launched whenever that macos system starts (I will confirm that today). The plist
file which configures this bash script as the entry point looks something like:
| <plist version="1.0"> |
| <dict> |
| <key>Label</key> |
| <string>polo-foobar</string> |
| <key>ProgramArguments</key> |
| <array> |
| <string>/opt/marco-foobar/start-marco-foobar.bash</string> |
| ... |
and launchtl list
on that system shows:
| PID Status Label |
| ... |
| 7384 0 polo-foobar |
| ... |
| |
The /opt/marco-foobar/start-marco-foobar.bash
ultimately ends up doing a:
| ... |
| exec /opt/polo/bin/polo-foobar |
polo-foobar
is a 3rd party binary and doesn't have any plist file of its own:
| launchctl plist /opt/polo/bin/polo-foobar |
| 64-bit Mach-O does not have a __TEXT,__info_plist or is invalid. |
polo-foobar
is a generic (3rd party) framework which allows application specific code to be executed. In this case, it ends up launching a java
process which then further launches (through Java's ProcessBuilder API https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/lang/ProcessBuilder.html#start()) the ultimate 58700 java
process.
So given all this, it seems to me that the entry point process /opt/marco-foobar/start-marco-foobar.bash
(which "exec"ed the polo-foobar binary) is being denied access to the network operation. Did I understand it right? If so, how do I go about addressing this issue. The local networking document states:
If you ship a launchd agent that’s not installed using SMAppService, make macOS aware of the responsible code by setting the AssociatedBundleIdentifiers property in your launchd property list.
Does that mean I need to add the AssociatedBundleIdentifiers
property to the plist
snippet that I shared previously? What value (values?) would I add to it?
Furthermore, these processes are running on a system which acts like a "server" and there's no user interaction involved. So what are the options of making this "allow this process (sequence) access to networking operations" non-interactive and configurable/automatable?
While at it, I would like to note that the output of ps -Meo pid,pcpu,cputime,start,pmem,vsz,rss,state,wchan,user,args
for this top level 7384 process which seems to have been denied the network operation access shows that it is running as root
:
| USER PID TT %CPU STAT PRI STIME UTIME COMMAND PID %CPU TIME STARTED %MEM VSZ RSS STAT WCHAN USER ARGS |
| root 7384 ?? 0.0 S 20T 0:00.03 0:00.55 /opt/ma 7384 0.0 73:40.19 1Mar25 0.4 412145952 58976 S - root /opt/polo/bin/polo-foobar |
So this local network access denial for this process seems to go against what the local networking documentation states:
macOS considerations
macOS maintains separate local network privacy state for each user account.
macOS automatically allows local network access by:
Any daemon started by launchd
Any program running as root
...
Overall this feels way too complicated to manage and if I understand it correctly, none of these issues has to do with java
itself and I can imagine the exact same launch sequence leading to a go
(or even python
) application which uses that language's standard networking APIs to run into this same thing. Have I misunderstood this?
While at it, I would also like to understand if those above log messages show any other issues that might need to be addressed.