Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

Merge main into the restricted-by-default Linux install branch

Claude27241a092f3d
diff --cc CLAUDE.md
index 100483ce,649031e0..3407e4c4
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@@ -28,8 -28,8 +28,8 @@@ Do not recreate or depend on removed `a
- Beacon is visibility-first endpoint telemetry for local AI agent runtimes, not a hosted policy service or general endpoint protection product.
- Preserve the local-only default. The public Beacon build must not require a hosted account, remote policy fetch, hosted dashboard, or external network dependency during normal hook execution, and hooks themselves never touch the network.
- `beacon login` is the account-identity channel for interactive users and is required by the interactive `beacon endpoint install` wizard. It uses browser PKCE against beacon.sh and stores the scoped CLI token only in `~/.beacon/auth/session.json` (0600 under a 0700 directory). Signing in alone never starts forwarding. User-mode `beacon endpoint connect` may send that token once to `POST /api/cli/enroll/account` to authorize minting a separate device ingest key, and `beacon mcp token create` may send it to `POST /api/cli/mcp/tokens` (scope `mcp:token:create`, listed on the sign-in page) to mint a personal MCP token that is printed once to stdout and never written to a file, and `beacon share` may send it (scope `traces:write`, also on the sign-in page) to `PUT /v1/traces/{external_id}`, `POST /v1/traces/{external_id}/events/batch` and `GET /v1/traces/{external_id}` on the Beacon API host (`https://api.beacon.sh` for a beacon.sh sign-in, other hosts unchanged, `BEACON_API_URL` overrides) to upload a shared trace the person chose to publish, as a `beacon.trace.v1` summary and its events (`cli/beacon/internal/account/share.go`; a `bcn_api_` API key from `--key` or `BEACON_API_KEY` may stand in for it, precedence `--key`, then a current sign-in carrying the scope, then the environment). These are explicit, user-initiated requests with redirects refused. Hooks, plugins and background jobs never make them, with one exception: the git pre-push hook, only when the person opted in with `beacon git setup --share-sessions` (public needs confirmation), may make the three share requests during a push the person started, within the hook's budget and never failing the push. Never copy the account token into endpoint config, Vector, hook environments, logs, or command output. System/root/package/MDM/CI/piped-stdin/dry-run installs stay noninteractive and account-free.
- - System log access (`beacon endpoint install|repair --system --log-access shared|restricted`; docs in `docs/cli/endpoint-install.mdx#restricted-log-access`). Shared, the CLI default, is the system log as it always was: hooks append to `/var/log/beacon-agent/runtime.jsonl` directly, so it is `0666`. Restricted is opt-in for the CLI and the macOS/Windows packages, and the default for a first Linux `.deb`/`.rpm` install (`packaging/linux/install-endpoint.sh` passes `--log-access restricted` only when neither the system `config.json` nor the runtime log exists, `/proc/1/comm` is systemd and `BEACON_SERVICE` is unset, `auto` or `systemd`; otherwise it passes nothing and the endpoint keeps its mode; `packaging/linux/beacon-settings.sh`, sourced by that script and by the postinstall so both its steps see the same values, reads the `BEACON_*` install settings, never sourcing the file, from a root-owned, not group/other-writable `/etc/default/beacon` or `/etc/sysconfig/beacon` in shell syntax with trailing comments, skipping a malformed value with a warning naming only the key, environment winning; the postinstall prints the `usermod -aG beacon-log` hint for a restricted log; `packaging/linux/test-endpoint-scripts.sh` checks all of it). Restricted makes the root collector the only writer: its `beacon_ingest` extension (`collector-builder/exporter/beaconjsonexporter/beaconingestextension`, appending through the exporter's own `internal/runtimelog`) serves `/var/run/beacon-agent/ingest.sock`, and the hook adapter and the CLI writer, as any account but root writing the system log, hand finished lines to it through `pkg/asymptoteobserve/localingest` (`Deliverer`). The protocol is one batch per connection (`BEACON-INGEST/1`, a header naming the log, one event per line, one JSON reply saying how far it got); the server refuses a batch for any log but its own, identifies the sender only by kernel peer credentials (`SO_PEERCRED`, `LOCAL_PEERCRED`), overwrites the event's `user` with that uid and its resolved name and always derives `event.id` itself (`StampLine` re-encodes, so a sender cannot split or forge lines or reuse another event's id), and bounds connections overall and per uid, batch size, each account's bytes per second, and its own time per connection (shorter than the client's, so it reports how far it got instead of being resent). The client sends only to a socket that root owns in a directory nobody else can write (group-writable ancestors only for gid 0/1, which macOS's `/private/var/run` needs). `Deliverer.Write` sends through the socket when it answers and otherwise appends directly as before; only a direct append refused for permission (a restricted log whose collector is down) spools the line, to the account's private spool for that log (`~/.beacon/endpoint/spool/<log digest>`, 0600 under 0700), and the next line that gets through either way drains it. Root writers and per-user logs always write directly. The mode is `config.json` `log_access`, carried through repair and package upgrades (`BEACON_LOG_ACCESS` in the install scripts); install creates the `beacon-log` group (`internal/endpoint/loggroup`, getent/groupadd, dscl/dseditgroup) and `writer.RestrictSystemLog` makes the directory `root:beacon-log 02750`, the log and archives `0640` and the lock root-only `0600`, after writing the root-owned `.beacon-log-access` marker beside the log; a shared log is not narrowed in place but copied to fresh root-created files and renamed over, under its lock (bounded wait), because a descriptor opened while it was 0666 survives any chmod. A failed install restores the previous mode in its rollback, and a shared install removes a dead socket. The marker is what tells every root writer (`asymptoteobserve.RuntimeLogModes`) to keep the restricted modes. The OTLP receivers on loopback are not covered: any local process can still send OTLP, unattributed, so never claim more than the hook channel guarantees. Doctor's `runtime_log_access` covers the marker, the socket and pending spool. Unix sockets are local IPC, not a network channel, so the hooks-never-touch-the-network rule holds. On Windows the same mode runs over the named pipe `\\.\pipe\beacon-agent-ingest` (`localingest` `transport_windows.go`, go-winio): the collector creates it as the first instance, and when the name is taken (any account may create one) it reports a recoverable error and retries every few seconds rather than failing, so the rest of the collector stays up; it rejects remote clients and its DACL denies NETWORK and withholds `FILE_CREATE_PIPE_INSTANCE` from ordinary accounts, so it is not a network channel either; a client connects at identification level and sends only to a pipe owned by SYSTEM or Administrators; the server counts a connection against its account from the client process's token before reading and stamps the SID it reads by `ImpersonateNamedPipeClient` after the preamble (they must agree), with `Peer.UID` a string (decimal uid on Unix, SID on Windows) and the name from `LookupAccountSid`, bounded. Privileged writers there are SYSTEM and tokens with Administrators enabled (`CheckTokenMembership`; elevation for another group is not enough). The directory gets `sysacl.RestrictedLogDirDACL` (protected: SYSTEM and Administrators full, `beacon-log` local group read, nothing else; the lock SYSTEM and Administrators only) and everything below it is reset, because every account may bypass traverse checking; `writer.RestrictSystemLog` replaces every file directly in the directory (the log family under the lock; files outside it with another hard link are skipped) with a copy created with its final owner and DACL (`sysacl.CreateRestrictedFile`) and a POSIX-semantics rename, fails naming any file held open without sharing delete and then puts a log that was shared back to shared, and writes the marker last (on Windows it decides nothing for root writers, so a failed or killed run is not mistaken for a finished one). The marker counts there when SYSTEM or Administrators own it and no other account can write it. `loggroup` creates the local group with `net.exe` and looks it up qualified with the computer name. Doctor reads the restricted ACL (`writer.CheckRestrictedSystemLogACL`). `packaging/windows/smoke-restricted-log.ps1` runs in `windows-package-smoke` against the installed MSI with a real ordinary account. Hook and writer tests point `logging.EndpointIngest`/`writer.Ingest` at sockets of their own.
- - Beacon Cloud forwarding (`cli/beacon/internal/endpoint/asymptote`, `beacon endpoint connect`, `beacon endpoint asymptote`) is Vector-shaped: Beacon writes local JSONL, Vector ships runtime lines only from the connection point forward and reads inventory from the beginning to establish the endpoint's current baseline, plus the one bounded exception of the session backfill (below), and the `bcn_device_*` key stays only in `<BaseDir>/asymptote/vector-secrets.json` via Vector's secret backend. The onboarding wizard preselects Beacon Cloud, and confirming it connects this endpoint in the same command once the local install has succeeded; an endpoint that is already enrolled is never re-enrolled, because enrollment rotates the device key. Standard mode ships locally sanitized retained content; metadata-only uses local Vector transforms to remove prompts, responses, reasoning, tool arguments/results, tool descriptions/definitions, retrieval queries/documents, evaluation explanations, agent descriptions, stop sequences, approval/policy reasons, command output, raw fields, diffs, inventory content, and MCP definitions before buffering/upload. Every text-shaped event field must be classified in `metadata_fields_test.go` (`metadataOnlyRemoved`, each with its own `del()` in `pack/metadata-transforms.toml`, or `metadataOnlyKept`); a new field fails that test until it is, and `BEACON_TEST_VECTOR_BIN` runs the transform on an event with every field set. `vector.toml` is not rendered only at connect: `asymptote.ReconcileForwarder` re-renders it in place for a connected endpoint from the current pack with the enrollment's ingest URL and recorded privacy mode, validates it with the forwarder's own Vector exactly as connect does, atomically replaces it, and restarts the forwarder only when the content changed and the forwarder is running (a stopped one reads the new config when it next starts). It never enrolls, reads or rewrites the secrets file, makes a network request, or touches `vector-data/` (checkpoints stay, so pack changes must keep source ids and fingerprinting stable), and a rejected config is a warning that keeps the old one; it is a no-op when not connected, after an incomplete connect, without an installed unit, or where `ForwarderManager` is unsupported (supervised mode). `lifecycle.Install` runs it last when services are started (so install, repair and the Linux package upgrade), repair's teardown keeps the forwarder (`UninstallOptions.KeepManagedIngest`) instead of disconnecting it, and the macOS postinstall, which installs with `--no-start`, runs the hidden `beacon endpoint asymptote reconcile --system`. Keep the ingest URL `https://`, the wire contract aligned with `beacon-ingest` (`/v1/ingest/{runtime,inventory}` and `/v1/ingest/health`), and do not add another endpoint network channel. The cloud-sandbox shuttle is the bounded exception: only with `BEACON_ORIGIN=cloud`, it can upload new runtime lines to GCS, S3, or the same Beacon ingest contract because no Vector/service manager/browser/persistent disk exists there.
-- System log access (`beacon endpoint install|repair --system --log-access shared|restricted`; docs in `docs/cli/endpoint-install.mdx#restricted-log-access`). Shared, the default, is the system log as it always was: hooks append to `/var/log/beacon-agent/runtime.jsonl` directly, so it is `0666`. Restricted is opt-in and makes the root collector the only writer: its `beacon_ingest` extension (`collector-builder/exporter/beaconjsonexporter/beaconingestextension`, appending through the exporter's own `internal/runtimelog`) serves `/var/run/beacon-agent/ingest.sock`, and the hook adapter and the CLI writer, as any account but root writing the system log, hand finished lines to it through `pkg/asymptoteobserve/localingest` (`Deliverer`). The protocol is one batch per connection (`BEACON-INGEST/1`, a header naming the log, one event per line, one JSON reply saying how far it got); the server refuses a batch for any log but its own, identifies the sender only by kernel peer credentials (`SO_PEERCRED`, `LOCAL_PEERCRED`), overwrites the event's `user` with that uid and its resolved name and always derives `event.id` itself (`StampLine` re-encodes, so a sender cannot split or forge lines or reuse another event's id), and bounds connections overall and per uid, batch size, each account's bytes per second, and its own time per connection (shorter than the client's, so it reports how far it got instead of being resent). The client sends only to a socket that root owns in a directory nobody else can write (group-writable ancestors only for gid 0/1, which macOS's `/private/var/run` needs). `Deliverer.Write` sends through the socket when it answers and otherwise appends directly as before; only a direct append refused for permission (a restricted log whose collector is down) spools the line, to the account's private spool for that log (`~/.beacon/endpoint/spool/<log digest>`, 0600 under 0700), and the next line that gets through either way drains it. Root writers and per-user logs always write directly. The mode is `config.json` `log_access`, carried through repair and package upgrades (`BEACON_LOG_ACCESS` in the install scripts); install creates the `beacon-log` group (`internal/endpoint/loggroup`, getent/groupadd, dscl/dseditgroup) and `writer.RestrictSystemLog` makes the directory `root:beacon-log 02750`, the log and archives `0640` and the lock root-only `0600`, after writing the root-owned `.beacon-log-access` marker beside the log; a shared log is not narrowed in place but copied to fresh root-created files and renamed over, under its lock (bounded wait), because a descriptor opened while it was 0666 survives any chmod. A failed install restores the previous mode in its rollback, and a shared install removes a dead socket. The marker is what tells every root writer (`asymptoteobserve.RuntimeLogModes`) to keep the restricted modes. The OTLP receivers on loopback are not covered: any local process can still send OTLP, unattributed, so never claim more than the hook channel guarantees. Doctor's `runtime_log_access` covers the marker, the socket and pending spool. Unix sockets are local IPC, not a network channel, so the hooks-never-touch-the-network rule holds. On Windows the same mode runs over the named pipe `\\.\pipe\beacon-agent-ingest` (`localingest` `transport_windows.go`, go-winio): the collector creates it as the first instance, and when the name is taken (any account may create one) it reports a recoverable error and retries every few seconds rather than failing, so the rest of the collector stays up; it rejects remote clients and its DACL denies NETWORK and withholds `FILE_CREATE_PIPE_INSTANCE` from ordinary accounts, so it is not a network channel either; a client connects at identification level and sends only to a pipe owned by SYSTEM or Administrators; the server counts a connection against its account from the client process's token before reading and stamps the SID it reads by `ImpersonateNamedPipeClient` after the preamble (they must agree), with `Peer.UID` a string (decimal uid on Unix, SID on Windows) and the name from `LookupAccountSid`, bounded. Privileged writers there are SYSTEM and tokens with Administrators enabled (`CheckTokenMembership`; elevation for another group is not enough). The directory gets `sysacl.RestrictedLogDirDACL` (protected: SYSTEM and Administrators full, `beacon-log` local group read, nothing else; the lock SYSTEM and Administrators only) and everything below it is reset, because every account may bypass traverse checking; `writer.RestrictSystemLog` replaces every file directly in the directory (the log family under the lock; files outside it with another hard link are skipped) with a copy created with its final owner and DACL (`sysacl.CreateRestrictedFile`) and a POSIX-semantics rename, fails naming any file held open without sharing delete and then puts a log that was shared back to shared, and writes the marker last (on Windows it decides nothing for root writers, so a failed or killed run is not mistaken for a finished one). The marker counts there when SYSTEM or Administrators own it and no other account can write it. `loggroup` creates the local group with `net.exe` and looks it up qualified with the computer name. Doctor reads the restricted ACL (`writer.CheckRestrictedSystemLogACL`). `packaging/windows/smoke-restricted-log.ps1` runs in `windows-package-smoke` against the installed MSI with a real ordinary account. Hook and writer tests point `logging.EndpointIngest`/`writer.Ingest` at sockets of their own.
++- System log access (`beacon endpoint install|repair --system --log-access shared|restricted`; docs in `docs/cli/endpoint-install.mdx#restricted-log-access`). Shared, the CLI default, is the system log as it always was: hooks append to `/var/log/beacon-agent/runtime.jsonl` directly, so it is `0666`. Restricted is opt-in for the CLI and the macOS/Windows packages, and the default for a first Linux `.deb`/`.rpm` install (`packaging/linux/install-endpoint.sh` passes `--log-access restricted` only when neither the system `config.json` nor the runtime log exists, `/proc/1/comm` is systemd and `BEACON_SERVICE` is unset, `auto` or `systemd`; otherwise it passes nothing and the endpoint keeps its mode; `packaging/linux/beacon-settings.sh`, sourced by that script and by the postinstall so both its steps see the same values, reads the `BEACON_*` install settings, never sourcing the file, from a root-owned, not group/other-writable `/etc/default/beacon` or `/etc/sysconfig/beacon` in shell syntax with trailing comments, skipping a malformed value with a warning naming only the key, the last assignment of a key winning within the file, the environment and `install-endpoint.sh`'s positional arguments winning over it; the postinstall prints the `usermod -aG beacon-log` hint for a restricted log; `packaging/linux/test-endpoint-scripts.sh` checks all of it). Restricted makes the root collector the only writer: its `beacon_ingest` extension (`collector-builder/exporter/beaconjsonexporter/beaconingestextension`, appending through the exporter's own `internal/runtimelog`) serves `/var/run/beacon-agent/ingest.sock`, and the hook adapter and the CLI writer, as any account but root writing the system log, hand finished lines to it through `pkg/asymptoteobserve/localingest` (`Deliverer`). The protocol is one batch per connection (`BEACON-INGEST/1`, a header naming the log, one event per line, one JSON reply saying how far it got); the server refuses a batch for any log but its own, identifies the sender only by kernel peer credentials (`SO_PEERCRED`, `LOCAL_PEERCRED`), overwrites the event's `user` with that uid and its resolved name and always derives `event.id` itself (`StampLine` re-encodes, so a sender cannot split or forge lines or reuse another event's id), and bounds connections overall and per uid, batch size, each account's bytes per second, and its own time per connection (shorter than the client's, so it reports how far it got instead of being resent). The client sends only to a socket that root owns in a directory nobody else can write (group-writable ancestors only for gid 0/1, which macOS's `/private/var/run` needs). `Deliverer.Write` sends through the socket when it answers and otherwise appends directly as before; only a direct append refused for permission (a restricted log whose collector is down) spools the line, to the account's private spool for that log (`~/.beacon/endpoint/spool/<log digest>`, 0600 under 0700), and the next line that gets through either way drains it. Root writers and per-user logs always write directly. The mode is `config.json` `log_access`, carried through repair and package upgrades (`BEACON_LOG_ACCESS` in the install scripts); install creates the `beacon-log` group (`internal/endpoint/loggroup`, getent/groupadd, dscl/dseditgroup) and `writer.RestrictSystemLog` makes the directory `root:beacon-log 02750`, the log and archives `0640` and the lock root-only `0600`, after writing the root-owned `.beacon-log-access` marker beside the log; a shared log is not narrowed in place but copied to fresh root-created files and renamed over, under its lock (bounded wait), because a descriptor opened while it was 0666 survives any chmod. A failed install restores the previous mode in its rollback, and a shared install removes a dead socket. The marker is what tells every root writer (`asymptoteobserve.RuntimeLogModes`) to keep the restricted modes. The OTLP receivers on loopback are not covered: any local process can still send OTLP, unattributed, so never claim more than the hook channel guarantees. Doctor's `runtime_log_access` covers the marker, the socket and pending spool. Unix sockets are local IPC, not a network channel, so the hooks-never-touch-the-network rule holds. On Windows the same mode runs over the named pipe `\\.\pipe\beacon-agent-ingest` (`localingest` `transport_windows.go`, go-winio): the collector creates it as the first instance, and when the name is taken (any account may create one) it reports a recoverable error and retries every few seconds rather than failing, so the rest of the collector stays up; it rejects remote clients and its DACL denies NETWORK and withholds `FILE_CREATE_PIPE_INSTANCE` from ordinary accounts, so it is not a network channel either; a client connects at identification level and sends only to a pipe owned by SYSTEM or Administrators; the server counts a connection against its account from the client process's token before reading and stamps the SID it reads by `ImpersonateNamedPipeClient` after the preamble (they must agree), with `Peer.UID` a string (decimal uid on Unix, SID on Windows) and the name from `LookupAccountSid`, bounded. Privileged writers there are SYSTEM and tokens with Administrators enabled (`CheckTokenMembership`; elevation for another group is not enough). The directory gets `sysacl.RestrictedLogDirDACL` (protected: SYSTEM and Administrators full, `beacon-log` local group read, nothing else; the lock SYSTEM and Administrators only) and everything below it is reset, because every account may bypass traverse checking; `writer.RestrictSystemLog` replaces every file directly in the directory (the log family under the lock; files outside it with another hard link are skipped) with a copy created with its final owner and DACL (`sysacl.CreateRestrictedFile`) and a POSIX-semantics rename, fails naming any file held open without sharing delete and then puts a log that was shared back to shared, and writes the marker last (on Windows it decides nothing for root writers, so a failed or killed run is not mistaken for a finished one). The marker counts there when SYSTEM or Administrators own it and no other account can write it. `loggroup` creates the local group with `net.exe` and looks it up qualified with the computer name. Doctor reads the restricted ACL (`writer.CheckRestrictedSystemLogACL`). `packaging/windows/smoke-restricted-log.ps1` runs in `windows-package-smoke` against the installed MSI with a real ordinary account. Hook and writer tests point `logging.EndpointIngest`/`writer.Ingest` at sockets of their own.
+ - Beacon Cloud forwarding (`cli/beacon/internal/endpoint/asymptote`, `beacon endpoint connect`, `beacon endpoint asymptote`) is Vector-shaped: Beacon writes local JSONL, Vector ships runtime lines only from the connection point forward and reads inventory from the beginning to establish the endpoint's current baseline, plus the one bounded exception of the session backfill (below), and the `bcn_device_*` key stays only in `<BaseDir>/asymptote/vector-secrets.json` via Vector's secret backend. The onboarding wizard preselects Beacon Cloud, and confirming it connects this endpoint in the same command once the local install has succeeded; an endpoint that is already enrolled is never re-enrolled, because enrollment rotates the device key. Standard mode ships locally sanitized retained content; metadata-only uses local Vector transforms to remove prompts, responses, reasoning, tool arguments/results, tool descriptions/definitions, retrieval queries/documents, evaluation explanations, agent descriptions, stop sequences, approval/policy reasons, command output, raw fields, diffs, inventory content, and MCP definitions before buffering/upload. Every text-shaped event field must be classified in `metadata_fields_test.go` (`metadataOnlyRemoved`, each with its own `del()` in `pack/metadata-transforms.toml`, or `metadataOnlyKept`); a new field fails that test until it is, and `BEACON_TEST_VECTOR_BIN` runs the transform on an event with every field set. `vector.toml` is not rendered only at connect: `asymptote.ReconcileForwarder` re-renders it in place for a connected endpoint from the current pack with the enrollment's ingest URL and recorded privacy mode, validates it with the forwarder's own Vector exactly as connect does, atomically replaces it, and, when run from install, repair, the package upgrade or the hidden reconcile the macOS postinstall runs (`ReconcileOptions.Restart`), restarts a running forwarder even when nothing changed (after `vector validate` of the current config with the forwarder's own Vector, and never after a warning, so a refused config or a missing Vector leaves the running forwarder alone), as the Sentinel reconcile does: switching to restricted log access replaces the runtime log with a copy, and Vector, which recognizes a file by its first line, keeps tailing the replaced one until it restarts; an upgrade may also have installed a new Vector. A stopped one is never started and reads the new config when it next starts. The `beacon_runtime` source reads `runtime.jsonl.1` too, as the Sentinel pack does, so lines written to a replaced log before a restart are found again at the next rotation instead of lost. It never enrolls, reads or rewrites the secrets file, makes a network request, or touches `vector-data/` (checkpoints stay, so pack changes must keep source ids and fingerprinting stable), and a rejected config is a warning that keeps the old one; it is a no-op when not connected, after an incomplete connect, without an installed unit, or where `ForwarderManager` is unsupported (supervised mode). `lifecycle.Install` runs it last when services are started (so install, repair and the Linux package upgrade), repair's teardown keeps the forwarder (`UninstallOptions.KeepManagedIngest`) instead of disconnecting it, and the macOS postinstall, which installs with `--no-start`, runs the hidden `beacon endpoint asymptote reconcile --system`. Keep the ingest URL `https://`, the wire contract aligned with `beacon-ingest` (`/v1/ingest/{runtime,inventory}` and `/v1/ingest/health`), and do not add another endpoint network channel. The cloud-sandbox shuttle is the bounded exception: only with `BEACON_ORIGIN=cloud`, it can upload new runtime lines to GCS, S3, or the same Beacon ingest contract because no Vector/service manager/browser/persistent disk exists there.
- Session backfill (`cli/beacon/cmd/endpoint_backfill.go`; docs in `docs/cli/endpoint-install.mdx#session-backfill` and `docs/cli/endpoint-connect.mdx#session-backfill`): after every successful install (user or system mode), every session-store collector runs once with `CollectOptions.Since` (30 days; `sessionwindow.Recent` keeps those sessions, newest first, and never touches the cursors of the rest) and a shared `writer.Budget` (24 MiB, at most 12 MiB per runtime through `Budget.Sub`; a refused append returns `writer.ErrBudgetSpent`, the collector stops with cursors past only what was written, and a manual sync reads the rest). A new session-store collector takes both fields, reads its store only through `internal/sessionfs` (a test parses every collector package to enforce it), and joins `endpointBackfillRunners` and that test's list. Every connect, first or re-connect, user or system, runs the same sweep before enrollment (skipped when install just ran it) and, before the forwarder starts, `asymptote.StageBackfill` copies the window's `harness.collection_method=poll` lines into `cloud-backfill.jsonl` beside the runtime log, which the `beacon_backfill` Vector source (fingerprinted `device_and_inode`, so each atomically restaged copy is a new file) reads from the beginning into the runtime sink through the same privacy transform. Live hook/OTLP/plugin history before the connection point stays local. Re-connects restage, so a resend of already-shipped lines is expected and rests on the deterministic `event.id`; a privacy-mode change clears the checkpoints and the restage renames the new-mode copy over the old one (kept until then so the copy is always a new inode; deleted instead when nothing restages), and `disconnect` removes it. System mode runs the collectors under `withUserHome` for the active console user (`activeConsoleUser`), with cursors under the system base directory, and reports a skip when nobody is logged in; root is reading a home the console user controls, so the sweep runs under `sessionfs.Confine` (an `os.Root` on that home, files owned by the home's owner only, non-blocking opens that refuse FIFOs/devices, SQLite read from a private snapshot under `<SystemBaseDir>/state/backfill-snapshots`, retried until the database size/change counter and WAL header are unchanged across the copy, and refused past `sessionfs.MaxSnapshotBytes` (512 MiB with its WAL) with the runtime's sync command named in the report), and refused paths read as absent and are listed in the report. User-mode sync and backfill stay unconfined. The wizard's confirm screen names the upload (`WizardOptions.BackfillDays`). Dry-run, `--no-backfill` and `BEACON_BACKFILL=0` skip all of it; the cmd tests run with `BEACON_BACKFILL=0` set in `TestMain`.
- `beacon endpoint install` has a full-screen onboarding wizard on interactive user TTYs. It signs in, preselects Beacon Cloud, requires an explicit choice to opt out to Local, and asks Managed users to choose Standard or Metadata-only privacy. Signing in alone still moves no telemetry. Confirming Beacon Cloud does: the confirm screen states that it installs Beacon and starts forwarding, and names what the selected privacy mode sends, so that screen is the consent point. The managed destination is recorded only after enrollment succeeds, so a failed enrollment leaves a working local install, prints `beacon endpoint connect` as the retry, and re-offers the question on the next install. The onboarding record is written only after `lifecycle.Install` returns, because a profile written first left a failed install looking onboarded and silently skipped the wizard on the retry. Explicit `install --connect` is unchanged. The wizard is skipped for system/root/CI/piped-stdin/dry-run or `BEACON_ONBOARDING=0`; those unattended paths must never gain an account or browser dependency. Legacy `BEACON_ONBOARDING_EMAIL`/`USAGE` submissions remain only for fleet compatibility. After the destination, the wizard shows an agent tools screen; every row is preselected (opt-out, space toggles). Beacon Cloud MCP is offered only with Beacon Cloud and runs the `beacon mcp connect` flow (`connectCloudMCP` with `yes`, OAuth, detected harnesses) only after the endpoint is connected (or already was), via `finishCloudSetup`; a failed enrollment skips it and names the retry. The Beacon Agent Skills are offered for either destination and installed user-wide into `~/.agents/skills` and, when Claude Code is set up, `~/.claude/skills` (`cli/beacon/internal/agentskills`, `beacon skills install|uninstall`; a `.beacon-managed` marker decides what Beacon may replace or remove; install and repair refresh only copies Beacon already wrote). Both run after `lifecycle.Install` returns and warn rather than fail. The answers are recorded as `onboarding.cloud_mcp`/`agent_skills`. Implementation lives in `cli/beacon/internal/onboarding`, `cli/beacon/cmd/endpoint_onboarding.go`, `cli/beacon/cmd/endpoint_install.go` and `cli/beacon/cmd/agent_tools.go`; keep `docs/cli/endpoint-onboarding.mdx` and `docs/cli/skills.mdx` in sync.
- The update notice on bare interactive `beacon` (`cli/beacon/cmd/root.go`, cache in `cli/beacon/internal/updatecheck/cache.go`; docs in `docs/cli/version.mdx`) follows the Codex/Claude Code pattern: it reads `~/.beacon/endpoint/update-check.json` and never waits on the network, and only when that cache is a day old does it start a detached `beacon version refresh` (hidden) that asks GitHub for the latest release and rewrites the cache, failures included. It is the CLI's one background network call; it never runs from hooks, other commands, non-TTY output, CI or dev builds, and `BEACON_UPDATE_CHECK=0` turns it off. Installs other than Homebrew and the system package get the release download, because `beacon endpoint update` applies only to the system package.
diff --cc docs/changelog/cli.mdx
index 9f08185c,24573e57..27d223f1
--- a/docs/changelog/cli.mdx
+++ b/docs/changelog/cli.mdx
@@@ -10,9 -10,8 +10,11 @@@ Stay up to date with the latest change
---
## Unreleased
+
+- **Linux package installs are restricted from the start** · A first install of the `.deb` or `.rpm` now sets up [restricted log access](/security/restricted-log-access) on its own: the `beacon-log` group, a `0640 root:beacon-log` log that only the collector writes, and hooks that send their events over the local socket, recorded under the account that sent them. Before, a fleet install by root (Salt, Ansible, an MDM script) left the log world-writable until someone ran `sudo beacon endpoint repair --system --log-access restricted`. Only where systemd runs the collector: without it, or with `BEACON_SERVICE=none`, the default stays shared. Upgrades, and reinstalls over a log kept by `uninstall --keep-logs`, keep the mode an endpoint already has, so existing endpoints do not change; `BEACON_LOG_ACCESS=shared` installs a new endpoint shared. Log shippers that do not run as root, and people who read the log with the dashboard, `beacon share` or `beacon traces`, need to join `beacon-log` (`sudo usermod -aG beacon-log <user>`); the install says so.
- - **Package install settings from `/etc/default/beacon`** · Configuration managers run `apt` or `dnf` without letting you set the package's environment, so the `BEACON_*` install settings could not reach a Salt or Ansible install. The Linux package now also reads them from `/etc/default/beacon` or `/etc/sysconfig/beacon`, for both the system install and the people it configures (read as shell syntax, trailing comments included, but never run; root-owned and not writable by other accounts, or it is ignored with a warning; a malformed value is skipped with a warning naming its key). The environment still wins. See [Settings for configuration-manager installs](/platforms/linux#settings-for-configuration-manager-installs).
++- **Package install settings from `/etc/default/beacon`** · Configuration managers run `apt` or `dnf` without letting you set the package's environment, so the `BEACON_*` install settings could not reach a Salt or Ansible install. The Linux package now also reads them from `/etc/default/beacon` or `/etc/sysconfig/beacon`, for both the system install and the people it configures (read as shell syntax, trailing comments included, but never run; root-owned and not writable by other accounts, or it is ignored with a warning; a malformed value is skipped with a warning naming its key). The environment, and the install script's positional arguments, still win, and a key set twice takes its last value. See [Settings for configuration-manager installs](/platforms/linux#settings-for-configuration-manager-installs).
+ - **Root and fleet installs configure everyone logged in, and say who** · A system install by root with no `sudo` user, such as Salt's `pkg.installed` or an Ansible `apt` task, configured the agent runtime of only the first logged-in session it found, and printed nothing about it; the only hook lines in the output were root's own. `beacon endpoint user-config repair-installed --system`, which the Linux package runs after installing, now configures the `sudo` user and every account with a live logind session, each as themselves, carries on when one of them fails, and prints `Configured <user> (<home>): …` for each, or that nobody was logged in and what to run. `--json` adds a `users` array; the existing fields still describe the first person.
+ - **Windows gets the right advice for elevation** · `beacon endpoint connect`, `disconnect` and `uninstall --system` from a shell without privileges told Windows users to rerun with `sudo`, a command Windows does not have. They now say to run from an elevated shell, the same as `beacon endpoint install --system` already did.
- **Microsoft Sentinel forwarding with one command, on macOS, Linux and Windows** · `beacon endpoint sentinel forwarder install --system` runs the Vector bundled with Beacon as a system service that sends the runtime log to Microsoft Sentinel through the Logs Ingestion API, with a Microsoft Entra app registration (certificate or client secret). The credential is stored where only root can read it, or SYSTEM and Administrators on Windows, and is never a command-line argument. Vector checks the config before anything changes. Repair and package upgrades keep the forwarder and restart it on the new Vector; uninstall removes the service. Throttling, server errors and `401`/`403` answers are retried without a limit, and a line counts as sent only once Azure has accepted it. `status` and `remove` complete the commands. The pack's Logs Ingestion DCR template no longer needs a Data Collection Endpoint. See [Vector and the Logs Ingestion API](/log-forwarding/microsoft-sentinel#vector-and-the-logs-ingestion-api).
- **The Windows MSI carries Vector** · The MSI now installs Vector 0.56.0 as `vector.exe` beside `beacon.exe` in `%ProgramFiles%\Beacon\bin`, as the macOS and Linux packages already carry it, checked against the same pinned checksums. Beacon finds it there. The package only installs it; nothing runs it until a forwarder is set up. Allow it alongside the other three programs if you run AppLocker or WDAC.
- **Scheduled session sync** · `beacon endpoint install|repair --session-sync` turns on a job that runs every 15 minutes and reads new records from the agent runtimes' local session stores into the runtime log. It runs the same bounded, confined sweep install already runs once, so session-store data keeps reaching the log, and any forwarder reading it, after install. Off by default; repair and upgrades keep the setting, and `--no-session-sync` removes the job. See [Scheduled session sync](/cli/endpoint-install#scheduled-session-sync).
diff --cc docs/platforms/linux.mdx
index 6cf5ee39,2b76d808..f437d294
--- a/docs/platforms/linux.mdx
+++ b/docs/platforms/linux.mdx
@@@ -172,45 -172,24 +172,53 @@@ Vector comes with Beacon. The `.deb` an
| Unpack | `beacon`, `beacon-hooks`, `beacon-otelcol` and `vector` under `/opt/beacon/bin` |
| System install | Config and collector config under `/etc/beacon/endpoint` |
| Service | `/etc/systemd/system/beacon-collector.service`, enabled and started |
-| Runtime log | `/var/log/beacon-agent/runtime.jsonl` |
+| Runtime log | `/var/log/beacon-agent/runtime.jsonl`, in [restricted log access](/security/restricted-log-access) on a first install: `0640 root:beacon-log`, written only by the collector |
- | Agent runtime | Claude Code and Codex CLI settings for the installing user, pointed at `127.0.0.1:4317` |
+ | Agent runtime | Claude Code and Codex CLI settings and hooks for the installing user and everyone logged in, pointed at `127.0.0.1:4317` |
- That last row is worth knowing about. A system-mode endpoint runs as root, so the install has to work out whose agent settings to configure, and the collector is useless if nothing exports to it. Beacon uses `SUDO_USER`, which is set for every normal install path, and falls back to asking logind who has an active session. If it cannot identify anyone, it says so instead of failing, and you can configure yourself later:
+ That last row is worth knowing about. A system-mode endpoint runs as root, so the install has to work out whose agent settings to configure, and the collector is useless if nothing exports to it. Beacon configures the user named by `SUDO_USER`, which is set when you install with `sudo`, and every account logind reports a live login session for (a desktop, ssh or terminal login; not a display manager's greeter or a background session such as cron's), which is what an install by a configuration manager running as root (Salt, Ansible, Puppet) has to go on. Each is configured as that user, in their own home, and the install prints one line per person:
+
+ ```
+ beacon: the hook lines above are root's own; configuring the agent runtimes of logged-in users
+ Configured alice (/home/alice): telemetry for claude, codex; hooks for claude, codex, writing to /var/log/beacon-agent/runtime.jsonl
+ Configured bob (/home/bob): telemetry for claude, codex; hooks for claude, codex, writing to /var/log/beacon-agent/runtime.jsonl
+ ```
+
+ The `Claude Code hooks installed: /root/...` lines printed before it are root's own settings, not anyone else's. A person who was not logged in during the install is not configured. If nobody can be identified, the install says so instead of failing, and each person configures themselves later:
```bash title="Configure your own agent runtime against an already-installed endpoint"
sudo beacon endpoint user-config repair-installed --system
```
-Other users on the same machine run the same command for themselves. They all export to the same collector and the same log. That is why `/var/log/beacon-agent/runtime.jsonl` is group- and world-writable: hooks run as the logged-in user and append to it directly. To stop other accounts from modifying or reading it, install with [`--log-access restricted`](/cli/endpoint-install#restricted-log-access): the collector becomes the only writer and hooks send their events to it over a local socket.
+Other users on the same machine run the same command for themselves. They all export to the same collector and the same log. A first package install on a host where systemd runs the collector sets the log to [restricted access](/cli/endpoint-install#restricted-log-access): the collector is the only writer, hooks hand their events to it over a local socket and are recorded under the account the kernel says sent them, and only root and the `beacon-log` group can read the log. That includes the people using the machine: the dashboard, `beacon share` and `beacon traces` cannot read the system log for an account outside `beacon-log`, so on a single person's workstation add them with `sudo usermod -aG beacon-log <user>` (and log in again); the install prints this. Without systemd as PID 1 (a container, WSL without systemd) or with `BEACON_SERVICE=none`, the collector is a process nothing restarts, so those installs stay shared unless you ask for restricted. A package upgrade, or a reinstall over a log kept by `uninstall --keep-logs`, keeps whatever mode the endpoint already has, so an endpoint installed from an earlier package stays shared until you switch it with `sudo beacon endpoint repair --system --log-access restricted`. To install with the older shared log instead, where every account appends to the file directly, set `BEACON_LOG_ACCESS=shared` (see below).
+
+### Settings for configuration-manager installs
+
+Salt's `pkg.installed`, Ansible's `apt` and `dnf` modules, Puppet and Chef run the package manager for you and give you no way to set the environment of the package's install script. Write the settings to `/etc/default/beacon` (Debian, Ubuntu) or `/etc/sysconfig/beacon` (Fedora, RHEL) before the package is installed, and the install script reads them:
+
+```bash title="/etc/default/beacon"
+BEACON_LOG_ACCESS=restricted
+BEACON_ENDPOINT_HARNESSES=claude,codex,cursor
+BEACON_SESSION_SYNC=1
+```
+
+```yaml title="Salt state"
+/etc/default/beacon:
+ file.managed:
+ - user: root
+ - group: root
+ - mode: "0600"
+ - contents: |
+ BEACON_LOG_ACCESS=restricted
+
+beacon:
+ pkg.installed:
+ - sources:
+ - beacon: salt://beacon/beacon_<version>_linux_amd64.deb
+ - require:
+ - file: /etc/default/beacon
+```
+
- The file is read, not run: each line is a `KEY=VALUE` written as a shell would read it (an `export` in front, quotes around the value, and `# comments` on their own line or after the value are allowed; a value with an unquoted space or an unclosed quote is skipped with a warning naming the key), and only the install settings the script documents are taken (`BEACON_LOG_ACCESS`, `BEACON_ENDPOINT_HARNESSES`, `BEACON_OTLP_GRPC_PORT`, `BEACON_OTLP_HTTP_PORT`, `BEACON_SESSION_SYNC`, `BEACON_SERVICE`, `BEACON_NO_START`, `BEACON_COLLECTOR` and the `BEACON_SPLUNK_*` settings). Because the install script runs as root, the file is ignored, with a warning, unless root owns it and no other account can write it. A variable set in the install script's environment wins over the file. The package reads it for both of its steps, so `BEACON_ENDPOINT_HARNESSES` reaches the system install and the agent runtimes of the people it configures. The file is read on every install and upgrade, so keep it in step with what you want the endpoint to be; an unset `BEACON_LOG_ACCESS` on an upgrade keeps the mode the endpoint has.
++The file is read, not run: each line is a `KEY=VALUE` written as a shell would read it (an `export` in front, quotes around the value, and `# comments` on their own line or after the value are allowed; a value with an unquoted space or an unclosed quote is skipped with a warning naming the key), and only the install settings the script documents are taken (`BEACON_LOG_ACCESS`, `BEACON_ENDPOINT_HARNESSES`, `BEACON_OTLP_GRPC_PORT`, `BEACON_OTLP_HTTP_PORT`, `BEACON_SESSION_SYNC`, `BEACON_SERVICE`, `BEACON_NO_START`, `BEACON_COLLECTOR` and the `BEACON_SPLUNK_*` settings). Because the install script runs as root, the file is ignored, with a warning, unless root owns it and no other account can write it. A variable set in the install script's environment, or passed as one of its positional arguments when you run `/opt/beacon/scripts/install-endpoint.sh` yourself, wins over the file. A key the file sets twice takes the last value, as a shell would, so appending a line overrides an earlier one. The package reads it for both of its steps, so `BEACON_ENDPOINT_HARNESSES` reaches the system install and the agent runtimes of the people it configures. The file is read on every install and upgrade, so keep it in step with what you want the endpoint to be; an unset `BEACON_LOG_ACCESS` on an upgrade keeps the mode the endpoint has.
## Managing the service
diff --cc packaging/linux/beacon-settings.sh
index 051c1610,00000000..3faa545d
mode 100644,000000..100644
--- a/packaging/linux/beacon-settings.sh
+++ b/packaging/linux/beacon-settings.sh
@@@ -1,131 -1,0 +1,152 @@@
+# Beacon package install settings, shared by install-endpoint.sh and the package postinstall.
+#
+# Sourced, not run: it defines beacon_load_settings and nothing else. Both scripts need the same
+# answer, because the postinstall runs two separate steps (the system install and configuring each
+# logged-in user) and a setting that reached only the first was silently ignored by the second.
+#
+# Settings a configuration manager drops before installing the package. Salt's pkg.installed,
+# Ansible's apt/dnf modules, Puppet and Chef all run the package manager without letting the caller
+# set the environment of the maintainer scripts, so the BEACON_* variables could not reach a
+# centrally deployed install any other way. /etc/default is the Debian convention and
+# /etc/sysconfig the RHEL one; the first that exists is read (BEACON_DEFAULTS_FILE names another).
+#
+# The file is read, never sourced: only the documented install settings are taken, as KEY=VALUE
+# lines in the shell syntax such files are written in (an optional `export`, one pair of matching
+# single or double quotes, whole-line and trailing `# comments`), so nothing in it runs. A value with
+# anything else left over (an unquoted space, an unterminated quote) is skipped with a warning rather
+# than passed on. The file is ignored unless root owns it and no one else can write it, because the
- # package scripts run as root. A variable already set in the environment wins over the file.
++# package scripts run as root. A variable already set in the environment wins over the file; within
++# the file, a later assignment of a key replaces an earlier one, as it would for a shell, because a
++# configuration manager often overrides a setting by appending a line.
++
++# The documented install settings, the only keys taken from the file.
++BEACON_SETTINGS_KEYS='BEACON_ENDPOINT_HARNESSES BEACON_OTLP_GRPC_PORT BEACON_OTLP_HTTP_PORT
++BEACON_COLLECTOR BEACON_NO_START BEACON_SERVICE BEACON_LOG_ACCESS BEACON_SESSION_SYNC
++BEACON_SPLUNK_HEC_ENDPOINT BEACON_SPLUNK_HEC_TOKEN BEACON_SPLUNK_INDEX BEACON_SPLUNK_SOURCE
++BEACON_SPLUNK_SOURCETYPE BEACON_SPLUNK_INSECURE_SKIP_VERIFY BEACON_SPLUNK_CA_FILE'
+
+# beacon_defaults_trusted FILE succeeds when FILE is owned by root and not group- or world-writable.
+beacon_defaults_trusted() {
+ # Owner uid and permission bits, from GNU stat (every Linux userland Beacon packages for) or
+ # BusyBox, which accepts the same format.
+ _beacon_meta="$(stat -c '%u %a' "$1" 2>/dev/null)" || return 1
+ # BEACON_DEFAULTS_OWNER lets the packaging tests run as an ordinary account.
+ [ "${_beacon_meta%% *}" = "${BEACON_DEFAULTS_OWNER:-0}" ] || return 1
+ # The last two octal digits are group and other: neither may include write (2, 3, 6, 7).
+ case "${_beacon_meta##* }" in
+ *[2367]?|*[2367]) return 1 ;;
+ esac
+ return 0
+}
+
+# beacon_settings_value RAW prints the value of an assignment's right-hand side, or fails when the
+# text is not one plain value.
+beacon_settings_value() {
+ _beacon_raw="$1"
+ # Leading and trailing whitespace.
+ _beacon_raw="${_beacon_raw#"${_beacon_raw%%[![:space:]]*}"}"
+ _beacon_raw="${_beacon_raw%"${_beacon_raw##*[![:space:]]}"}"
+ case "$_beacon_raw" in
+ \"*|\'*)
+ _beacon_q="$(printf '%s' "$_beacon_raw" | cut -c1)"
+ _beacon_inner="${_beacon_raw#?}"
+ case "$_beacon_inner" in
+ *"$_beacon_q"*) ;;
+ *) return 1 ;; # unterminated
+ esac
+ _beacon_rest="${_beacon_inner#*"$_beacon_q"}"
+ _beacon_inner="${_beacon_inner%%"$_beacon_q"*}"
+ # After the closing quote only whitespace, then optionally a comment, may follow. A `#` right
+ # after the quote is not a comment to a shell but more of the word, so it is refused too.
+ case "$_beacon_rest" in
+ '') printf '%s' "$_beacon_inner"; return 0 ;;
+ [[:space:]]*) ;;
+ *) return 1 ;;
+ esac
+ _beacon_rest="${_beacon_rest#"${_beacon_rest%%[![:space:]]*}"}"
+ case "$_beacon_rest" in
+ ''|'#'*) printf '%s' "$_beacon_inner"; return 0 ;;
+ esac
+ return 1
+ ;;
+ esac
+ # Unquoted: a `#` starts a comment only at the start or after whitespace, as in the shell.
+ case "$_beacon_raw" in
+ '#'*) _beacon_raw='' ;;
+ esac
+ case "$_beacon_raw" in
+ *[[:space:]]'#'*)
+ _beacon_raw="$(printf '%s' "$_beacon_raw" | sed 's/[[:space:]]#.*$//')"
+ ;;
+ esac
+ _beacon_raw="${_beacon_raw%"${_beacon_raw##*[![:space:]]}"}"
+ # Whitespace left inside an unquoted value would be a second word to a shell.
+ case "$_beacon_raw" in
+ *[[:space:]]*) return 1 ;;
+ esac
+ printf '%s' "$_beacon_raw"
+}
+
+# beacon_load_settings exports the documented settings from the defaults file that are not already
+# set in the environment.
+beacon_load_settings() {
+ _beacon_file="${BEACON_DEFAULTS_FILE:-}"
+ if [ -z "$_beacon_file" ]; then
+ for _beacon_candidate in /etc/default/beacon /etc/sysconfig/beacon; do
+ if [ -f "$_beacon_candidate" ]; then
+ _beacon_file="$_beacon_candidate"
+ break
+ fi
+ done
+ fi
+ [ -n "$_beacon_file" ] && [ -f "$_beacon_file" ] || return 0
+ if ! beacon_defaults_trusted "$_beacon_file"; then
+ echo "beacon: ignoring $_beacon_file: it must be owned by root and writable by no one else" >&2
+ return 0
+ fi
++ # Which settings are already set is decided once, before the file is read, so that a key the file
++ # assigns twice takes its last value rather than its first.
++ _beacon_known=' '
++ _beacon_preset=' '
++ for _beacon_key in $BEACON_SETTINGS_KEYS; do
++ _beacon_known="$_beacon_known$_beacon_key "
++ # $_beacon_key is one of the fixed names above, so the indirection cannot evaluate anything else.
++ eval "_beacon_set=\${$_beacon_key+set}"
++ if [ -n "$_beacon_set" ]; then
++ _beacon_preset="$_beacon_preset$_beacon_key "
++ fi
++ done
+ while IFS= read -r _beacon_line || [ -n "$_beacon_line" ]; do
+ _beacon_line="${_beacon_line#"${_beacon_line%%[![:space:]]*}"}"
+ case "$_beacon_line" in
+ ''|'#'*) continue ;;
+ export[[:space:]]*)
+ _beacon_line="${_beacon_line#export}"
+ _beacon_line="${_beacon_line#"${_beacon_line%%[![:space:]]*}"}"
+ ;;
+ esac
+ case "$_beacon_line" in
+ *=*) ;;
+ *) continue ;;
+ esac
+ _beacon_key="${_beacon_line%%=*}"
++ # A plain name only: anything else (a space, say) could otherwise match two adjacent names below.
+ case "$_beacon_key" in
- BEACON_ENDPOINT_HARNESSES|BEACON_OTLP_GRPC_PORT|BEACON_OTLP_HTTP_PORT|BEACON_COLLECTOR|\
- BEACON_NO_START|BEACON_SERVICE|BEACON_LOG_ACCESS|BEACON_SESSION_SYNC|\
- BEACON_SPLUNK_HEC_ENDPOINT|BEACON_SPLUNK_HEC_TOKEN|BEACON_SPLUNK_INDEX|BEACON_SPLUNK_SOURCE|\
- BEACON_SPLUNK_SOURCETYPE|BEACON_SPLUNK_INSECURE_SKIP_VERIFY|BEACON_SPLUNK_CA_FILE) ;;
++ ''|*[!A-Z0-9_]*) continue ;;
++ esac
++ case "$_beacon_known" in
++ *" $_beacon_key "*) ;;
+ *) continue ;;
+ esac
++ # Set before the file was read: the environment (or an explicit argument) wins.
++ case "$_beacon_preset" in
++ *" $_beacon_key "*) continue ;;
++ esac
+ if ! _beacon_value="$(beacon_settings_value "${_beacon_line#*=}")"; then
+ # The key only, never the value: it may be a token.
+ echo "beacon: ignoring $_beacon_key in $_beacon_file: not a single value (quote a value with spaces)" >&2
+ continue
+ fi
- # $_beacon_key is one of the names above, so the indirection cannot evaluate anything else.
- eval "_beacon_set=\${$_beacon_key+set}"
- if [ -z "$_beacon_set" ]; then
- export "$_beacon_key=$_beacon_value"
- fi
++ export "$_beacon_key=$_beacon_value"
+ done <"$_beacon_file"
+}
diff --cc packaging/linux/install-endpoint.sh
index 2f374c90,c7240aa1..ede2fbfd
--- a/packaging/linux/install-endpoint.sh
+++ b/packaging/linux/install-endpoint.sh
@@@ -6,14 -6,6 +6,23 @@@
# mixed fleet has one contract rather than two.
set -eu
+# The install settings a configuration manager can drop in /etc/default/beacon or
+# /etc/sysconfig/beacon; see beacon-settings.sh. It sits beside this script in the package
+# (/opt/beacon/scripts) and in the repository.
+BEACON_SCRIPTS_DIR="${BEACON_SCRIPTS_DIR:-$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)}"
++# Positional arguments are named on the command line, so like the environment they win over the
++# settings file: each is resolved into its variable before the file is read, which then fills only
++# what neither gave.
++[ -n "${1:-}" ] && BEACON_ENDPOINT_HARNESSES="${BEACON_ENDPOINT_HARNESSES:-$1}"
++[ -n "${2:-}" ] && BEACON_OTLP_GRPC_PORT="${BEACON_OTLP_GRPC_PORT:-$2}"
++[ -n "${3:-}" ] && BEACON_OTLP_HTTP_PORT="${BEACON_OTLP_HTTP_PORT:-$3}"
++[ -n "${4:-}" ] && BEACON_COLLECTOR="${BEACON_COLLECTOR:-$4}"
++[ -n "${5:-}" ] && BEACON_NO_START="${BEACON_NO_START:-$5}"
++[ -n "${6:-}" ] && BEACON_SERVICE="${BEACON_SERVICE:-$6}"
+# shellcheck source=beacon-settings.sh
+. "$BEACON_SCRIPTS_DIR/beacon-settings.sh"
+beacon_load_settings
+
if [ -z "${BEACON_BIN:-}" ]; then
if [ -x "/opt/beacon/bin/beacon" ]; then
BEACON_BIN="/opt/beacon/bin/beacon"
diff --cc packaging/linux/smoke-package.sh
index ef60539a,71d34312..75d1857b
--- a/packaging/linux/smoke-package.sh
+++ b/packaging/linux/smoke-package.sh
@@@ -97,21 -97,42 +97,47 @@@ echo "ok: systemd is PID 1
# and dnf reports it as unopenable. Ubuntu does not do this, which is why only the rpm lane hit it.
docker cp "$PKG" "$CONTAINER":/var/tmp/beacon."$FORMAT" >/dev/null
- # A human has to exist for the install to have anyone to configure. A system endpoint runs as root,
+ # Humans have to exist for the install to have anyone to configure. A system endpoint runs as root,
# so `endpoint install` configures root's agent settings -- and the postinstall's second step is what
- # points the actual operator's Claude Code at the collector. SUDO_USER is how that operator is
- # identified, and dpkg/rpm pass their environment through to maintainer scripts, so setting it here
- # is the same thing `sudo apt install ./beacon.deb` does.
- docker exec "$CONTAINER" useradd -m -s /bin/bash "$SMOKE_USER" >/dev/null 2>&1 || true
- docker exec "$CONTAINER" test -d "/home/$SMOKE_USER" || {
- echo "could not create the test user $SMOKE_USER" >&2; exit 1; }
+ # points the people using the machine at the collector.
+ #
+ # The install below runs the way a configuration manager runs it: as root, with no SUDO_USER, so the
+ # only way to know who uses the machine is logind. Two people are logged in, because one machine
+ # often has several (a shared workstation, staff signing in to someone else's), and the install has
+ # to configure every one of them, not just the first. `su -l` opens a real logind session through
+ # pam_systemd. The SUDO_USER path is covered by the CLI's unit tests.
+ SMOKE_USER2="${SMOKE_USER}2"
+ for u in "$SMOKE_USER" "$SMOKE_USER2"; do
+ docker exec "$CONTAINER" useradd -m -s /bin/bash "$u" >/dev/null 2>&1 || true
+ docker exec "$CONTAINER" test -d "/home/$u" || {
+ echo "could not create the test user $u" >&2; exit 1; }
+ # -t: a login on a terminal, which logind classes "user". Without one it is a "background"
+ # session (what cron opens), which Beacon rightly does not take for a person.
+ docker exec -dt "$CONTAINER" su -l "$u" -c 'exec sleep infinity'
+ done
+ # And an account whose only session is not a person's login: no terminal, so logind classes it
+ # "background", as it does cron's. A display manager's greeter is the desktop case of the same thing.
+ docker exec "$CONTAINER" useradd -m -s /bin/bash beaconsvc >/dev/null 2>&1 || true
+ docker exec -d "$CONTAINER" su -l beaconsvc -c 'exec sleep infinity'
+ i=0
+ while [ "$i" -lt 20 ]; do
+ sessions="$(docker exec "$CONTAINER" loginctl list-sessions --no-legend 2>/dev/null || true)"
+ case "$sessions" in *"$SMOKE_USER2"*) case "$sessions" in *"$SMOKE_USER "*) break ;; esac ;; esac
+ i=$((i+1)); sleep 1
+ done
+ case "$sessions" in
+ *"$SMOKE_USER2"*) ;;
+ *) echo "logind has no sessions for the test users, so there is nobody to configure:" >&2
+ echo "$sessions" >&2; exit 1 ;;
+ esac
+ echo "ok: $SMOKE_USER and $SMOKE_USER2 are logged in (logind)"
+# A settings file, as a configuration manager would drop one before installing: its harness list has
+# to reach both the system install and the step that configures the user, and a trailing comment
+# must not fail the install.
+docker exec "$CONTAINER" sh -c 'printf "%s\n" "# managed by config management" "BEACON_ENDPOINT_HARNESSES=claude,codex,cursor # all three" >/etc/default/beacon && chmod 600 /etc/default/beacon'
+
- if ! docker exec -e SUDO_USER="$SMOKE_USER" "$CONTAINER" sh -c "$PKGMGR_INSTALL" >/tmp/beacon-pkg-install.log 2>&1; then
+ if ! docker exec "$CONTAINER" env -u SUDO_USER sh -c "$PKGMGR_INSTALL" >/tmp/beacon-pkg-install.log 2>&1; then
echo "package install failed:" >&2
tail -30 /tmp/beacon-pkg-install.log >&2
exit 1
@@@ -186,15 -207,28 +212,37 @@@ adapter_owner="$(docker exec "$CONTAINE
echo "$ADAPTER is owned by $adapter_owner, not $SMOKE_USER" >&2; exit 1; }
echo "ok: hooks installed for the user and runnable by them"
+docker exec "$CONTAINER" test -f "/home/$SMOKE_USER/.cursor/hooks.json" || {
+ echo "Cursor from /etc/default/beacon was not configured for $SMOKE_USER" >&2
+ grep -i "hook\|ignoring" "$POSTINST_LOG" >&2 || true
+ exit 1
+}
+grep -q "sudo usermod -aG beacon-log" "$POSTINST_LOG" || {
+ echo "the install did not say how to let someone read the restricted log" >&2; exit 1; }
+echo "ok: the settings file reached the user step (Cursor configured), and the beacon-log hint was printed"
+
+ # The second person logged in is configured too, as themselves, and the install says so for both
+ # rather than leaving the root context's own hook lines as the only output.
+ SETTINGS2="/home/$SMOKE_USER2/.claude/settings.json"
+ docker exec "$CONTAINER" grep -q '"hooks"' "$SETTINGS2" || {
+ echo "$SETTINGS2 has no hooks, so only the first logged-in user was configured" >&2
+ grep -i "configur" /tmp/beacon-pkg-install.log >&2 || true
+ exit 1
+ }
+ owner2="$(docker exec "$CONTAINER" stat -c %U "$SETTINGS2" 2>/dev/null || true)"
+ [ "$owner2" = "$SMOKE_USER2" ] || { echo "$SETTINGS2 is owned by $owner2" >&2; exit 1; }
+ for u in "$SMOKE_USER" "$SMOKE_USER2"; do
+ grep -q "^Configured $u (/home/$u): " "$POSTINST_LOG" || {
+ echo "the install did not report configuring $u:" >&2
+ tail -20 "$POSTINST_LOG" >&2
+ exit 1
+ }
+ done
+ if docker exec "$CONTAINER" test -e /home/beaconsvc/.claude/settings.json; then
+ echo "beaconsvc, whose only session is a background one, was configured as if it were a person" >&2; exit 1
+ fi
+ echo "ok: every logged-in user was configured, and the install said so for each (and not a background session's account)"
+
# Reachable by name, not just by absolute path.
#
# Every check in this file used /opt/beacon/bin/beacon, so the package could ship with nothing on
diff --cc packaging/linux/test-endpoint-scripts.sh
index e0760a00,00000000..39044a62
mode 100644,000000..100644
--- a/packaging/linux/test-endpoint-scripts.sh
+++ b/packaging/linux/test-endpoint-scripts.sh
@@@ -1,193 -1,0 +1,226 @@@
+#!/bin/sh
+# Checks packaging/linux/install-endpoint.sh without installing anything: a stub stands in for the
+# beacon binary and records the arguments the script would run it with.
+#
+# sh packaging/linux/test-endpoint-scripts.sh
+set -eu
+
+ROOT_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")/../.." && pwd)"
+INSTALL_SCRIPT="$ROOT_DIR/packaging/linux/install-endpoint.sh"
+TMP_DIR="$(mktemp -d)"
+trap 'rm -rf "$TMP_DIR"' EXIT INT TERM
+
+for script in "$ROOT_DIR"/packaging/linux/*.sh "$ROOT_DIR"/packaging/linux/nfpm/*.sh; do
+ case "$(head -n 1 "$script")" in
+ *bash*) bash -n "$script" ;;
+ *) sh -n "$script" ;;
+ esac
+done
+
+STUB="$TMP_DIR/beacon"
+ARGS="$TMP_DIR/args"
+cat >"$STUB" <<'STUB'
+#!/bin/sh
+printf '%s\n' "$@" >"$BEACON_TEST_ARGS"
+STUB
+chmod 755 "$STUB"
+
+failures=0
+fail() {
+ echo "FAIL: $*" >&2
+ failures=$((failures + 1))
+}
+
+# run_install [VAR=value ...] runs the install script in a clean environment pointed at the stub,
+# with no system config unless the caller makes one, and no defaults file unless it names one.
+run_install() {
+ rm -f "$ARGS"
+ env -i PATH="$PATH" HOME="$TMP_DIR" BEACON_BIN="$STUB" BEACON_TEST_ARGS="$ARGS" \
+ BEACON_COLLECTOR="$TMP_DIR/collector" \
+ BEACON_SYSTEM_CONFIG="$TMP_DIR/etc/config.json" \
+ BEACON_DEFAULTS_FILE="$TMP_DIR/none" \
+ BEACON_DEFAULTS_OWNER="$(id -u)" \
+ BEACON_SYSTEM_LOG="$TMP_DIR/log/runtime.jsonl" \
+ BEACON_INIT_COMM="$TMP_DIR/init-comm" \
- "$@" sh "$INSTALL_SCRIPT" >"$TMP_DIR/out" 2>&1 || { cat "$TMP_DIR/out" >&2; return 1; }
++ "$@" sh "$INSTALL_SCRIPT" $INSTALL_ARGS >"$TMP_DIR/out" 2>&1 || { cat "$TMP_DIR/out" >&2; return 1; }
+}
++# Positional arguments for run_install, split on spaces (none of the tests' values contain one).
++INSTALL_ARGS=''
+
+# flag_value FLAG prints the value passed after FLAG, or nothing when it was not passed.
+flag_value() {
+ awk -v flag="$1" 'found { print; exit } $0 == flag { found = 1 }' "$ARGS"
+}
+
+has_flag() {
+ grep -qx -- "$1" "$ARGS"
+}
+
+expect_log_access() {
+ got="$(flag_value --log-access)"
+ [ "$got" = "$1" ] || fail "$2: --log-access is '$got', want '$1'"
+}
+
+# systemd is PID 1 unless a test says otherwise.
+printf 'systemd\n' >"$TMP_DIR/init-comm"
+
+# A first install, with no system config, defaults to restricted.
+run_install
+expect_log_access restricted "first install"
+[ "$(sed -n 1,3p "$ARGS" | tr '\n' ' ')" = "endpoint install --system " ] || fail "first install: not an endpoint install --system: $(tr '\n' ' ' <"$ARGS")"
+
+# An upgrade (a system config exists) passes no mode, so the endpoint keeps the one it has.
+mkdir -p "$TMP_DIR/etc"
+echo '{}' >"$TMP_DIR/etc/config.json"
+run_install
+has_flag --log-access && fail "upgrade: passed --log-access $(flag_value --log-access); the existing mode must be kept"
+rm -f "$TMP_DIR/etc/config.json"
+
+# The environment opts a first install out, and can ask for restricted on an upgrade.
+run_install BEACON_LOG_ACCESS=shared
+expect_log_access shared "first install with BEACON_LOG_ACCESS=shared"
+echo '{}' >"$TMP_DIR/etc/config.json"
+run_install BEACON_LOG_ACCESS=restricted
+expect_log_access restricted "upgrade with BEACON_LOG_ACCESS=restricted"
+rm -f "$TMP_DIR/etc/config.json"
+
+# Only where the collector will be a systemd service: a supervised collector nothing restarts would
+# leave a restricted log spooling every hook event whenever it is down.
+printf 'init\n' >"$TMP_DIR/init-comm"
+run_install
+has_flag --log-access && fail "no systemd: passed --log-access $(flag_value --log-access), want the shared default"
+printf 'systemd\n' >"$TMP_DIR/init-comm"
+run_install BEACON_SERVICE=none
+has_flag --log-access && fail "BEACON_SERVICE=none: passed --log-access $(flag_value --log-access), want the shared default"
+run_install BEACON_SERVICE=systemd
+expect_log_access restricted "BEACON_SERVICE=systemd"
+run_install BEACON_SERVICE=none BEACON_LOG_ACCESS=restricted
+expect_log_access restricted "BEACON_SERVICE=none asking for restricted"
+
+# A runtime log left by `uninstall --keep-logs` is a reinstall: the install keeps the mode recorded
+# beside it, so no mode is passed.
+mkdir -p "$TMP_DIR/log"
+: >"$TMP_DIR/log/runtime.jsonl"
+run_install
+has_flag --log-access && fail "reinstall over a kept log: passed --log-access $(flag_value --log-access); the kept mode must be kept"
+rm -rf "$TMP_DIR/log"
+
+# A defaults file supplies settings a configuration manager cannot pass through the environment.
+DEFAULTS="$TMP_DIR/default-beacon"
+cat >"$DEFAULTS" <<'CONF'
+# Written by Salt before pkg.installed.
+BEACON_LOG_ACCESS=shared
+export BEACON_ENDPOINT_HARNESSES="claude,codex,cursor"
+ BEACON_SESSION_SYNC='1'
+BEACON_OTLP_HTTP_PORT=4319
+NOT_A_BEACON_SETTING=1
+BEACON_BIN=/tmp/evil
+PATH=/tmp/evil
+BEACON_SERVICE=$(touch${IFS}/tmp/beacon-defaults-ran)
+not even an assignment
+CONF
+chmod 600 "$DEFAULTS"
+run_install BEACON_DEFAULTS_FILE="$DEFAULTS"
+expect_log_access shared "defaults file"
+[ "$(flag_value --harness)" = "claude,codex,cursor" ] || fail "defaults file: --harness is '$(flag_value --harness)'"
+[ "$(flag_value --otlp-http-port)" = "4319" ] || fail "defaults file: --otlp-http-port is '$(flag_value --otlp-http-port)'"
+has_flag --session-sync || fail "defaults file: BEACON_SESSION_SYNC='1' did not pass --session-sync"
+# Only documented install settings are taken: the binary still came from the environment, and the
+# command substitution was passed as an inert string rather than run.
+[ -s "$ARGS" ] || fail "defaults file: BEACON_BIN in the file replaced the binary"
+[ "$(flag_value --service)" = '$(touch${IFS}/tmp/beacon-defaults-ran)' ] || fail "defaults file: --service is '$(flag_value --service)'"
+[ -e /tmp/beacon-defaults-ran ] && fail "defaults file: a value was executed"
+
+# Trailing comments, as a shell reads them, and values that are not one value are skipped with a
+# warning instead of failing the package install.
+cat >"$DEFAULTS" <<'CONF'
+BEACON_LOG_ACCESS=shared # fleet default
+BEACON_OTLP_HTTP_PORT="4320" # alt port
+BEACON_ENDPOINT_HARNESSES='claude,cursor'#no space so part of nothing: quoted then comment-less junk
+BEACON_OTLP_GRPC_PORT=4317 4318
+BEACON_SERVICE="systemd
+BEACON_SPLUNK_INDEX=main#notacomment
+CONF
+chmod 600 "$DEFAULTS"
+run_install BEACON_DEFAULTS_FILE="$DEFAULTS"
+expect_log_access shared "trailing comment"
+[ "$(flag_value --otlp-http-port)" = "4320" ] || fail "quoted value with a comment: --otlp-http-port is '$(flag_value --otlp-http-port)'"
+[ "$(flag_value --harness)" = "claude,codex" ] || fail "junk after a closing quote was taken: --harness is '$(flag_value --harness)'"
+[ "$(flag_value --otlp-grpc-port)" = "4317" ] || fail "two words were taken as one value: --otlp-grpc-port is '$(flag_value --otlp-grpc-port)'"
+has_flag --service && fail "an unterminated quote was taken: --service $(flag_value --service)"
+[ "$(flag_value --splunk-index)" = "main#notacomment" ] || fail "a # inside a word is not a comment: --splunk-index is '$(flag_value --splunk-index)'"
+for key in BEACON_ENDPOINT_HARNESSES BEACON_OTLP_GRPC_PORT BEACON_SERVICE; do
+ grep -q "ignoring $key in $DEFAULTS" "$TMP_DIR/out" || fail "no warning for the malformed $key"
+done
+grep -q "4318" "$TMP_DIR/out" && fail "a warning printed a value; it must name the key only"
+
+# The package postinstall loads the same settings itself, for the step that configures each
+# logged-in user, which runs as a separate command.
+printf 'BEACON_ENDPOINT_HARNESSES=claude,codex,cursor # all three\n' >"$DEFAULTS"
+got="$(env -i PATH="$PATH" BEACON_DEFAULTS_FILE="$DEFAULTS" BEACON_DEFAULTS_OWNER="$(id -u)" \
+ sh -c '. "$1"; beacon_load_settings; printf %s "${BEACON_ENDPOINT_HARNESSES:-}"' sh "$ROOT_DIR/packaging/linux/beacon-settings.sh")"
+[ "$got" = "claude,codex,cursor" ] || fail "beacon_load_settings exported BEACON_ENDPOINT_HARNESSES='$got'"
+grep -q 'beacon_load_settings' "$ROOT_DIR/packaging/linux/nfpm/postinstall.sh" || fail "postinstall does not load the settings file"
+grep -q 'beacon-settings.sh' "$ROOT_DIR/cli/beacon/.goreleaser.yaml" || fail "the packages do not ship beacon-settings.sh"
+
+# The environment wins over the file.
+run_install BEACON_DEFAULTS_FILE="$DEFAULTS" BEACON_LOG_ACCESS=restricted
+expect_log_access restricted "environment over defaults file"
+
++# Positional arguments are explicit too, so they win over the file; the file fills what they leave.
++printf 'BEACON_ENDPOINT_HARNESSES=claude\nBEACON_OTLP_GRPC_PORT=5317\nBEACON_OTLP_HTTP_PORT=5318\n' >"$DEFAULTS"
++INSTALL_ARGS='claude,codex,cursor 4417'
++run_install BEACON_DEFAULTS_FILE="$DEFAULTS"
++INSTALL_ARGS=''
++[ "$(flag_value --harness)" = "claude,codex,cursor" ] || fail "positional over defaults file: --harness is '$(flag_value --harness)'"
++[ "$(flag_value --otlp-grpc-port)" = "4417" ] || fail "positional over defaults file: --otlp-grpc-port is '$(flag_value --otlp-grpc-port)'"
++[ "$(flag_value --otlp-http-port)" = "5318" ] || fail "defaults file under positional: --otlp-http-port is '$(flag_value --otlp-http-port)'"
++# ...and the environment still wins over a positional argument, as before.
++INSTALL_ARGS='claude,codex,cursor'
++run_install BEACON_DEFAULTS_FILE="$DEFAULTS" BEACON_ENDPOINT_HARNESSES=codex
++INSTALL_ARGS=''
++[ "$(flag_value --harness)" = "codex" ] || fail "environment over positional: --harness is '$(flag_value --harness)'"
++
++# A key assigned twice takes its last value, as a shell would: configuration managers override a
++# setting by appending a line. The environment still wins over every one of them.
++printf 'BEACON_LOG_ACCESS=restricted\nBEACON_LOG_ACCESS=shared # appended\n' >"$DEFAULTS"
++run_install BEACON_DEFAULTS_FILE="$DEFAULTS"
++expect_log_access shared "defaults file key assigned twice"
++run_install BEACON_DEFAULTS_FILE="$DEFAULTS" BEACON_LOG_ACCESS=restricted
++expect_log_access restricted "environment over a key assigned twice"
++# A malformed later line is skipped, so the earlier value stands.
++printf 'BEACON_LOG_ACCESS=shared\nBEACON_LOG_ACCESS=restricted junk\n' >"$DEFAULTS"
++run_install BEACON_DEFAULTS_FILE="$DEFAULTS"
++expect_log_access shared "malformed later assignment"
++# A name that is not a plain identifier is ignored, and does not fail the install.
++printf 'BEACON_LOG_ACCESS BEACON_SESSION_SYNC=1\n' >"$DEFAULTS"
++run_install BEACON_DEFAULTS_FILE="$DEFAULTS" || fail "a key with a space failed the install"
++has_flag --session-sync && fail "a key with a space set BEACON_SESSION_SYNC"
++expect_log_access restricted "key with a space"
++
+# Without a mode, a defaults file still gets the first-install default.
+printf 'BEACON_SESSION_SYNC=0\n' >"$DEFAULTS"
+run_install BEACON_DEFAULTS_FILE="$DEFAULTS"
+expect_log_access restricted "defaults file without a mode"
+has_flag --no-session-sync || fail "defaults file: BEACON_SESSION_SYNC=0 did not pass --no-session-sync"
+
+# A file anyone else can write is ignored, loudly: the script runs as root.
+printf 'BEACON_LOG_ACCESS=shared\n' >"$DEFAULTS"
+for mode in 620 602 660 666 622; do
+ chmod "$mode" "$DEFAULTS"
+ run_install BEACON_DEFAULTS_FILE="$DEFAULTS"
+ expect_log_access restricted "defaults file mode $mode"
+ grep -q "ignoring $DEFAULTS" "$TMP_DIR/out" || fail "defaults file mode $mode: no warning"
+done
+chmod 644 "$DEFAULTS"
+run_install BEACON_DEFAULTS_FILE="$DEFAULTS"
+expect_log_access shared "defaults file mode 644"
+# ...and so is one owned by another account.
+run_install BEACON_DEFAULTS_FILE="$DEFAULTS" BEACON_DEFAULTS_OWNER=12345
+expect_log_access restricted "defaults file owned by someone else"
+
+if [ "$failures" -ne 0 ]; then
+ echo "$failures check(s) failed" >&2
+ exit 1
+fi
+echo "linux endpoint script checks passed"