avwatch

File integrity monitoring + YARA-lite scan + event-driven file routing

v1.2.4
NixOS x86_64

Quick Start

Install via jcli (recommended)

jcli install avwatch

Baseline then check

avwatch baseline --path /etc --name etc-baseline       # snapshot every file
# ... time passes, an attacker tampers a file ...
avwatch check --name etc-baseline                       # diff vs the baseline
avwatch scan --path /var/www                            # YARA-lite signature scan

What it does

avwatch is a tiny offline file-integrity-monitoring (FIM) and signature-scan CLI. baseline records a SHA-256 + size + mtime + mode for every file under a path. check re-walks and emits a finding for every new / modified / deleted / permission-changed file. scan searches file bytes against a small embedded YARA-lite ruleset (EICAR, PHP webshells, reverse-shell patterns). Designed for hardened / airgapped systems where a full AV stack is impractical.

Subcommands

CommandStatusWhat it does
baseline --path <P> [--name <N>]workingBuild a SHA-256 baseline of every file under --path
check --name <N>workingRe-walk and diff: check.new / check.modified / check.deleted / check.perm_changed
scan --path <P>workingYARA-lite signature scan
watch --path <P>stubContinuous inotify-backed watcher (needs notify crate)

Diff severities

FindingSeverityWhen
check.modifiedHighSHA-256 changed — the content was tampered
check.newMediumA file appeared that wasn't in the baseline
check.deletedMediumA baselined file is gone
check.perm_changedLowSame content, different mode (e.g. chmod 777)

On-disk layout

~/.avwatch/baselines/<name>.db    # SQLite DB, chmod 600
~/.avwatch/signatures.toml         # operator pluggable signatures (stub)

The AVWATCH_HOME env var overrides the default — tests sandbox it with a tempdir; the live deploy reads from the operator's home.

Not a replacement for full YARA: the embedded scanner is substring-based, not the full YARA grammar. It catches the seven hard-coded signature families but won't compile real .yar rule files. If you need that, install YARA separately and pipe avwatch's file-list output into yara <rules>.

Compliance crosswalk

This table lists controls where avwatch's output may form part of the evidence set presented to an assessor. It does not claim avwatch alone satisfies any framework — every control still requires assessor judgment and typically evidence from other sources.

Schema: compliance-crosswalk/v1 · Machine-readable: tools/avwatch/compliance.json

ISO27001 — ISO/IEC 27001:2022

RefNameHowCoverage
A.8.7 Protection against malware Baseline diff + signature-scan integration surfaces malware indicators. evidences
A.8.15 Logging HMAC-chained audit log per action. evidences

NIS2 — NIS2 Directive (Dir. 2022/2555)

RefNameHowCoverage
Art. 21 §2(b) Incident handling Detection routes feed IR workflows. supports

DORA — Digital Operational Resilience Act

RefNameHowCoverage
Art. 10 Detection Continuous endpoint monitoring supports the detection control. evidences

Release artefacts & provenance

Every signed release ships with checksum + signature sidecars plus a CycloneDX SBOM. Enterprise procurement can pin third-party components without unpacking the binary.