# Enable Audit Logging on a Remote Mac Host

Canonical: https://figment.so/blog/mac-remote-desktop-audit-logging

Export login and authorization events from a Mac with log show and log collect, then let the SIEM agent you already run ship the archive. The Unified Log is context, not a full audit trail, so check it against what your control needs.

**To record who signed in to a remote Mac, export security events from the macOS Unified Log with `log show` or `log collect`, and let the SIEM agent you already run move the archive off the host.** The Unified Log is high-value context but not a complete audit trail. For every process execution or file write you need an Endpoint Security client, which this guide covers in the coverage table below.

On current macOS the record lives in two places with different trust properties: the Unified Log (see Apple's [Logging overview](https://developer.apple.com/documentation/os/logging)) and, for supported process, file and signal events, an entitled [Endpoint Security](https://developer.apple.com/documentation/endpointsecurity) client or a compatible endpoint security product. If a reviewer asks who signed in last Tuesday, the answer has to have been written before the question.

## How do I export security events from the Unified Log?

Run `log show` for a one-off export, or `log collect` for a bundle you can hand to an investigator. The Unified Log is a structured stream of messages that Apple components and third-party code emit through `os_log`. Authorization and policy events appear because the relevant daemons log them, not because the kernel traces every syscall.

Start by checking the version and the subsystems emitting on your host:

```bash
sw_vers -productVersion
sudo log stats
```

For a one-off export of the last day of authentication, authorization and screen-sharing activity, write to a user-owned private directory with a restrictive umask:

```bash
umask 077
mkdir -p "$HOME/audit"
chmod 700 "$HOME/audit"
EXPORT_DIR="$(mktemp -d "$HOME/audit/export.XXXXXX")"

sudo log show \
  --last 24h \
  --info \
  --style ndjson \
  --predicate 'subsystem == "com.apple.securityd" OR subsystem == "com.apple.authorization" OR subsystem == "com.apple.screensharing" OR subsystem == "com.apple.loginwindow"' \
  > "$EXPORT_DIR/mac-security.ndjson"
```

The reader uses `sudo`; the shell writes the file as your own user into the new private directory. The predicate selects example subsystems, not a complete security-event inventory, so confirm which subsystems and processes emit the event you need on your exact macOS version. `--info` includes informational messages that may still be retained. Missing or redacted events cannot be reconstructed by this export. A rolling 24-hour export produces overlap, so use fixed time windows or deduplicate when scheduling.

For a bounded archive, use `log collect`. It writes a `.logarchive` bundle that Console and `log show --archive` can open on another Mac:

```bash
sudo log collect \
  --last 24h \
  --output "$HOME/audit/mac-$(date -u +%Y%m%dT%H%M%SZ).logarchive"
```

The archive preserves the collected log structure. It is not proof of complete coverage or a cryptographically signed chain of custody, so record its collection window and transfer checksum and retain the original bundle. Private-tagged fields in Apple log messages stay redacted unless the host has an Apple Configuration Profile that enables private-data logging. Assume the default, and do not promise your SIEM will see hostnames, URLs or usernames that Apple marked `<private>`. Flags and subcommands change between macOS versions, so check `man log` on the exact release before you script a job around them.

## What does the Unified Log miss?

It misses process executions with arguments, file writes and network connections. Map your compliance control to what this pipeline captures before you ship anything.

| Event you need | Unified Log coverage | What actually records it |
|---|---|---|
| Interactive and remote-desktop login success/failure | Partial: `com.apple.loginwindow`, `com.apple.securityd`, lines from `authd` | Pair with `last`, `/var/log/wtmp` where present, or an SSO/agent that logs server-side |
| `sudo` and policy authorization | Partial: verify the observed authorization events on this OS | Same, plus `sudo` lines when a sudoers-logging policy is in place |
| Every process exec with argv | No, only what a daemon chose to log | Endpoint Security (`ES_EVENT_TYPE_NOTIFY_EXEC`) in a signed system extension |
| Every file write to a path | No | Endpoint Security file events, or an EDR agent that uses the same framework |
| Outbound network connection with 5-tuple | No | A compatible [Network Extension content filter](https://developer.apple.com/documentation/networkextension/content-filter-providers) or network monitoring product with the required event fields |
| Screen-sharing session start/stop | Partial: verify the actual session events | Same |

Apple's Endpoint Security framework provides supported process and file events to an entitled client. It requires the `com.apple.developer.endpoint-security.client` entitlement and applicable macOS permissions, and a production system extension has signing, notarization and installation requirements. It does not supply a universal record of network connections. Choose an existing compatible product or scope a separate implementation, and test event coverage, dropped-event handling and delivery before you rely on it for a control.

The classic BSM `auditd` subsystem is still referenced by the macOS `audit(4)` man page and can be started on older releases. Command flags, launchd labels and defaults have varied between macOS versions, and FreeBSD setup instructions are not safe to paste into a macOS host unchecked. If you need BSM for a legacy control, verify `man audit`, `man auditd` and `man audit_control` on the macOS version you are renting, test the start and rotate commands against a throwaway trail, and keep that work separate from the Unified Log pipeline.

## How do I hand the archive to my SIEM agent?

Let your existing agent move the files, set retention first, and schedule the job where the host can run it. Three rules keep this useful without inventing infrastructure:

1. **Let your existing agent move the bytes.** Use a supported macOS log-forwarding agent that can read the exported format. Confirm its collector configuration, authenticated TLS, retry behavior and delivery receipts. An endpoint security product does not necessarily ingest arbitrary local files or `.logarchive` bundles. A one-line `logger` or `curl` call does none of that, and plaintext syslog over the public internet is not acceptable for authorization events.
2. **Set retention before you collect.** Choose a retention period and disk cap with the reviewer. Delete an expired export only after its receipt and retention hold are checked. Treat a `.logarchive` as one bundle, because deleting its individual files can damage it. Moving files out of the audit directory to avoid resending silently defeats retention; let the agent track its own offset instead.
3. **Schedule it where the host can see it.** A scheduled job cannot answer an interactive sudo prompt. Use your existing management agent or an administrator-configured service with the needed privileges, and protect scripts and configuration from untrusted edits. A user LaunchAgent runs only in its user session. Keep non-secret configuration in version control and test missed runs, failures and disk limits.

## What should I decide before I turn this on?

Fill this in and keep it with the plist:

1. macOS version on the host (from `sw_vers -productVersion`): __________
2. Receiver: SIEM agent name and destination index or stream: __________
3. On-host retention (days) and total cap (GB): __________
4. SIEM retention (days): __________
5. Subsystems in the predicate: __________
6. Controls covered by the Unified Log alone: __________
7. Controls that require Endpoint Security or another agent: __________

If line 7 is not empty, schedule the extra work before you tell the control owner this host is covered. If line 3's cap times your event rate undercuts line 4, raise the on-host cap or shrink the predicate rather than letting the oldest events fall off.

## Does Unified Log collection need more than the Intel Mac VM?

Every Figment plan gives you SSH and administrator access to your own Mac or VM, which is what `sudo log collect` and a scheduled job need. The [Intel Mac VM](/mac-hosting#intel-vm) ($2 a day, $25 a month, macOS Sequoia) is enough for the Unified Log workflow, but it cannot run arm64-only agents. Choose the [Apple Silicon Mac VM](/mac-hosting#apple-silicon-vm) ($6 a day, $39 a month) or the [Dedicated M4 Pro 48 GB](/mac-hosting#dedicated-m4-pro) ($349 a month, or $299 a month on a 12-month term) if your SIEM shipper or an Endpoint Security extension requires arm64. Check the macOS version shown before purchase against your agent's support list.

Figment has not published a built-in audit log or session recording for remote desktop sessions. Collect events from inside your own Mac as above.

**Related guides**

- [Mac Remote Desktop Access Control](/blog/mac-remote-desktop-access-control)
- [Mac Remote Desktop Latency Test](/blog/mac-remote-desktop-latency-test)
- [Mac GitHub Actions Self-Hosted Runner](/blog/mac-github-actions-self-hosted-runner)
