User Agent on macOS

Install, configure, check, stop, update and troubleshoot the Kabeen user agent on macOS workstations

The agent ships as a signed .pkg installation package, for Apple Silicon and Intel Macs, from macOS 10.13. It is not a system service: it runs in the session of each logged-on user, under that user's identity. The network prerequisites are described in User Agent Overview, and fleet deployment in Deploy User Agent via Jamf or via script.

Install the agent

  1. In Kabeen, in the Agent Tracking menu, click Download Package and choose the PKG format.
  2. Open the .pkg file and follow the installer, with an administrator account.

The package:

  • installs the application in /Applications/Kabeen.app;
  • installs the native messaging hosts for the Chrome, Chromium, Edge and Firefox browsers, under /Library/… (see Browser extension);
  • creates the /Library/LaunchAgents/io.kabeen.launcher.plist launch agent, which keeps the agent running (see Keeping the agent running);
  • starts the agent immediately in the open session, without logging out.

At first launch, the agent shows an icon in the menu bar. It never shows an icon in the Dock.

Locations

ItemPath
Application/Applications/Kabeen.app
Launch agent/Library/LaunchAgents/io.kabeen.launcher.plist
Local configuration~/Library/Application Support/Kabeen/configuration.json
Managed configuration (MDM)/Library/Managed Preferences/<login>/io.kabeen.agent.plist, /Library/Managed Preferences/io.kabeen.agent.plist
Legacy user configuration, not managed~/Library/Preferences/io.kabeen.agent.plist
Logs~/Library/Logs/Kabeen/ (one file per day, kept for 14 days)
Native messaging hosts/Library/Google/Chrome/NativeMessagingHosts/, /Library/Microsoft/Edge/NativeMessagingHosts/, /Library/Application Support/{Chromium,Mozilla}/NativeMessagingHosts/

Configure the agent

On a standalone workstation, click the agent icon in the menu bar, enter your organization's API key, then choose the structure and the team. These settings are saved in the user's local configuration.

On a managed fleet, deploy with your MDM a configuration profile for the io.kabeen.agent preference domain, which provides the following three keys together. The agent then asks the user for nothing.

<key>ApiKey</key>       <string>YOUR_API_KEY</string>
<key>StructureId</key>  <string>YOUR_STRUCTURE_UUID</string>
<key>TeamId</key>       <string>YOUR_TEAM_UUID</string>

The complete profile, the optional keys and the order of the sources are described in User Agent Configuration, and the Jamf procedure in Deploy User Agent via Jamf.

Do not use defaults write io.kabeen.agent …: this file, written to the user's profile, can be modified by the user. Since version 1.6.1 of the agent, it is no longer treated as a configuration managed by your organization.

Browser extension

The PKG installs the native messaging hosts through which the Kabeen extension communicates with the agent, but not the extension itself. Install it from each browser's store (see Manual Browser Extension Installation), or deploy it with your MDM using each browser's managed extensions policy (ready-to-use profiles in Deploy the browser extension for Jamf):

BrowserExtension ID
Chrome (and Chromium, Brave, Vivaldi)hkmgmmaopoofgchofbngplopnhajbojc
Edgejgdflahjneomipldehpneckiplknghbc
Firefoxstorage@kabeen.org

Check that the agent works

launchctl print gui/$(id -u)/io.kabeen.launcher | head -20   # launch agent loaded and PID
pgrep -fl "Kabeen.app/Contents/MacOS/Kabeen"                 # the agent is running
tail -f ~/Library/Logs/Kabeen/*.log                          # agent log

At startup, the log shows that the configuration is complete, then the connection to Kabeen. A connection, certificate or configuration error also appears there. The log level cannot be set on macOS (see Diagnostics).

In Kabeen, the workstation appears in the Agent Tracking menu with recent activity, along with its configuration and metrics.

Keeping the agent running

The io.kabeen.launcher launch agent has launchd supervise the agent with KeepAlive. launchd restarts the agent every time it stops, including after a Force Quit or a kill, within about 10 seconds. It is a launch agent of the user's session, not a system daemon, because the agent must observe the active window.

Update the agent

Install the new signed PKG over the old one, manually or with your MDM (see Update the agent for Jamf). It replaces the launch agent and restarts the agent, without logging out. The configuration profile does not depend on the package: it is kept.

Stop the agent

A workstation administrator can always stop the agent. Because of KeepAlive, you must act on the launch agent: a simple kill is not enough, as launchd restarts the agent within about ten seconds.

uid=$(stat -f %u /dev/console)   # uid of the graphical session user

For the current session (the agent comes back at the next session logon):

sudo launchctl bootout gui/$uid/io.kabeen.launcher

Persistently (survives logout and restart, without deleting the file):

sudo launchctl bootout gui/$uid/io.kabeen.launcher 2>/dev/null || true
sudo launchctl disable gui/$uid/io.kabeen.launcher
# to re-enable it later:
#   sudo launchctl enable gui/$uid/io.kabeen.launcher
#   sudo launchctl bootstrap gui/$uid /Library/LaunchAgents/io.kabeen.launcher.plist   # or log in again

Permanently (removal of the launch agent):

sudo launchctl bootout gui/$uid/io.kabeen.launcher 2>/dev/null || true
sudo rm -f /Library/LaunchAgents/io.kabeen.launcher.plist
sudo pkill -f "Kabeen.app/Contents/MacOS/Kabeen" 2>/dev/null || true

Reinstalling or updating the PKG recreates the launch agent: a removed launch agent comes back at the next deployment.

Uninstall the agent

Stop the launch agent before deleting the application, otherwise it stays in place and tries to restart the agent:

uid=$(stat -f %u /dev/console)
sudo launchctl bootout gui/$uid/io.kabeen.launcher 2>/dev/null || true
osascript -e 'tell application "Kabeen" to quit' 2>/dev/null || true
pkill -f "Kabeen.app/Contents/MacOS" 2>/dev/null || true
sudo rm -rf /Applications/Kabeen.app
sudo rm -f  /Library/LaunchAgents/io.kabeen.launcher.plist
sudo pkgutil --forget io.kabeen.yutu 2>/dev/null || true

Also remove the configuration profile from your MDM. With Jamf, see Uninstall the agent. Removing the browser extension and cleaning up local data are described in Uninstall User Agent.

Troubleshooting

SymptomWhat to do
No icon in the menu barCheck that HideTrayIcon is set neither in the configuration profile nor in the local file. It is read at startup: restart the agent after changing it.
Icon hidden and no way to open the settingsThis is expected with HideTrayIcon (see Hiding the agent icon). Remove the key from the source that sets it, then restart the agent.
The agent comes back after a killThis is the keep-alive (KeepAlive). Use launchctl bootout or disable, or remove the launch agent (see Stop the agent).
The agent ignores its configuration or behaves as if unconfiguredA configuration profile must provide ApiKey, StructureId and TeamId together (see User Agent Configuration).
Window usage missingCheck that the agent has the required permissions (Accessibility, Screen Recording) in System Settings > Privacy & Security.
No data in Kabeen although the agent is runningCheck outbound 443/TCP traffic to intake.kabeen.io, then the workstation clock (a large time offset makes TLS fail), then connection or certificate errors in the log. Also check that your EDR is not blocking the agent (see Allowing the Kabeen agent in your EDR/antivirus).