Commit graph

7 commits

Author SHA1 Message Date
trvon
70652b5fb0
Review fixes #4/#5: ptrace medium middle-ground + reject fleet-train flags elsewhere
All checks were successful
release / draft (push) Has been skipped
release / build (debian:trixie, trixie) (push) Successful in 55m51s
release / build (ubuntu:24.04, noble) (push) Successful in 51m11s
release / publish (push) Has been skipped
#4 (guard retention): same-binary parent/child self-ptrace never rates "high"
(it's self-debugging, not injection), but from a drop location (/tmp) it now
stays "medium" rather than "low" -- a same-binary anti-debug/injection staged in
/tmp still surfaces, while sanitizer builds no longer flood high-severity
PtraceAttach. Injection into another program is unchanged.

#5 (CLI-UX contract): --max-node-share/--test-fraction/--split now error when
passed to any command other than 'fleet train' instead of being silently
ignored (noun-verb commands already reject unknown options; this covers the
flag-form and other fleet subcommands).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-10 16:17:01 -07:00
trvon
7f3cbeca71
Detection quality: self-ptrace of the same binary stays low even from /tmp
All checks were successful
release / draft (push) Successful in 19s
release / build (debian:trixie, trixie) (push) Successful in 58m7s
release / build (ubuntu:24.04, noble) (push) Successful in 58m54s
release / publish (push) Successful in 14s
A parent/child of the SAME binary tracing each other is self-debugging
(sanitizers' StopTheWorld, crash handlers), not injection. The code already
scored that `low`, but `suspicious_image` (which flags drop locations like /tmp)
took precedence and forced `high` -- so sanitizer test binaries built in /tmp
flooded findings as high-severity PtraceAttach (observed live: ~160 FPs on
/tmp/toolcheck-*/*_san). Reorder so the strong structural self-debug signal beats
the weak location heuristic: same-program-family -> low regardless of location;
ptrace into ANOTHER program stays high (suspicious image) or medium. Injection
detection is unchanged. Test added for the /tmp self-ptrace case.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-09 08:06:36 -07:00
trvon
be237d6040
Findings: reconcile evidence and harden policy rebuilds
Preserve independent support, typed rule namespaces and stable process lifetimes. Share authoritative managed-set reconciliation across daemon and offline correlation, load offline policy without seeding/migration, and release resources after shutdown-flush exceptions. Keep retirement history, transaction ownership and fault/allocation regressions; no whole-set crash-atomicity or live acceptance claim.
2026-11-03 06:55:47 -07:00
trvon
abe945097e
Monitor execs and file writes on macOS with Endpoint Security
New meson option enable_endpoint_security (auto, macOS only) links
EndpointSecurity and bsm and builds three ES backends behind the
existing interfaces. Helpers are in src/platform/es_support.hpp.

- ProcessMonitor: NOTIFY_EXEC events (pid, parent, path, dev:ino,
  argv, start time) plus NOTIFY_TRACE and NOTIFY_KEXTLOAD for the
  behavior rules. Events go to a bounded queue (4096, overflow counted
  in events_dropped) drained on the monitor thread, so callbacks stay
  on one thread. Without an ES client the monitor polls libproc
  (backend "libproc"). backend_name() reports "endpoint_security".
- ExecGuard: AUTH_EXEC with the fanotify guard's rules. It fails open
  at min(timeout, ES deadline - 500 ms) and on a full queue, and on
  macOS 27+ ES_DEADLINE_MISS_MODE_FAIL_OPEN makes the kernel allow a
  missed deadline too. Platform binaries and SIP paths are never
  denied, and our own execs are muted. ES does not cache verdicts, so
  rule changes apply on the next exec. Our own cache keys on
  dev:ino:size:mtime:generation. The image is opened by path and its
  dev:ino checked against the event; a swapped file counts as
  unscanned.
- FileWatcher: NOTIFY_CREATE/RENAME/CLOSE(modified) with inverted
  target-path muting: named entries selected literally, whole
  directories by prefix. macos_watch_specs() covers launchd
  agents/daemons, periodic jobs, cron tabs, sudo drop-ins, shell rc
  files, authorized_keys, Downloads and the temp directories.
  match_watch_spec() (direct children, as with fanotify directory
  marks) is portable and tested. Home dirs come from the directory
  service (local_home_dirs).

Every ES handler is noexcept and records swallowed exceptions. Client
errors name the missing requirement (root, entitlement, Full Disk
Access), and the daemon keeps running detection-only.

macos_es_live (root, ES entitlement) checks deny/allow/cache/
platform-binary/fail-open/audit for the guard, exec telemetry and
the file watcher, using small signed payload binaries. It has not run
yet: the development Mac has SIP enabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:55:21 -06:00
trvon
9b937119c8
Record routine indicators as evidence only
Some checks failed
Build and Test / build (debug, clang) (push) Has been cancelled
Build and Test / build (debug, gcc) (push) Has been cancelled
Build and Test / build (release, clang) (push) Has been cancelled
Build and Test / build (release, gcc) (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
Per the triage decisions:
- DeletedExecutable when a new file exists at the executable's path (an
  update or reinstall) is stored as evidence only. A binary with nothing
  left at its path still raises a low finding.
- scripts/install.sh writes /var/lib/strawberry/installed-files.sha256
  (hashes of the units it installs, root-owned, written first). A
  PersistenceWrite whose file matches its listed hash is evidence only;
  other content at those paths, or a suspicious writer, is reported as
  before. The daemon ignores a manifest that is not root-owned or is
  group/world-writable.

Evidence-only indicators make no finding, alert or containment on their
own; correlation counts them when the same process has another signal.
Status reports pipeline.evidence_only. Tests cover the manifest, the
behavior hook, correlation and the pipeline (replaced vs deleted).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 05:37:58 -06:00
trvon
97e21ee81b
Triage findings and cut routine false positives
Triage of all 26 findings on a developer workstation (none malicious)
is in docs/false-positives.md: binaries replaced while running
(auto-updates, reinstalls), Strawberry's own installer writing its
systemd units, sanitizer/self-debugging ptrace, deliberate tests, and
the test marker matching process memory.

Fixes:
- behavior detections now honor path and rule allowlist entries (they
  only checked sha256, which is computed for high severity only)
- finding summaries include what happened (file written, ptrace
  target) and metadata.details
- Strawberry_Test_Marker only matches files that start with the marker
  (EICAR-style); it no longer fires on processes holding the text
- ptrace between a parent and child running the same binary
  (LeakSanitizer StopTheWorld) is low instead of medium; ProcessRef
  carries the parent pid

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 20:56:35 -06:00
trvon
1d1ab9f57e
Add exec prevention, behavior telemetry and persistence watch
fanotify exec-permission guard (audit/enforce, fail-open deadline),
eBPF behavior engine (IOC connections, ptrace, module loads,
download-then-execute) and fanotify persistence watch, with unit tests
and privileged Docker live tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:17:16 -06:00