Skip to content

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)

  • IPAddress is the raw ip address bytes.
  • IPAddressText is the ip address string.
  • LastFailedLogin is the last failed login for the ip address, as a Unix UTC millisecond timestamp.
  • FailedLoginCount is the number of failed logins.
  • BanDate is 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.

Clone this wiki locally