ipfence home page local-first intrusion prevention for Linux

Manual pages

Privacy and threat model

What leaves the machine

Nothing, from ipfence's own code. It opens no IP connection and resolves no names; discovery reads local files, processes, the journal, interfaces and the local Docker socket. The supplied unit also blocks IP sockets in the kernel. The end-to-end test traces the daemon and fails if it creates or connects an IPv4 or IPv6 socket.

Two limits to that statement:

  • A hook you configure may send what it receives anywhere.
  • ipfence runs journalctl, systemctl and iptables --version, which are your system's programs.

There is no updater, telemetry, crash upload or shared blocklist.

What is stored

In /var/lib/ipfence/ipfence.db, readable by root only:

Data Notes
install identity random; also marks firewall ownership
bans and history address, service, a fixed reason with counts, offense, times, your note
scoring hits address, detector, time, an identifier of the record
offense counts per address
allowlist entries you added with your note
reader positions journal cursor; file identity, offset and a hash of the first 64 bytes
counters numbers

Never stored: passwords, user names, request paths or bodies, headers, or raw log lines. For file logs a hit identifier includes a hash of its line.

IP addresses can be personal data. History is pruned after 90 days. To erase everything, run disable --yes, stop the service and delete the directory.

Logs written by ipfence contain decisions (address, service, reason), errors and state changes.

Trust

Trusted Because
the kernel, root, systemd they already control the machine
journald's _-prefixed fields set by journald, not the sender
log files of a web server you enabled the server writes them
your configuration root-owned and checked
Not trusted Handling
user names, URLs, headers, user agents anchored parsers; size limits; never executed or stored
other local users cannot reach the socket or state; forged journal lines are rejected
existing nftables objects read-only unless ownership is proven
remote servers none are contacted

Threats and what happens

Threat Defence Remaining risk
Forged log line to ban someone else trusted journal fields; last-address parsing; Nginx escaping checked; JSON for Caddy anyone who can write the web log can cause bans
Spoofed forwarded header never chooses the target a CDN declared as direct gets banned
Local user fakes sshd _COMM, _UID, _EXE checks local root can do anything
Locking out the administrator exemptions, short first ban, recovery commands a changed address; someone sharing your address attacking
Deleting another tool's rules one table; ownership classification; never flushes another root process racing ipfence
Replay after restart or rotation positions committed with events; event identifiers; events older than the last ban ignored copytruncate loses lines
Restart removes protection table never removed on stop a corrupt database stops restoration after a reboot
Log flood line, queue, hit and ban limits; dropped records counted heavy floods delay detection
Misleading status kernel and database shown separately; "in firewall" only if the table is ours now the table can change after the report
Another user controlling the daemon 0600 socket, private directory, peer check
Malicious paths or symlinks symlinks and foreign-owned files refused for state, config, logs and executables root-controlled paths are trusted
Outbound data no network code; unit blocks IP sockets your hook

Not defended against

  • Attackers using many addresses, each below the threshold.
  • Anyone with local root, or who has compromised a service whose logs are read.
  • An exploit that succeeds on the first request.
  • Volumetric denial of service.
  • Attacks through a proxy or CDN.
  • IPv6 attackers rotating addresses, unless you opt into prefix escalation.

This is an early release. It has automated tests and an adversarial review by its author; it has not had an independent security audit.