Frequently asked questions
Safety
Will it lock me out?
It can, and no tool like this can honestly promise otherwise. To make it unlikely,
ipfence never automatically bans this server's own addresses, private addresses
(by default), or anything you allowlist; init allowlists the SSH client you run
it from; it starts in observe mode; and a first ban lasts 15 minutes. See
IPv6 and lockout and
I am locked out.
I typed my password wrong a few times from home. Am I banned?
If you reached five failures within ten minutes from a public address that is not allowlisted, and enforcement is on, yes, for 15 minutes. From your home network (a private address) on a LAN server, no. Using SSH keys avoids the problem: failed keys are not counted.
Does stopping or restarting it remove the bans?
No. The bans live in the kernel. Only ipfence disable --yes (or deleting the
table yourself) removes them.
What happens when the server reboots?
The kernel forgets all firewall rules. The service starts at boot, reads its database and puts unexpired bans back. Between boot and that moment nothing is blocked by ipfence. That gap was not timed.
What if ipfence crashes?
systemd restarts it after ten seconds. The kernel keeps blocking meanwhile. On restart it resumes from its saved position in the logs.
What if the database is damaged?
It refuses to start and leaves the file exactly as it is, so nothing is lost silently. Kernel rules stay. See Troubleshooting.
Can it break my other firewall rules?
It only ever creates, changes or deletes the table inet ipfence, and only after
checking that every object in it is its own. Tests next to ufw, firewalld and
Docker verified that no other rule changed.
Detection
Why was this address not banned?
In order of likelihood:
- Enforcement is off (look for "observed only").
- Not enough failures inside the window.
- The address is exempt: check the
ignored.*counters. - The failure is a kind that is not counted (for example a public key).
- The detector is not active: check the Detectors table.
- Already banned, or the events are older than a ban already served.
sudo ipfence test "<log line>" shows how a single line is judged.
Why are failed public keys not counted?
Your SSH client offers every key it has, one by one. Someone with several keys fails a few before the right one succeeds, entirely normally.
Why not count 401 and 403 web errors?
Web applications return them all the time to legitimate visitors: an expired session, a protected image, an API check. Banning on them would hit real users.
It does not detect failed logins on my web application. Why?
ipfence cannot know what a failed login looks like in your application; some even answer "success" when the password is wrong. This release only detects unmistakable probes on the web.
Can an attacker make it ban someone else?
That is the attack ipfence guards against most carefully:
- SSH: only entries journald attributes to the real sshd, run by root, count; the address is taken from the end of the message, so a crafted user name cannot replace it.
- Web: forwarded headers never choose the target; configurations that allow forged lines disable the detector.
Anyone who can already write your web server's log, or has root, can cause bans.
Does it work behind Cloudflare?
Your server only sees Cloudflare's addresses, so ipfence cannot block the real
visitor and will not block Cloudflare (when you set clients = "proxied" and list
the proxy addresses). Block visitors in Cloudflare. Never set
clients = "direct" behind a proxy.
What about an attacker using thousands of addresses?
Each stays under the threshold and is not caught. Defences that help: SSH keys only
(PasswordAuthentication no), a VPN for administration, and rate limiting.
Privacy
Does it send anything anywhere?
No. It has no code that contacts a server, and the service is forbidden by systemd from creating an internet socket. The exception you can create yourself is a hook program.
What does it keep about visitors?
Addresses, times, which service, and a short reason with counts. No user names, passwords, URLs or log lines. Ended bans are deleted after 90 days. See Privacy and threat model.
Why does building it download things?
The Go tool fetches the libraries ipfence is built from, once, on the build machine. The program itself never does.
Running it
How much does it use?
In the test machine's service report: about 12 MB of memory shortly after start. It was tested with 20,000 active bans, its limit. No performance claims are made beyond that.
Do I need nft installed?
No. ipfence talks to the kernel directly. nft is handy for looking.
Do I need rsyslog or /var/log/auth.log?
No. It reads the systemd journal.
Which systems work?
Tested on Debian 13, Debian 12 and Rocky Linux 9 on amd64, and Debian 13 on emulated arm64. Others with systemd and nftables will probably work but have not been tested.
Can I run it alongside fail2ban?
Technically they use separate rules, but it was not tested, and both would act on the same logs. Run one.
Is it production ready?
It is an early release with a large automated test suite and no independent security review. Use it where you can recover, and read Known limitations.
The name
Why "ipfence" and "Ward"?
"Ward" was the working codename; related projects already use it. "ipfence" is a provisional program name that has not been checked against package registries or trademarks. See Release procedure.