ipfence home page local-first intrusion prevention for Linux

Manual pages

Messages and errors

What ipfence says, what it means, and what to do. Commands print errors as ipfence: <message>. Capitalized placeholders stand for values.

Command usage (exit 2)

Message Fix
unknown command "X" ipfence help
X takes no arguments remove the extra words
X needs exactly one IP address or CIDR give one
choose exactly one expiry: --for <duration> or --permanent pick one
--for needs a duration of at least 1s, such as 30m, 6h or 7d
"X" is not a literal IP address use an address, not a name
"X" has host bits set; did you mean Y? use the suggested range
"X" is not a valid CIDR
"X" has an interface zone, which is not supported drop the %eth0 part
--service must be ssh, nginx or caddy
--format: ... see formats
--ssh-client takes one address: ...

Safety refusals (exit 6)

Message Meaning
refused: enforcement is disabled, so this ban would block nothing; run "ipfence enable" first enable first
refused: P is wider than /8 (or /32) split into narrower ranges
refused: P includes loopback addresses
refused: P includes unspecified, multicast or broadcast addresses
refused: A is an address of this host
refused: P is covered by the allowlist entry E; remove that entry first ... the allowlist wins
P includes A, your current SSH client; use --force if you mean it you were about to block yourself
refused: the ban duration must be at least 1s, or permanent
refused: the limit of 20000 active bans is reached unban something
refused: P would allow every address /0 is not allowed
refused: A is built in and cannot be removed here
refused: A is an address of this host and cannot be removed here
refused: A is allowed by the config file entry E and cannot be removed here edit the file
disable removes the table inet ipfence and stops all blocking; run "ipfence disable --yes" to confirm add --yes

Not found (exit 7)

Message Meaning
not banned: A has no ban of its own nothing to remove
...; it is covered by R (unban that, or allow this address) a range blocks it
...; narrower bans exist inside it: ... unban those individually
not found: A is not an allowlist entry added with "allow"

Applied partially

Message Meaning
ban recorded but NOT enforced yet: ... saved; firewall write failed; retried every 15 s
unban recorded but the firewall was NOT updated: ... same, for removal
allow recorded but the firewall was NOT updated: ... same
removal recorded but the firewall was NOT updated: ... same, for allow --remove
enforcement not enabled: ... enable failed; still off
remove firewall table: ... disable turned enforcement off but could not delete the table

Firewall (exit 5)

Message Meaning
nftables table inet ipfence is not provably owned by this installation; nothing was changed see the reason in parentheses
... (chain "input" holds a rule ipfence did not write) someone added a rule
... unknown chain "X", unknown set "X" something else is in the table
... has 0 ownership markers, want exactly 1 a table with our name that we did not create
table belongs to a different ipfence installation ... database replaced

See Troubleshooting.

Permissions and locking

Message Exit Meaning
... permission denied followed by This needs root; try sudo. 3 use sudo
another ipfence process holds the writer lock but is not answering on its socket; try again 4 a daemon is starting or stuck
connect to the daemon: ... 4 check systemctl status ipfence

Settings

All begin with config:. The daemon will not start until fixed.

Message Fix
unknown setting(s): ... a typo
PATH is writable by group or others chmod 600
PATH is owned by another user chown root
PATH is a symlink; refusing to follow it use a real file
PATH is larger than 65536 bytes
allow.addresses: ... / ... covers every address fix the entry
S.threshold must be between 1 and 1000
S.window must be between 10s and 24h
nginx.clients must be "direct" ... or "proxied" ... declare it
nginx.clients = "proxied" requires proxy.trusted list your proxy
caddy needs exactly one of access_logs or journal_unit
nginx.format: ... see below
policy.durations must not decrease and similar see settings
ipv6.prefix must be set explicitly between 48 and 127
docker.mode must be "off" or "forward"
hook.command must start with an absolute path ...

Log format messages

Message Meaning
log format has two variables with no separator cannot be split reliably
log format repeats $X
log format must put $remote_addr before client-controlled fields such as $X forgery protection
log format must be combined, main, common or include $remote_addr
log format must include $request / $status / $time_local or $time_iso8601

Database

Message Meaning
file is not an ipfence database; it was left untouched wrong file at the path
database was written by a newer version; upgrade ipfence ...
database is corrupt; it was left untouched ... recover
PATH is not a regular file (symlinks are refused)

Reader notices (in status)

Notice Meaning
the saved journal position is gone (vacuumed or rotated); ... events may have been missed journal was trimmed
journalctl rejected the saved position; restarting from the scoring window ... same
PATH was rotated or truncated while not being read; ... changed while stopped
PATH was truncated; lines written just before may have been missed copytruncate
20 lines in a row did not match the configured format check format
PATH is a symlink; configure the real path
journalctl exit status 1: ... the journal could not be read; it retries
recording events failed, retrying: ... the database would not accept a batch; the reader waits and tries again

Daemon log lines

Line Meaning
msg="detector active" service=S started reading
msg=ready accepting commands
msg=decision event=ban|observe ... a decision
msg="firewall update failed; the decision is recorded and will be retried"
msg="maintenance failed; will retry" / msg="maintenance recovered"
msg="detector stopped: its log addresses cannot be trusted" Nginx realip or escape=none
msg="not banning a prefix that contains a trusted address" IPv6 policy skipped
msg="refused a control connection" another user tried to command the daemon
msg="hook failed" your program failed or timed out
msg=configuration warning=... a settings warning, such as a very wide allowlist entry
msg="firewall reconciliation failed; will retry" the firewall could not be brought up to date at start
msg="cannot start detector" a detector was ready but its reader could not be created
msg="log reader stopped" a reader ended with an error
msg="cannot reset a log position" the saved position of an untrusted log could not be cleared
msg="cannot list local addresses; using the last known list" this host's addresses could not be read
msg="some readers did not stop in time" shutdown continued after 10 seconds
msg="stopped; firewall rules and active bans remain in place" normal shutdown