Skip to content

Basic Firewall 1.0.0-rc.7

Pre-release
Pre-release

Choose a tag to compare

@kanopi-code-bot kanopi-code-bot released this 01 Oct 15:23
· 4 commits to main since this release
3bbbbc8

Seventh release candidate for 1.0.0. Published as a GitHub pre-release, so
the releases/latest/download URL does not serve it; install it by its own URL.
It bundles kanopi/firewall 2.36.1: Request / URL rules can count query
parameters with query_count (for capping facet crawling), and equality on a
number compares as a number, so a referenced list on port or query_count
works as written. Read What changes on upgrade. What changed since
1.0.0-rc.6 is below.

What changes on upgrade

  • Equality on a number from a referenced list starts working. kanopi/firewall
    2.36.1 compares a numeric entry with a number by value
    (kanopi/firewall#443), so a
    list-backed is equal to / is one of on port, query_count or a numeric
    geolocation field matches, and is not equal to no longer matches every
    request. Conditions typed into a rule were already compiled as numbers by the
    plugin and behave as before. A list-backed equality the plugin refused before
    2.36.1 (see Fixed) is now accepted.

Changed

  • Requires and bundles kanopi/firewall 2.36.1 (from 2.35.1). 2.36.0 adds the
    opt-in query_count variable; 2.36.1 makes equality on a number compare as a
    number (see What changes on upgrade).

Added

  • query_count.<name> and query_count in Request / URL rules. How many
    values the client sent for one query parameter, or with the Name left
    blank, how many parameters in all — counted from the raw query string, so
    f[0]=, f[]=, sparse or named keys, a repeated f= and encoded brackets
    all count the same. Offered on the rule screen as one family with an
    optional name; query_count. with nothing after the dot is refused. The
    library compares equality strictly, so a count is compiled as an integer
    for is equal to, is not equal to and is one of (each entry), and for
    the greater/less-than comparisons too; a value that is not a whole number is
    refused on save. The README has a Stop facet crawling example
    (path starts with /search and query_count / f is greater than 3,
    response challenge).
  • query_count and query_count.<name> as rate-limit key components,
    the name kept in the case it was written, as the library reads it.

Fixed

  • A referenced list compared for equality with port or query_count can
    no longer fail silently.
    Both are numbers to the library, and a list's
    entries arrive as text. Before kanopi/firewall 2.36.1 the library compared
    the two strictly, so "port is one of" a list never matched and "is not equal
    to" a list matched every request (on a block rule, every visitor). With the
    bundled 2.36.1 such a list works as written. On an older library, for
    example one supplied by a site's own Composer tree, the plugin refuses the
    rule on the rule screen, naming the alternatives (greater / less than, a
    regular expression such as ^(8443|9443)$, or the values typed into a
    condition). It also skips a rule that arrives by import, WP-CLI or a hand
    edit and names it on the Status screen and in Site Health. The plugin
    decides by probing the library rather than trusting a version, and also
    checks a shorthand template such as port@equals:{value}
    (kanopi/firewall#443).