Commit graph

57 commits

Author SHA1 Message Date
Luna
8194d13734 Expand TUI guidance and host detection coverage 2026-07-09 19:16:27 -07:00
Luna
3b037646d2 Add typed host event egress rule 2026-07-09 06:04:30 -07:00
Luna
0b010df514
Add audited response apply rehearsal 2026-07-09 05:56:25 -07:00
Luna
51d52b5229
Expand TUI and package recovery planning 2026-07-09 05:51:59 -07:00
Luna
cab60cd633 Add terminal TUI and shell completion 2026-07-08 20:47:58 -07:00
Luna
a7535cfc56 Add rule event compatibility tests 2026-07-08 17:09:00 -07:00
Luna
66472134d8 Add enrichment and SID coverage gates 2026-07-08 17:05:17 -07:00
Luna
93ac47dd82 Harden BCC syscall probe attachment 2026-07-08 17:04:45 -07:00
Luna
2d23e8b878 Record tray applet completion and SID coverage design draft
Update the CLAUDE.md snapshot and roadmap for the merged tray applet,
note the shared-checkout commit hygiene rule, and save the agreed
SID drill coverage design as a draft spec.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 06:37:07 -07:00
Luna
afbc63ffbd Merge branch 'main' of https://codeberg.org/anassaeneroi/enodia-sentinal 2026-07-03 16:47:44 -07:00
Luna
036469ed21 Document the desktop tray applet and check --json
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 07:40:06 -07:00
Luna
a5e954e0ed Add opt-in autostart desktop entry for the tray applet
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 07:38:23 -07:00
Luna
1451cf7d58 Add pystray tray applet wiring and [tray] extra
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 07:37:39 -07:00
Luna
2fce7d412a Add tray desktop notification helper
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 07:35:59 -07:00
Luna
a57cf4a16f Test open_dashboard early-return when web start fails
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 15:24:25 -07:00
Luna
4545b2b5a2 Add tray action layer over CLI and systemctl
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 06:05:48 -07:00
Luna
715db9ec36 Add tray status model
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 06:01:53 -07:00
Luna
826daa3ab7 Add --json output to the check command
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 05:58:57 -07:00
Luna
5e560f4307 Add tray applet implementation plan
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 05:49:06 -07:00
Luna
2e7bf8b248 Add tray applet design spec
Optional desktop system-tray applet as a thin launcher over the existing
CLI and systemd. Core agent stays stdlib-only; tray ships as an optional
[tray] extra (pystray + Pillow). Covers menu actions, icon state, error
handling, packaging, and testing seams.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 05:12:16 -07:00
Luna
a985024cad Trigger mirror sync 20260629 2026-06-29 11:20:03 -07:00
Luna
6a9e94c9fa Make release-artifacts dirty assertion track real git state
test_release_script_generates_checksummed_artifacts hard-coded
`dirty == 1`, which only held while the worktree happened to be dirty. The
script derives `dirty` from actual git state and RELEASE_ALLOW_DIRTY is a
permission flag, not a forced value — so the test failed the moment the tree
was clean (all work committed). Compute the expected dirty flag the same way
the script does so the test is deterministic on both clean and dirty trees.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 10:47:31 -07:00
Luna
9cbdb989ac Surface reconciliation in the dashboard and keep the view read-only
Two gaps in the baseline-reconciliation feature:

- The dashboard claimed to summarise acknowledged drift, but renderIntegrity()
  never rendered it. Add a `recon` chip to the integrity summary and a
  Reconciliation state-card (accepted/ok/stale counts plus stale items).
- A read-only GET /api/integrity could write the store: list() flushed a
  TTL-lapsed ok->stale transition to disk, violating the read-only dashboard
  invariant. Add list(persist=False) and use it from the web summary path so
  staleness is evaluated in memory without touching the file.

Covered by a new test asserting integrity_report() never rewrites the store.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 10:39:15 -07:00
Luna
dbbe35b3fc Add baseline reconciliation: accept audited drift with a reason
Implements the v0.9 roadmap item from the approved design spec. Operators
accept a specific FIM/package/listener/SUID drift item with a mandatory
reason; the ack suppresses that one alert only while the live state still
matches the recorded fingerprint. Content kinds (fim/pkgfile) re-alert on
further change; identity kinds (listener/suid) retire on TTL or revoke.

- reconcile.py: ReconcileStore (mtime-cached, fails closed on missing/corrupt
  store), fingerprint builders, and the filter_alerts chokepoint.
- CLI: baseline accept/revoke/list with --reason/--expires/--force/--stale/--json.
- Wired at the daemon sweep + eBPF chokepoint, fim-check, and /api/integrity.
- RECONCILE_V1 schema, config knob, COMMAND_REFERENCE/SCHEMAS/OPERATIONS/ROADMAP
  docs, and reconcile unit/CLI/integration tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 10:33:55 -07:00
Luna
3d2047fde2 Add baseline reconciliation design spec
Covers the v0.9 roadmap item: accept legitimate FIM/package/listener/SUID
drift with a mandatory reason and audited fingerprint-bound ack store.
Approach A selected: ReconcileStore with re-alert-on-fingerprint-change,
optional TTL, and stale tracking. Filter applied at daemon chokepoint,
CLI fim check, and dashboard API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 03:49:59 -07:00
Luna
69798b26e4 Add systemd unit posture checks
Close the remaining v0.8 posture bullet: flag enabled systemd units with
group/world-writable unit files (systemd_unit_writable, sid 100050) and
units whose ExecStart binary runs from a writable/unsafe path such as
/tmp, /dev/shm, /var/tmp, /home, or /run/user (systemd_exec_unsafe_path,
sid 100051).

- posture.systemd_findings/parse_systemctl_show/read_systemd_units, wired
  into posture.run() behind the new posture_systemd config knob.
- read_systemd_units shells out to systemctl with timeouts and fails closed
  on non-systemd hosts; the dashboard /api/posture surfaces findings for free.
- Unit tests for the parser and evaluator; TestRunIntegration patches the
  new reader so run() never touches live systemctl.
- Docs: COMMAND_REFERENCE posture list, ROADMAP v0.8 bullet, RUNBOOKS
  Runbook 2 triggers, config TOML knob.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 02:27:19 -07:00
Luna
11d91a40b4 Add dashboard integrity/watchdog console
Surface integrity and watchdog state in the read-only dashboard via a new
/api/integrity endpoint and integrity_report(): watchdog/heartbeat
verdict, FIM baseline and package-DB anchor freshness, pacman keyring and
SigLevel posture, and Sentinel's own self-integrity footprint. The
endpoint summarizes existing anchors and heartbeats only — it runs no live
FIM or package verification from the request path, keeping the dashboard
read-only.

Add the enodia.integrity.v1 schema (schemas.py + docs/SCHEMAS.md) with a
contract test, a new "Integrity" dashboard tab and summary metric, and
web tests for the report shape, schema contract, endpoint, and console
wiring. Docs updated; completes the v1.0 "dashboard to local console"
roadmap item.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 17:39:53 -07:00
Luna
e0e5cd62d9 Document packaging and release artifacts 2026-06-17 00:22:43 -07:00
Luna
aee984d862 Version documentation index and contracts 2026-06-16 04:14:26 -07:00
Luna
7a176ea238 Add stable v1 schema IDs and docs 2026-06-16 04:05:12 -07:00
Luna
bfef23fc4a Add dashboard theme settings and contrast tests 2026-06-16 02:29:45 -07:00
Luna
7f4d5b42fd Generate event rule documentation 2026-06-15 18:52:28 -07:00
Luna
e43d7689a0 Add dashboard rule atlas 2026-06-15 16:37:51 -07:00
Luna
5db88d285e Add event rule inspection commands 2026-06-15 05:36:58 -07:00
Luna
1f05923e0f Document current Sentinel project state 2026-06-13 06:46:33 -07:00
Luna
6a09fbb7f9 Frame Sentinel as IDS IPS and EDR 2026-06-13 05:59:03 -07:00
Luna
1a5b6f1d8d Persist dry-run response plans 2026-06-13 05:53:48 -07:00
Luna
812cf0c836 Describe Sentinel as endpoint detection and response 2026-06-13 05:49:34 -07:00
Luna
a51478fa22 Add event-driven memory syscall telemetry 2026-06-13 05:45:30 -07:00
Luna
893409b549 Add memory obfuscation and ps-hidden process detection 2026-06-13 03:55:09 -07:00
Luna
cb334c0c94 Expand monitoring for credential theft and covert protocols 2026-06-13 03:30:36 -07:00
Luna
3e5f8fc3f7 Expand rootkit monitoring and Claude docs 2026-06-12 04:57:11 -07:00
Luna
a7129e5666 Add HTTPS management console and response planning 2026-06-12 02:39:53 -07:00
Luna
a56d72edd6 Add incident grouping (roadmap v0.8: incident list/show/export)
Collapse related alerts into one incident, process-lineage first with a
time-window fallback. Each alert batch's flagged PIDs are walked up the
/proc PPid chain into a lineage set (excluding pid 0/1 so everything
doesn't correlate through init); batches whose lineage sets intersect —
sharing a process or a common ancestor like the web server or SSH
session — join the same incident. PID-less batches (FIM drift, package
tamper, hidden modules) fall back to the most recently active open
incident within incident_window.

snapshot.capture now computes lineage and records each snapshot into a
JSON incident index (incidents.json), writing incident_id into both the
report JSON (report level, so the per-alert schema is untouched) and the
text header. New commands:

  incident list              incidents newest-first, with signatures
  incident show <id>         summary + time-ordered snapshot timeline
  incident export <id>       JSON bundle: record + inlined snapshots

The lineage/assign cores are pure functions; record() serializes the
index under a lock (capture runs from sweep + eBPF threads) and is
best-effort so an index problem never loses a snapshot. 17 new tests
(lineage, assign, record, and an end-to-end capture→group→CLI path).
Config: incident_tracking / incident_window / incident_lineage_depth.
Docs + sample config updated; closes the last v0.8 roadmap item.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 17:52:42 -07:00
Luna
4015ec872b Add egress drill + sid-verified harness and IR runbooks (roadmap v0.8)
Red-team harness: every detector now has a named drill with an expected
signature/sid, shown by `sentinel-redteam --list`. Add the missing
`egress` drill (the one detector without one) — explicit-only, since it
is the sole drill that emits real outbound traffic. After firing, the
harness runs `enodia-sentinel check` and reports PASS/MISS per poll
detection, turning it into a shared regression check.

Add docs/RUNBOOKS.md: confirm/preserve/contain/recover playbooks for
reverse shells & egress, persistence, trojaned binaries / package
tampering, hidden listeners & rootkits, and sensor tampering — each tied
to the real signatures, sids, and commands. Linked from README and the
OPERATIONS alert workflow.

Both close the remaining smaller v0.8 roadmap items.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 05:28:53 -07:00
Luna
f2d896a2d7 Add status command (roadmap v0.8: status --json)
Add `enodia-sentinel status [--json]` — a local health and alert
summary: daemon running state, heartbeat freshness, per-severity alert
counts, last alert time, and eBPF state. Reuses web.daemon_status (the
same data behind /api/status), so the CLI and dashboard never diverge.

Exit code reflects health (0 = running and fresh, 1 = down or stale), so
it doubles as a cron/monitoring probe. Three CLI tests drive it against a
temp log_dir; no daemon or root needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 05:17:29 -07:00
Luna
9ebc355936 Add host posture checks (roadmap v0.8: posture check)
Add `enodia-sentinel posture check` — a config-hygiene audit that finds
the conditions making a host easy to attack, complementing the live
detectors. Checks: SSH root/password/empty-password login (Include-aware,
first-wins sshd resolution), passwordless and group/world-writable
sudoers, world-writable or non-root PATH directories, loose permissions
on sensitive files (/etc/shadow, /etc/passwd, ...), and downgraded
package-signature policy (reusing pkgdb.siglevel_alert).

Findings reuse the Alert type, so they serialize through the existing
JSON/triage pipeline (`posture check --json`). Each check is a pure
evaluator over injected content/stat facts plus a thin system reader, so
the 18 new tests need no root or live /etc. Posture is command-driven and
never runs in the daemon loop, per the v0.8 exit criterion.

SIDs 100040-100047 (classtype host-posture). Sample config and docs
(COMMAND_REFERENCE, OPERATIONS, ROADMAP, SPECIFICATION) updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 05:15:06 -07:00
Luna
6ff2087329 Add platform docs; reposition as host security platform
Add docs/ (SPECIFICATION, ROADMAP, OPERATIONS, COMMAND_REFERENCE,
THREAT_MODEL) describing the current v0.7 agent and the phased path from
local HIDS to a host security platform. Reframe README, package metadata,
and CLI/module descriptions from "intrusion-detection daemon" to "Linux
host security platform", and surface the v0.7 signed-package verify
(pkgdb_pkgverify*) and anti-rootkit (rootcheck_*) knobs in the sample
config. Also wrap the pacman.conf read in pkgdb.siglevel_alert in a
context manager to avoid a leaked file handle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 04:03:06 -07:00
Luna
1de5e86fed Add signed-package verification and anti-rootkit cross-view (v0.7)
Closes the tamper-evidence loop with two trust anchors the attacker can't
forge from userland:

- pkgdb Layer 2: verify on-disk files against the .MTREE in the *signed*
  cache package, surviving a rewritten local checksum DB. Rotating-sample
  cadence keeps it affordable; flags pkg_signature_mismatch (sid 100027)
  and SigLevel downgrades (sid 100026). Fixes parse_mtree, which required
  type=file on every line and so matched nothing on real pacman MTREEs
  (which use a /set type=file default with bare file entries).
- rootcheck: anti-rootkit cross-view — hidden processes, modules, ports,
  and promiscuous interfaces, each caught by diffing two views of the
  same state (sids 100022-100025).

Wired both through config, the daemon (off-loop slow cadence), and CLI
(pkgdb-verify, rootcheck). 14 new tests (95 total). Docs + version bump.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 05:42:57 -07:00
Luna
34bc09041a Add tamper-evidence: package-DB integrity, self-integrity, dead-man's switch
Answers two hard questions: "what guards the hashes FIM trusts?" and "how do we
make the sensor itself hard to silently disable?" — within the honest limit that
a root attacker who shares your privileges can't be fully stopped on-box, only
made loud.

- pkgdb.py: guards the package DB that `pacman -Qkk` trusts. Anchors a
  fingerprint of /var/lib/pacman/local (refreshed ONLY by the pacman hook) and
  cross-checks pacman.log; a DB change with no logged transaction is flagged
  pkgdb_tamper (CRITICAL, sid 100021) — catches an attacker rewriting a stored
  checksum to mask a modified binary. Verified end-to-end against a simulated
  hash-overwrite.
- selfprotect.py: Sentinel's own binaries/config/units/hook are always in the
  FIM watch set (self-integrity); a heartbeat is written each loop; an external
  `watchdog` command polls a remote dashboard and pushes if the sensor goes
  silent or unreachable — silence becomes the alarm.
- daemon: heartbeat + slow-cadence pkgdb check; DB anchor re-anchored in
  build_fim_baseline so the pacman hook refreshes it after each transaction
- web: /api/status now reports heartbeat_age/stale; dashboard shows it
- cli: pkgdb-check, watchdog (--url/--token/--max-age, bypasses min-severity)
- config: pkgdb_verify/_interval, heartbeat_max_age
- README: threat model (trust-anchor problem) + hardening layers (immutability,
  signed-package + external anchor); reframes "anti-rootkit" as tamper-evidence
- tests: +8 (DB fingerprint, anchor/transaction logic, pacman.log parse,
  heartbeat + watchdog verdicts). 80/80 pass

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 22:27:50 -07:00