Files, processes and limits
Files on a server
| Path | Owner, mode | Contents | Safe to delete? |
|---|---|---|---|
/usr/local/bin/ipfence |
root, 0755 | the program | when uninstalling |
/etc/systemd/system/ipfence.service |
root, 0644 | service definition | when uninstalling |
/etc/ipfence/config.toml |
root, 0600 | your settings | yes; defaults apply |
/var/lib/ipfence/ |
root, 0700 | state directory | loses history and identity |
/var/lib/ipfence/ipfence.db |
root, 0600 | the database | see above |
…db-wal, …db-shm |
root, 0600 | SQLite's working files | never while running |
/run/ipfence/ |
root, 0700 | runtime directory | recreated |
/run/ipfence/control.sock |
root, 0600 | command socket | recreated |
/run/ipfence/writer.lock |
root, 0600 | single-writer lock, holds a PID | recreated |
From a test machine, with sizes, owners and dates trimmed (all owned by root):
Plain text
drwx------ /run/ipfence
srw------- /run/ipfence/control.sock
-rw------- /run/ipfence/writer.lock
drwx------ /var/lib/ipfence
-rw------- /var/lib/ipfence/ipfence.dbKernel objects
table inet ipfence: sets ban4, ban4net, ban6, ban6net, allow4,
allow6; chains owner_v1_<id>, input, optionally forward.
Processes
| Process | When |
|---|---|
ipfence daemon |
the service |
journalctl --follow ... |
one per journal reader (SSH; Caddy if configured) |
systemctl show, journalctl --lines, iptables --version |
briefly, during discovery |
| your hook | briefly, after decisions |
Timings
| What | Interval |
|---|---|
| reconcile the firewall, expire bans | 15 s, and after every change |
| rediscover services | 60 s |
| reader commits events | 500 ms (journal); each read (files) |
| file look interval | inotify, at most 2 s |
| journal restart delay | 1 s, doubling to 60 s |
| shutdown wait for readers | 10 s |
| service restart after a crash | 10 s |
Limits
| Limit | Value |
|---|---|
| active bans | 20,000 |
| ended bans kept | 90 days, 10,000 |
| stored hits | 50,000 |
| offense records | 100,000 |
| proxied observations | 100 |
| manual ban width | no wider than /8 or /32 |
| manual ban duration | 1 s to 10 years, or permanent |
| ban ladder entries | 1 to 10, each 1 m to 365 d |
| detector window | 10 s to 24 h |
| threshold | 1 to 1000 |
| future timestamp tolerance | 5 minutes |
| settings file | 64 KiB |
| sshd message | 2 KiB |
| journal entry | 128 KiB |
| Nginx line | 16 KiB |
| Caddy line | 64 KiB |
| file read per pass | 256 KiB |
| log files per web server | 32 |
| SSH units | 16 |
| hook queue, timeout | 16; 100 ms to 30 s |
| control request, response | 16 KiB; 32 MiB |
| concurrent commands | 8 |
| service memory, tasks | 256 MiB, 128 |
Ports and network
ipfence listens on no network port and opens no network connection. It uses Unix sockets (commands, systemd notification, local Docker) and netlink (kernel).