Commit graph

33 commits

Author SHA1 Message Date
trvon
09e6b441ae
Audit flow: add the clang static analyzer as a strict per-change gate
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 / macos (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
- scripts/analyze_changed.sh + `make analyze`: clang-check --analyze over the
  changed TUs via builddir/compile_commands.json (host build may be gcc; clang
  tolerates those flags), nice -n 19, 2 at a time. Strict by default (any
  analyzer diagnostic fails), ANALYZE_STRICT=0 reports only; ANALYZE_FILES/--all
  override selection. Results in build/audit/out/analyze.log.
- AGENTS.md "Per-change checks": new analyzer row, positioned as path-sensitive
  intra-TU analysis that complements fold's bounded symbolic cross-call pass and
  the syntactic invariants (run all three); YAMS index-at-checkpoint reminder.
- CLAUDE.md: analyzer added to the checks pointer + a Performance & C++ bullet
  (perf-kpi + Tracy/PerfStats).
- docs/prompts/PROMPT-strawberry-audit.md: "Clang static analyzer" subsection
  under Symbolic SAST.

No C++ changed; unit suite 50/50 green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-28 09:55:03 -06:00
trvon
edb774acd6
Rewrite the README around install and usage
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 / macos (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
Install (Linux, macOS, ES requirements, installed files), usage with
the current CLI, then features with per-OS notes and a backend table.
Drops the dated status log and the duplicate feature list. MCP
registration for Claude Code, Codex and pi (README and
strawberry-mcp --help). CI and README use Homebrew's openssl (now
openssl@4). AGENTS/DEVELOPER: install facts and platform map rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 04:39:57 -06:00
trvon
324d5f4865
Add a macOS CI job and document the port
The macos job (macos-15, Homebrew deps, Qt app skipped) builds and
runs meson test. It only runs on GitHub: Forgejo also reads
.github/workflows and has no macOS runner.

README: macOS build, the Linux to macOS backend map, ES requirements
and installed files. API_CONTRACT: macOS socket path and peer
credentials, the endpoint_security and libproc backend values, and
the macOS status fields. DEVELOPER: platform map and the GitHub +
Forgejo remotes. AGENTS: current state of the port, including that
the ES backends have not run live yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:55:22 -06:00
trvon
bf1e779706
CLI: safe terminal output, completions, no accidental daemons; UX guide
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
- Evidence strings are attacker-controlled: every CLI command's stdout
  and stderr now pass through a filter that shows control characters
  (C0, DEL, C1) and invalid UTF-8 as \xNN (src/term_safe.hpp), so a
  crafted process name or path cannot inject terminal escape sequences.
  The daemon's journal output is unchanged.
- `strawberry` alone prints help; an unknown word (`strawberry fix`) is an
  error with a "did you mean" hint. Both used to start a daemon as the
  calling user with the word as its config path. Config paths (contain
  '/' or end in .conf) still run the daemon, for older units.
- Shell completions generated from the command table: `strawberry
  completion bash|zsh|fish`; install.sh installs them under
  /usr/local/share.
- One correlation pass at daemon start (stored findings catch up with the
  current rules, e.g. stable ids), and retire-superseded-findings
  correlates first, so replacements exist before old copies are retired.
  The user's first run reported "no duplicates" for that reason.
- docs/cli-ux.md: CLI UX rules adapted from yams (grammar, flags, human
  and JSON output, status words, security rules for output, help and
  completions, adding a command, known gaps). Exit code 3 and
  confirmation prompts are proposed there, pending a decision. AGENTS.md
  and CLAUDE.md point to it.

tests/test_cli.cpp: bare and unknown words, terminal_safe and the stream
filter, completion scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:41:19 -06:00
trvon
fb6b905860
CLI: yams-style commands, with doctor and doctor fix
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
strawberry [--config PATH] [--json] <command> [<subcommand>] [args] [--flags]

status, doctor, doctor fix <action>, daemon run, findings list/show/
correlate, process search/trace/trace-node/suspend/resume/kill, scan
file/processes/memory, rules reload/update/check/fetch, policy show/set,
opensnitch enable-checksums, store verify/compact, replay, demo seed,
help [command], version.

One table in src/cli_commands.cpp defines each command (words,
positionals, flags, help) and how it maps onto the existing flag form,
which main() still parses; help is generated from the same table.
Unknown options and wrong arity print the command's usage. Process
actions validate node ids before building their JSON payload.

The older flag form (strawberry --status, strawberry <config>) still
works. The systemd units now run `strawberry daemon run --config ...` and
`strawberry rules fetch --config ...`. README, AGENTS.md and the
false-positive guide use the command form.

doctor renders the daemon's checks with their fixes; doctor fix runs a
maintenance action (with --dry-run). Against an older daemon the CLI says
to reinstall rather than "unknown command". replay explains that
telemetry is root-only instead of reporting zeros, and keeps config
output out of --json.

tests/test_cli.cpp: translations, flag-form passthrough, errors, help.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:32:02 -06:00
trvon
648457802a
Forbid empty catch blocks
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
Every catch now handles the exception or records it with
STRAWBERRY_NOTE_SWALLOWED() (strawberry/swallowed.hpp): an atomic count,
exported in status as resources.swallowed_exceptions, plus a file:line
log line written with write(2), so it is safe out of memory and in
destructors. The 16 empty catches (store error fallbacks, destructors,
YARA compiler callback, thread entry logging) now use it. Status also
reports thread_errors, which was counted but never exported.

Enforced by source invariant R7 (with a self-test fixture) and by
clang-tidy bugprone-empty-catch in a new .clang-tidy (errors; inherits
parent config). AGENTS.md and CLAUDE.md state the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:52:45 -06:00
trvon
dc50f06f8d
Drop unqlite-cpp and import legacy databases
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
Nothing shipped used the library after the event store landed. A small
reader/writer for its file format (src/store/legacy_kv) replaces it for
the legacy code, and the submodule, subproject and library test are
removed.

A writer open now imports a legacy database.db file into the event
store: indicators are replayed in an order consistent with the old
hash/rule indexes, the result is verified against the old file, the
old file is kept as database.db.migrated-<ts>, and an import
interrupted between its final renames is finished on the next open.
Read-only handles read a legacy file directly and switch to the store
once it is imported. Ids re-stored under another hash are reported
(their old index entries cannot be carried over).

Tests: legacy import properties I1-I6 (locked and corrupt files are
left untouched), the differential test now shares its comparisons, and
fuzz_legacy_kv covers the file parser. A copy of a real 137 KB legacy
database imported cleanly into 7 KB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:46:21 -06:00
trvon
ad1676a594
Integrate features into the daemon, build and docs
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
Wire the policy, feeds, containment, exec guard, behavior, governor,
crash safety and event store into the daemon, detection pipeline, CLI
and meson build (zstd now required); Dockerfile, conan, systemd unit
(LimitCORE=0, resource limits) and installer updates; existing tests
adapted (store paths are directories now). Detections are counted and
notified even when evidence cannot be persisted (persist_failures in
status). prevention_timeout_ms is clamped and behavior dedupe handles
out-of-order events. Docs: API contract, developer guide, plan, UX,
agent rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:17:30 -06:00
trvon
577404a39b Prioritize process inventory collection 2026-04-27 19:48:20 -04:00
trvon
158050f3ea Document web deployment modes 2026-04-27 19:30:34 -04:00
trvon
886fa6ff82 Add web API contract test 2026-04-27 19:26:05 -04:00
trvon
1527787888 Wire process detail panel 2026-04-27 18:46:41 -04:00
trvon
6b337ccdd6 Add process detail API 2026-04-27 17:27:36 -04:00
trvon
4e055d771f Document web API contract 2026-04-27 16:58:11 -04:00
trvon
09ccf940db Plan C++ web API service 2026-04-27 16:51:31 -04:00
trvon
745c2c36f9 Define web UI bind boundary 2026-04-27 14:19:38 -04:00
trvon
82ae08a4bb Set web-first UX direction 2026-04-27 12:18:13 -04:00
trvon
4eebafc5d9 Structure process detail cards 2026-04-27 10:23:26 -04:00
trvon
7c1090d2ba Add same-rule correlation 2026-04-27 10:02:50 -04:00
trvon
ac412527a1 Add UI export actions 2026-04-27 09:09:15 -04:00
trvon
4a2615c3ca Format trace timestamps 2026-04-26 21:28:23 -04:00
trvon
73cfcfad0c Add UI triage controls 2026-04-26 21:13:45 -04:00
trvon
38d52c0c04 Enrich process detail cards 2026-04-26 21:06:17 -04:00
trvon
ade488d0cf Add trace timing summaries 2026-04-26 20:15:35 -04:00
trvon
5ac2d6a3d1 Add same-hash process correlation 2026-04-26 20:03:30 -04:00
trvon
c9e8dceb4d Add finding process pivots 2026-04-26 19:32:45 -04:00
trvon
94e95decea Add process search seen timestamps 2026-04-26 18:46:08 -04:00
trvon
1b7aded961 Enrich process search pivots 2026-04-26 17:41:57 -04:00
trvon
f68d851b6c Add process search query surface 2026-04-26 17:24:27 -04:00
trvon
f40eaa4692 Add lineage correlation and JSON findings 2026-04-26 17:07:10 -04:00
trvon
796ef8f9fe Add first correlation engine 2026-04-26 16:57:40 -04:00
trvon
eb93827b74 Plan correlation engine and analyst UX 2026-04-26 16:37:36 -04:00
trvon
22a653f617 Implement runtime pipeline, reporting, and local UI 2026-04-26 16:31:01 -04:00