-
-
Notifications
You must be signed in to change notification settings - Fork 385
Database
Jeff Johnson edited this page Mar 25, 2025
·
5 revisions
IPBan saves ip addresses to a local sqlite database in the file ipban.sqlite. The database is structured as follows:
Table IPAddresses (IPAddress VARBINARY(16) NOT NULL, IPAddressText VARCHAR(64) NOT NULL, LastFailedLogin BIGINT NOT NULL, FailedLoginCount BIGINT NOT NULL, BanDate BIGINT, State INT NOT NULL)
-
IPAddressis the raw ip address bytes. -
IPAddressTextis the ip address string. -
LastFailedLoginis the last failed login for the ip address, as a Unix UTC millisecond timestamp. -
FailedLoginCountis the number of failed logins. -
BanDateis the last ban date for the ip address, as a Unix UTC millisecond timestamp. Will be NULL if not yet banned. -
State:
Active = 0, // Active and in firewall
AddPending = 1, // Pending add to firewall
RemovePending = 2, // Pending remove from firewall
FailedLogin = 3, // Failed login only, no ban yet
RemovePendingBecomeFailedLogin = 4 // Remove from firewall is pending, but ip address should stay in database as a failed login. This is used for tiered ban times where ip addresses can be banned for longer and longer times.
You can query or use this database as you see fit for internal reporting tools, etc.
IPBan (c) 2012-Present Digital Ruby, LLC - https://ipban.com