Out-of-the-Box Kernel EDR & Autonomous Operations $0.00 Local Gemma 4 First • Free Attribution License

Sentinel Stack

An out-of-the-box Linux Kernel EDR, self-healing security daemon, off-box alerting engine, SFTP multi-root Website Sentinel, and local-first autonomous operations platform developed by Fritbjörn Labs. Combines real-time auditd + inotify kernel telemetry, Golden-Master config rollback, SSH brute-force defense, ClamAV & SMB/NFS share protection, a SHA-256 hash-chained forensic ledger, OpenCode v2.4.1, and $0.00 local Gemma 4 desktop hands with continuous Telegram channel visual monitoring and verbatim scheduled posting.

Modular Architecture

Five Integrated EDR, Alerting & Autonomous Agent Pillars

Healthy scans consume zero LLM tokens. Real-time kernel watchers and deterministic checks detect and heal threats immediately, dispatch off-box alerts on high/critical events, and run diagnostics and desktop automation locally on Ollama Gemma 4 at $0.00 before ever touching optional cloud fallback.

01 / KERNEL EDR

Real-Time Host Defense

auditd syscall rules (execve, persistence, kmod, ptrace) + pure-Python inotify, expanded FIM globs, SSH brute-force guard, ClamAV, UFW & sysctl.

02 / OFF-BOX ALERTS

Alerting & Ledger

Telegram, HMAC-SHA256 webhooks (Discord/Slack/SIEM), ntfy & RFC 5424 Remote Syslog (UDP/TCP/TLS), paired with a SHA-256 hash-chained forensic ledger.

03 / HYBRID TRIAGE

Hardened AI Advisor

Tier 1 local Ollama (gemma4-smart) with prompt-injection log framing, strict command safety validation, dot-path config updates & capped Gemini fallback.

04 / NAS & WEB

Share & Website Guard

SMB/NFS Network Share Sentinel + bundled SFTP-native multi-root website-sentinel-agent v3.2 (rssh compatible, SSH known_hosts pinning, 5-min user timer).

05 / HANDS & CLI

Gemma Hands & Telegram Admin

OpenCode v2.4.1 (brain, cloudbrain, webbrain), $0.00 local agent-hands (unlimited steps + hybrid auto) & built-in Telegram channel watcher/poster (hands-tg).

Capabilities

What Sentinel Stack Protects & Automates Out of the Box

Built around defense-in-depth defaults: manual daemon runs default to audit-only --dry-run, high-CPU kills require sustained multi-cycle streaks with protected-process guards, and AI advice requires explicit human approval plus command safety validation.

Kernel-Level EDR (auditd + inotify)

Deploys /etc/audit/rules.d/99-sentinel-edr.rules and a real-time inotify thread to catch millisecond-lived /tmp scripts, fileless memfd: executions, curl|sh cradles, kernel module loads, and ptrace injection.

Off-Box Alerting & Forensic Ledger

Ships severity-gated, deduplicated alerts to Telegram, HMAC-signed webhooks, ntfy, or RFC 5424 remote syslog, while recording every event in a tamper-evident SHA-256 hash-chained forensic_ledger.jsonl.

Expanded FIM & Golden-Master Vault

Watches core files plus persistence globs (sshd_config.d, sudoers.d, cron.d, systemd, authorized_keys, ld.so.preload), detects newly dropped persistence files, and auto-reverts tampering from 0600 vaulted baselines.

Hardened Containment & SSH Guard

Snapshots /proc forensics before terminating rogue temp/fileless processes (SIGTERM → SIGKILL escalation) with chmod 000 quarantine, refuses to kill critical desktop/session processes, and detects external SSH brute-force bursts.

ClamAV, Perimeter & SMB/NFS Sentinel

Combines clamdscan malware containment, UFW default-deny, interface/sysctl hardening, USBGuard auditing, and live SMB/NFS share scanning for suspicious extensions, permissions, and timestomped SHA-256 tampering.

Bundled SFTP Website Sentinel (v3.2)

Scans main domains and subdomains over SFTP without remote shell access (rssh friendly), enforces SSH known_hosts MITM checks and webroot containment, runs zero-token clean SHA-256 checks on a 5-min timer, and triggers Gemini only on changes.

Hardened Hybrid AI Advisor

Wraps untrusted logs inside prompt-injection delimiters, validates every remediation command against an allowlist and dangerous-binary blocklist before apply-advice, and keeps $0.00 Ollama primary with hard daily cloud caps.

Local-First Desktop Hands (agent-hands)

Runs vision-guided GUI + bash automation locally on Ollama Gemma 4 (gemma4-fast at $0.00) with unlimited steps by default, hybrid --provider auto fallback to gemini-3.1-flash-lite, xrandr primary-monitor ROI auto-detection, ImageGrab/scrot fallback, wait_seconds, bash approval gates, and stall guardrails.

Telegram Channel Admin & Visual Watcher

Monitors an open Telegram Desktop channel continuously using only the local Gemma 4 agent (hands-tg / --telegram-admin). Focuses Telegram via xdotool, keeps X11 awake, posts exact verbatim UTF-8/emoji/multi-line messages on repeating intervals (--tg-every) and/or 24h clock times (--tg-at), and wakes immediately on visual screen activity.

Evolution & Changelog

All Upgrades Shipped to Date

Sentinel Stack is upgraded incrementally and verified end-to-end with automated unit tests and 3-layer drift checks (Local Repo == Live System == Public Mirror) so every capability stays reliable in production.

Upgrade Component(s) What Was Added & Verified
Telegram Channel Admin & Visual Awareness
Latest
sentinel_modules/telegram_admin_tool.py, agent_hands.py, install.sh Promoted into a permanent Sentinel Stack module with the hands-tg alias and --telegram-admin / --tg-message / --tg-message-file / --tg-every / --tg-at / --tg-box flags. Continuously monitors an open Telegram Desktop channel using only local Ollama Gemma 4 ($0.00) or hybrid auto mode, wakes immediately on visible screen changes (telegram_watch_and_wait), focuses Telegram via xdotool, keeps display awake via xset, locks exact verbatim UTF-8/emoji/multi-line messages (never paraphrased), and blocks premature mission exits while a schedule is active.
Local-First Agent Hands Consolidation & Display Hardening agent_hands.py, opencode/tools/agent_hands.ts Switched agent-hands to default to $0.00 local Ollama (gemma4-fast) with unlimited steps (--max-steps 0) and three provider modes (ollama, auto local-first with automatic Gemini fallback on errors/stalls, and gemini locked to gemini-3.1-flash-lite). Added automatic primary-monitor ROI detection via xrandr (--monitor primary|all|index|name), ImageGrab + temp-dir scrot 1.10+ capture fallback, wait_seconds, bash/stall guardrails, and the native OpenCode agent_hands.ts tool bridge.
OpenCode v2.4.1 Aliases & 3-Layer Sync Pipeline scripts/sync-status.sh, release.sh, mirror_sftp.py, .agents/skills/ Updated shell aliases for OpenCode v2.4.1 (brain, cloudbrain, webbrain, hands, hands-ollama, hands-auto, hands-gemini, hands-tg). Added read-only 3-layer drift verification (sync-status.sh), resumable release orchestration (release.sh), pre-mirror secret/privacy scanning, atomic objects-first SFTP bare-repo mirroring (mirror_sftp.py), and a portable AI runbook skill (.agents/skills/sentinel-stack/SKILL.md).
v2.1 / v3.2 Security Hardening & Bundled Website Sentinel website-sentinel-agent/, self_healer.py, sentinel_modules/ Bundled the sanitized SFTP-native multi-root website-sentinel-agent (v3.1 → v3.2) with SSH known_hosts MITM protection, strict webroot path containment, zero-token clean SHA-256 baseline checks, and a 5-minute systemd --user timer. Hardened local containment with sustainability caps, protected system/desktop process kill guards (systemd, Xorg, gnome-shell), atomic 0600 writes, and non-destructive config upgrades in install.sh.
v2.0 Kernel EDR, Off-Box Alerting & Network Share Sentinel kernel_edr.py, alerting.py, ledger.py, network_sentinel.py, auditd/ Introduced out-of-the-box kernel syscall auditing (99-sentinel-edr.rules) + real-time pure-Python inotify watching, multi-channel off-box alerting (Telegram Bot API, HMAC-SHA256 webhooks, ntfy, RFC 5424 remote syslog), tamper-evident SHA-256 hash-chained forensic ledger, expanded FIM persistence globs, SSH brute-force detection, and SMB/NFS share integrity + ClamAV scanning.
System Requirements

Operating System & Hardware Sizing

Primary target is Ubuntu 24.04 LTS (compatible with Debian 12+ and Ubuntu 22.04+ on x86_64 or arm64 with Linux 6.x+ and systemd). Headless servers run all daemon/CLI features with no display; X11 desktop automation (agent-hands / hands-tg) optionally uses python3-tk, scrot, xclip, xdotool, and x11-xserver-utils.

Resource Minimum (Fast Local AI) Recommended (Full Hybrid Stack) Production / Multi-Purpose
CPU 4 cores (x86_64 or arm64) 4+ cores / 8+ threads 8+ cores / 16+ threads for concurrent scans & agent workloads
System RAM 8 GB (gemma4-fast only; installer skips e4b below 14 GB) 16–24 GB (clamd + gemma4-smart + gemma4-fast) 32 GB+ for 64k-context reasoning & multi-agent sessions
GPU / VRAM Optional (CPU-only Ollama supported) Entry GPU 2–4 GB VRAM (partial offload) or 8–12 GB VRAM (full offload) 12–24 GB VRAM (NVIDIA CUDA / AMD ROCm) for fast long-context inference
Disk Space 20 GB free SSD space 35–50 GB free SSD space (~11.2 GB Ollama models + ClamAV + vault) 100 GB+ SSD/NVMe for forensics, vault history & extra models
Quickstart & Daily Operations

Clone, Bootstrap & Deploy in Minutes

No cloud API key is required for local deterministic defense, local Ollama AI Advisor, local agent-hands, or local Telegram channel monitoring ($0.00 offline). Optionally add GEMINI_API_KEY to /etc/sentinel-healer/.env (mode 0600) for cloud fallback, hands-auto escalation, or Website Sentinel Gemini hunts.

1. Clone & Install

bash — Install Sentinel Stack
git clone https://fritbjornlabs.com/repos/sentinel-stack.git
cd sentinel-stack
./bootstrap.sh
sudo ./install.sh

bootstrap.sh installs Ollama, OpenCode CLI, and builds the gemma4-fast / gemma4-smart Modelfiles. install.sh deploys auditd rules, modular EDR & automation engines, agent-hands + shell aliases, initializes the Golden-Master baseline, and starts sentinel-healer.service.

2. Operator CLI, EDR & Alert Verification

bash — Daily Security Commands
# Health, Kernel EDR, off-box channels, ledger & AI usage ($0.00)
sudo sentinel-healer status
sudo sentinel-healer advice

# Verify off-box alerting & cryptographic forensic ledger
sudo sentinel-healer test-alert
sudo sentinel-healer verify-ledger

# Immediate one-shot audit (safe dry-run) & human-approved actions
sudo sentinel-healer scan
sudo sentinel-healer escalate <index>
sudo sentinel-healer apply-advice <index>

Add optional Telegram/Webhook/ntfy/Syslog keys or GEMINI_API_KEY in /etc/sentinel-healer/.env (mode 0600). Existing configs are preserved across upgrades via non-destructive migration.

3. Local Gemma Hands & Telegram Channel Admin

bash — Desktop Automation & Channel Monitoring
# OpenCode v2.4.1 console (local Gemma 4 / cloud / web pair)
brain            # Local Ollama gemma4-fast ($0.00)
cloudbrain       # Gemini Flash-Lite Latest
webbrain         # One-time browser pairing link (opencode pair)

# Local-first desktop hands ($0.00, unlimited steps)
hands            # Local Ollama gemma4-fast
hands-auto       # Local Ollama first, auto-escalates to Gemini if stuck

# Built-in Telegram channel monitor & verbatim scheduled poster ($0.00)
hands-tg         # Interactive setup wizard
agent-hands --provider ollama --tg-message "Channel update!" --tg-every 30m --tg-at 09:00,21:00

Slam the mouse cursor into any screen corner or press Ctrl+C to abort immediately. Primary monitor ROI is auto-detected via xrandr (override with --monitor or ROI_X/Y/W/H).

4. Automated Tests & 3-Layer Sync

bash — Test, Verify & Release Pipeline
# Run the full automated unit & guardrail test suite
./scripts/release.sh --test-only

# Read-only 3-layer drift check (Repo vs Live PC vs Public Mirror)
./scripts/sync-status.sh

# Full resumable release (tests -> privacy check -> install -> SFTP mirror)
./scripts/release.sh

Every step in release.sh is idempotent and resumable (--install-only, --mirror-only, --dry-run), with automatic pre-mirror privacy hygiene checks blocking accidental secrets.

Extensibility Roadmap

Built to Expand Incrementally & Reliably

Each capability is added one step at a time and validated in real operation before expanding to the next layer:

Multi-Host / Mesh Fleet Defense

Tailscale/LAN-aware node supervision with machine-readable --json telemetry and HMAC-signed webhooks for centralized fleet dashboards and SIEM correlation.

Pluggable Local Agent Workflows

Building on the local Gemma 4 Telegram channel watcher and OpenCode tool bridge to add specialized diagnostic skills, forensic log hunters, and supervised desktop routines.

Policy-as-Code & Container Guards

CIS Linux benchmark drift auditing, Docker/container runtime escape monitoring, and automated threat-intelligence feed enrichment.

Open-Source Disclosure & Free Attribution License

Sentinel Stack is 100% open source and free to use, audit, modify, and deploy on personal or production servers — simply keep the license notice and credit Fritbjörn Labs (https://fritbjornlabs.com) as the source.