Antivirus/packaging/rpm/hound.spec
dev a3f31288fa rootkit: stop reporting every process on the machine as hidden
A clean laptop reported 988 critical rootkit findings; this server
3786, PID 1 among them. Every one was false, and the cause was our own
systemd hardening.

ProtectProc=invisible hides processes the daemon does not own from its
view of /proc, while kill(pid, 0) keeps answering truthfully because it
is a syscall and not a filesystem lookup. The hidden-process check
compares exactly those two sources, so with that setting every process
on the machine looked concealed. Enumerating processes is this daemon's
job, so it needs the default view.

Removing the setting is not enough on its own — hidepid= on the /proc
mount produces the same blindness and we do not control that. So the
detector now recognises when it cannot see:

  - PID 1 is the control. It always exists and nothing hides init; a
    rootkit that did would break the machine it is living on. If PID 1
    answers kill(1, 0) but is absent from the listing, we are blind and
    say so as info rather than crying rootkit.
  - A plausibility ceiling of 32. Hiding a handful of processes is the
    entire point of a rootkit; hundreds means a broken observer. An
    antivirus that reports a critical rootkit finding on every clean
    machine teaches people to ignore the one time it is real.

Also in this change, from testing on a real desktop:

  - Closing the window hides it to the tray instead of exiting, with a
    one-time notification so it does not read as a crash. Quit lives
    only in the tray menu and confirms first. The settings already had
    close_to_tray and confirm_quit fields wired to nothing; they are
    honoured now rather than hardcoded.
  - The tray menu and Scan Home sent the literal string "~". A shell
    would have expanded it, nothing here did, so the daemon was asked
    to scan a directory of that name. It failed silently until the
    per-peer readability check made it audible.
  - Administrative actions elevate through polkit instead of telling
    people to open a terminal. The app tries unprivileged first and
    only on a privilege refusal runs `pkexec hound admin-rpc`, which
    forwards one request as root. auth_admin_keep, because prompting on
    every settings toggle trains people to authenticate without reading
    the prompt. This grants what `sudo hound` already grants to people
    who could already run sudo — a transport, not a new privilege.
  - `hound settings exec-gate on|off` now exists. The install script,
    the AppImage banner, the rpm spec, the AUR install file and
    llms.txt all told users to run `hound settings set exec_gate true`.
    There was no `set` subcommand and no way to enable the execution
    gate from the CLI at all: the flagship paid feature was unreachable
    and the first thing a new user was told to type returned an error.
    A test now asserts every documented command parses.
  - `settings show` displays the exec gate state, and no longer prints
    its own header twice.
  - The CLI help still described ClamAV, which has not been the engine
    for some time. So did the socket permission error, which now
    explains the `hound` group and the log-out-and-back-in it needs.

368 tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 11:21:06 -05:00

69 lines
2.3 KiB
RPMSpec

Name: hound
Version: 0.1.0
Release: 1%{?dist}
Summary: Hound Antivirus for Linux
License: Apache-2.0
URL: https://houndav.com
Source0: %{name}-%{version}.tar.gz
BuildRequires: rust >= 1.91, cargo, systemd-rpm-macros
Requires: systemd
Suggests: clamd
%description
Endpoint and supply-chain protection built for the distributions people
actually run. Scanning is yara-x in process; real-time protection uses
fanotify, so a binary can be refused at execve rather than reported after
it has already run.
The execution gate is installed switched OFF. It needs CAP_SYS_ADMIN and
covers the whole root filesystem, so enabling it is the operator's call:
hound settings exec-gate on
%prep
%autosetup
%build
cargo build --release -p houndd -p hound
%install
install -Dm755 target/release/houndd %{buildroot}%{_bindir}/houndd
install -Dm755 target/release/hound %{buildroot}%{_bindir}/hound
install -Dm644 packaging/systemd/houndd.service \
%{buildroot}%{_unitdir}/houndd.service
install -Dm644 crates/houndd/rules/hound-builtin.yar \
%{buildroot}%{_datadir}/hound/rules/hound-builtin.yar
install -dm755 %{buildroot}%{_sharedstatedir}/hound/rules
install -dm700 %{buildroot}%{_sharedstatedir}/hound/vault
for s in 16 22 24 32 48 64 128 256 512; do
install -Dm644 assets/icons/app-${s}.png \
%{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/hound.png
done
install -Dm644 assets/icons/hound-app.svg \
%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/hound.svg
%post
# The built-in rules are compiled into the binary; %{_sharedstatedir}/hound/rules
# is for additional packs only. Seeding it there compiles them twice.
%systemd_post houndd.service
%preun
%systemd_preun houndd.service
%postun
%systemd_postun_with_restart houndd.service
%files
%{_bindir}/houndd
%{_bindir}/hound
%{_unitdir}/houndd.service
%{_datadir}/hound/rules/hound-builtin.yar
%{_datadir}/icons/hicolor/*/apps/hound.png
%{_datadir}/icons/hicolor/scalable/apps/hound.svg
%dir %{_sharedstatedir}/hound
%dir %{_sharedstatedir}/hound/rules
# The vault holds live malware: root-only, never world-readable.
%attr(0700,root,root) %dir %{_sharedstatedir}/hound/vault
%changelog
* Fri Aug 21 2026 Hound <support@houndav.com> - 0.1.0-1
- yara-x engine in process; fanotify execution gate