Commit Graph

149 Commits

Author SHA1 Message Date
Dirk Brenken dc39393c1b banip: update 1.8.8-4
- f_etag performance optimization: single-pass awk consolidating count+match
- f_report performance optimization: significantly reduce subshell spawning
- f_lookup performance optimization: DNS resolution parallelized per domain via subshells
- LuCI: prevent possible report refresh timeouts

Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-05-18 23:21:43 +02:00
Dirk Brenken b2d769ffc8 banip: update 1.8.8-3
- gated config sanity checks at the end of banip-functions.sh
   behind 'ban_action' to skip them on init script sourcing paths (enable/disable/help)
- added a ubus socket guard around f_system to harden against pre-ubus sourcing
- added a 'ban_bver' fallback in f_log for sourcing paths without prior f_system execution
- reordered system utility references before system library sourcing,
   so f_log has a valid 'ban_logcmd' available if the library check fails
- minor code improvements and fixes

Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-05-16 22:16:43 +02:00
Dirk Brenken 98c0a3d00d banip: update 1.8.8-2
- optimized pidfile handling in the init file
- small cornercase fixes & improvements
- drop deprecated 'drop' feed (replaced by 'spamhaus' json feed with the same content)
- LuCI: expose the new JSON Lines Format in the feed editor
- readme update

Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-05-04 19:42:40 +02:00
Dirk Brenken e0669cb1a8 banip: release 1.8.8-1
- introduced a shared named nft limit (loglimit) referenced by
  all log rules instead of per-rule limits, aligning with kernel printk rate limits
- added new 'ban_logratelimit' and 'ban_logburstlimit' UCI options for tuning
   the shared log limit; setting ban_logratelimit=0 disables nft-side rate limiting
   entirely (useful for ulogd or other userspace log handlers that bypass printk)
- LuCI: made the new UCI option available (Log Settings)
- readme update

Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-04-30 11:37:14 +02:00
Dirk Brenken 523c395b17 banip: release 1.8.7-1
- fix log rate limit and drop throttling (#29255, #27990)
- serialize dedup writes via flock in f_down
- tighten RDAP CIDR validation and lock handling in f_monitor
- fix IPv6 prefix regex in f_search, simplify sed pattern in f_report
- readme update

Signed-off-by: Dirk Brenken <dev@brenken.org>

Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-04-28 20:01:11 +02:00
Dirk Brenken a3082e3069 banip: update 1.8.6-4
* fixed report generation and housekeeping
* added missing code/function comments

Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-04-21 19:29:00 +02:00
Dirk Brenken cfe1ddc693 banip: update 1.8.6-3
* removed unnecessary forks in f_nftinit
* removed  unnecessary forks in f_genstatus
* removed  unnecessary forks in f_lookup
* removed the needless f_char function
* cosmetics

Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-04-19 19:13:58 +02:00
Dirk Brenken 01c7cf719e banip: update 1.8.6-2
* flock/serialize the etag writing in the f_etag function
* added various variables to local scope
* LuCI: removed needless ACL

Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-04-18 19:07:23 +02:00
Dirk Brenken 420d966267 banip: release 1.8.6-1
* fixed the initialization of the banIP rundir (reported in the forum)
* sanitize possible windows line endings in local block- and allowlist
* refine the cpu/core detection
* code clean-up/linting

Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-04-16 22:13:33 +02:00
Dirk Brenken 79f2db6cc5 banip: update 1.8.5-2
* fixed two issues in the mail template, reported in the forum
* tweak the f_report function
* changed the f_actual function to reduce subshell calls
* further optimize the monitor function:
  * fixed a possible RDAP rate-limit race condition,
    serialize the rdap_tsfile via flock
  * block_cache bounded growth, when the cache reaches 500
    entries it resets to empty, preventing unbounded string growth
    in the monitor loop
* set the printf format string in single quotes (overall)

Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-04-11 18:43:50 +02:00
Dirk Brenken 9c3470ac4a banip: release 1.8.5-1
* removed needless fork/exec calls (#29010)
* removed needless eval calls
* added parallel country and ASN feed downloads (#29010)
* rework the IP monitor:
  * IP extraction, counting, and threshold detection now run
     entirely inside a single gawk process
  * added a dynamic cache management and  a three-tier IP deduplication
  * added asynchronous/non-blocking  RDAP requests
* hardend the cgi script and mail template
* fixed #28998
* LuCI: added more status information
* LuCI: more fixes & optimizations (e.g. #8486)
* readme update

Co-authored-by: Colin Brown <devs@coralesoft.nz>
Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-04-07 19:32:34 +02:00
Dirk Brenken ef91c84fe6 banip: update 1.8.1-3
* add better input validation to the f_content and f_search functions,
   to compensate for the very limited Wildcard ACL mechanisms in LuCI, see
   https://github.com/openwrt/luci/issues/8435 for reference
* LuCI: add a proper poll mechanism to mitigate Reporting timeouts
  on "Search" and "Refresh", even with big  Sets
* LuCI: Refine some ACLs
* LuCI: more fixes & optimizations
* readme update

Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-03-22 16:16:21 +01:00
Dirk Brenken e724274907 banip: release 1.8.1-1
* the debug mode now captures internal error output in a dedicated log file,
  located by default in the banIP base directory as /tmp/ban_error.log
* replaced the non-functional recursive PID tree walk in f_rmpid with
  a correct iterative implementation
* added several IP validator improvements
* fixed a copy-paste error in f_report
* fixed a uninitialized variable in f_actual
* fixed missing token validation in banip.cgi
* various other minor improvement & fixes
* removed abandoned nixspam feed
* LuCI: various fixes & optimizations
* readme update

Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-03-15 18:18:04 +01:00
Dirk Brenken 091ba82c38 banip: update 1.8.0-3
* support the new possible nft expiry options in the backend as well

Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-02-21 11:48:49 +01:00
Dirk Brenken 396c65e670 banip: release 1.8.0-1
* hardened the uci config parsing
* added a fast, flexible & secure IPv4/IPv6 validator function, it eliminates > 99 % of garbage inputs
  Please note: The ‘rule’ in the feed file now only contains parameters for the IP validator;
  details can be found in the readme file. Old custom feed files are not compatible and will be
  backed up/removed via the uci-defaults script
* added BCP38 support: to block packets with spoofed source IP addresses in all supported chains
* optimized the log monitor plus performance improvements
* removed the pallebone feed (discontinued)
* added the ipexdbl feed
* various small improvements
* LuCI: add the BC38 option under Table/Chain Settings
* LuCI: updating the custom feed editor
* LuCI: small usability improvements
* readme update

Signed-off-by: Dirk Brenken <dev@brenken.org>
2026-01-12 22:59:43 +01:00
Dirk Brenken c47d8b149c banip: release 1.6.0-1
* split block/logging rules (fixed #27990)
* adapt reload functions to support the new split logic
* the banIP status now includes the backend- and the frontend version information
* fixed a config parsing error with non existing dirs (reported in the forum)
* fixed a small reporting issue (reported in the forum)
* added a new public dns feed (by default restricted to outbound, ports 53 and 853)
* added a new gawk dependency due to significant performance gains
* LuCI: no longer call the logread binary, use rpc / the ubus log object instead
* LuCI: various code cleanups
* LuCI: various small usability improvements
* readme update

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-12-04 20:25:46 +01:00
Dirk Brenken ac1076ef95 banIP: update 1.5.6-7
* skip rdap requests/replies with placeholders for all IPv4/IPv6 addresses
* sanitize possible bogus config values, e.g. '/dev/null' as a directory
* change URL for beycyber feed

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-08-04 20:53:59 +02:00
Dirk Brenken d2599fb6b6 banIP: update 1.5.6-6
* limit nft logging to a rate 10/second to prevent possible log-flooding
* skip external feed processing if "allowlist-only" mode is fully enabled (in in- and outbound)
* remove needless default icmpv6 rule in wan-input
* refine the housekeeping script (uci-defaults)
* readme update

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-06-28 22:10:34 +02:00
Dirk Brenken 645b0ab137 banIP: update 1.5.6-5
* fixed the restore rc handling
* skip allowlist entries during map creation
* disable the map button by default (only enabled if map & NFT counter are selected)
* disable the content filter checkbox for elements with hits by default (only enabled if NFT counter are selected)
* readme update

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-06-14 19:47:19 +02:00
Dirk Brenken 7222ac88f0 banIP: update 1.5.6-4
* show the IP plus the packet counter in the modal Set content view (or on the CLI)
* add a filter to show only elements with hits in the modal Set content view (or on the CLI)
* limit the element output with hits to max. 50 per Set on the Set Reporting overview page
* fixed set names suffix in the report output
* fixed the Set content view for MAC based Sets
* display the map even if the HomeIP cannot be determined

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-06-09 07:01:02 +02:00
Dirk Brenken 5607728fe6 banIP: update 1.5.6-3
* add json reporting cache
* fixed the fetchcmd autodetection
* sanitize json reporting output
* small fixes and improvements

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-05-31 22:09:49 +02:00
Dirk Brenken 5402f8eea1 banIP: update 1.5.6-2
* add an uci-defaults script for housekeeping and option migration from former versions
* small fixes and improvements

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-04-29 21:55:55 +02:00
Dirk Brenken 7383b4817b banIP: release 1.5.6-1
* the ETAG function now supports country and asn feeds as well
* fixed becyber URL and other small fixes
* LuCI fixes and improvements (separate commit)

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-04-11 21:59:31 +02:00
Dirk Brenken 251f58d513 banIP: update 1.5.5-2
* fixed a JSON reporting issue (when the map and NFT counters are disabled)
* optimized the getfetch function call within the reporting function
* removed the stale IPv6 links in the becyber feed
* cosmetics

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-03-29 17:07:09 +01:00
Dirk Brenken 716e73da56 banIP: release 1.5.5-1
* added a geoIP Map to show home IPs and potential attacker IPs on a leafletjs based map
* significantly improved the reporting performance on multicore hardware
* removed aria2 support (it doesn't support post data requests)
* removed the following outbound feeds due to too many false positives:
   adaway, adguard, adguardtrackers, antipopads, oisdbig, oisdnsfw, oisdsmall, stevenblack and yoyo
* renamed the banIP command "survey" to "content"
* various other small tweaks
* update the readme

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-03-28 07:57:42 +01:00
Dirk Brenken 764a77acfd banIP: update 1.5.3-3
* fix a race condition in the process scheduler
* sync the banIP country file with ipdeny feed
* refine etag handling with country/asn feeds
* refine logging with country/asn feeds
* refine the banIP status output (incl. LuCI changes)

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-03-07 13:26:12 +01:00
Dirk Brenken 62a4633e7c banIP: update 1.5.3-2
* fix uci config processing (ban_logterm)
* update the readme

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-03-03 19:45:11 +01:00
Dirk Brenken d5cd6f3cf2 banIP: release 1.5.3-1
* optimized uci config processing (list options)
* optimized icmp rules in pre-routing (thanks @brada)
* set inbound marker in pre-routing only if inbound logging is enabled (fixes #26044)
* fix cornercase in Set removal function
* print chain-, set- and rules-counter in the banIP status
* clean up logging und download queue handling
* update the readme

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-02-28 16:50:56 +01:00
Dirk Brenken 884876c7e1 banIP: release 1.5.2-1
* add memory measurements:
 - free memory in MB (MemAvailable from /proc/meminfo)
 - script run max. used RAM in MB (VmHWM from /proc/$$/status)
* removed the obsolete (domain) lookup command in init script
* update the readme

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-02-21 22:08:45 +01:00
Dirk Brenken 4e3d7845fd banIP: release 1.5.1-1
* optimized the f_nftload function
* reduced the prerouting priority to -175
* optimized the output of the f_survey function
* removed a needless fw4 call/check
* no longer skips regular blocklist feeds in "allowlist only" mode
* optimized init checks
* turris feed: enable IPv6 parsing, too (prvided by @curbengh)
* update the readme

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-02-13 21:48:15 +01:00
Dirk Brenken bf2fb994fa banIP: update 1.5.0-6
* fixed  the incomplete rule maintainance during banIP reloads
* fixed the Set query function (if the Set counters are disabled)

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-02-02 22:15:41 +01:00
Dirk Brenken 737c0601cb banip: update 1.5.0-5
* fix a reporting issue with multiple ports/protocols

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-01-26 19:58:53 +01:00
Juan Orti Alcaine f80fbec40f banip: Block UDP ports for HTTP/3
Block HTTP/3 by including UDP in the feeds that have the 80 443 ports in
their flag.

Signed-off-by: Juan Orti Alcaine <jorti@pm.me>
2025-01-25 19:36:40 +01:00
Dirk Brenken 481215bab0 banIP: update 1.5.0-3
* better logging of nft load errors
* update the readme

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-01-23 20:11:32 +01:00
Dirk Brenken c4f95cb0f2 banIP: update 1.5.0-2
* fix typo in the log_outbound target
* update the readme

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-01-19 21:08:47 +01:00
Dirk Brenken 80768dfdae banIP: release 1.5.0-1
* change the chain structure: only two regular chains contain the generated banIP sets.
  “_inbound” covers the base chains WAN-Input and WAN-Forward, ‘_outbound’ covers the base chain LAN-Forward.
* pre-configure the default chains for every feed in the banip.feeds json file, no longer blocks
  selected feeds in all chains by default
* it's now possible to split country and asn Sets by country or asn (disabled by default)
* support Set counters to report easily suspicious IPs per Set (disabled by default)
* make it possible, to opt out certain chains from the deduplication process
* the element search now returns all matches (and not only the first one)
* the report engine now includes statistics about the Inbound & Outbound chains and the Set counters (optional)
* save the temp. files of possible nft loading errors in "/tmp/banIP-errors" by default for easier debugging
* various code improvements
* remove ssbl feed (deprecated)
* add two new vpn feeds
* update the readme

Signed-off-by: Dirk Brenken <dev@brenken.org>
2025-01-16 20:10:34 +01:00
Dirk Brenken 3140259fc6 banIP: update 1.0.1-2
* correctly parse json objects with hyphens in the autodetection function

Signed-off-by: Dirk Brenken <dev@brenken.org>
2024-11-26 07:05:24 +01:00
Dirk Brenken 8609a5bbe5 banIP: release 1.0.1-1
* optimized procd settings for better performance
* made the log monitor working again (even on master with apk migration issues)
* reworked the fetch autodetection function (still broken in master due to apk migration)

Signed-off-by: Dirk Brenken <dev@brenken.org>
2024-11-24 15:44:38 +01:00
Dirk Brenken 4f00d8f0ee banIP: update to 1.0.0-10
* minimal fix to support all download utilities in currently broken apk snapshots
  (see https://github.com/openwrt/openwrt/issues/16907 for details)

Signed-off-by: Dirk Brenken <dev@brenken.org>
2024-11-16 12:45:40 +01:00
Dirk Brenken fb19c14696 banIP: update to 1.0.0-9
* fixed gathering/printing of system information in banIP status
* removed broken iblocklist.com feeds
* updated readme

Signed-off-by: Dirk Brenken <dev@brenken.org>
2024-10-26 21:25:20 +02:00
Dirk Brenken 270e6f1264 banIP: update to 1.0.0-8
* supports comments (introduced with a #), for MAC addresses
  in the allow and block list, e.g. 26:5e:a0:6a:9c:da # Test
* added hagezi threat ip feed
* added an adguard logterm to the readme
* removed the broken talos feed

Signed-off-by: Dirk Brenken <dev@brenken.org>
2024-10-11 19:46:16 +02:00
Dirk Brenken aeda25086e banIP: update to 1.0.0-7
* fixed auto allow-/blocklist-issue with IPv6 addresses in CIDR notation
* removed edrop feed from readme (had been removed from feeds for a while)

Signed-off-by: Dirk Brenken <dev@brenken.org>
2024-09-20 10:04:40 +02:00
Dirk Brenken b157e03e80 banip: update 1.0.0-6
* automatic blocking of IP ranges via RDAP request now supports multiple CIDRs
* cosmetics

Signed-off-by: Dirk Brenken <dev@brenken.org>
2024-09-09 21:08:48 +02:00
Dirk Brenken 9968fe6bf7 banip: update 1.0.0-5
* filter crappy IP entries from urlhaus feed

Signed-off-by: Dirk Brenken <dev@brenken.org>
2024-07-14 22:27:07 +02:00
JetVarimax bda55290f4 banip: Correct Mb to MB when referring to RAM in README.md
Signed-off-by: JetVarimax <140423365+JetVarimax@users.noreply.github.com>
2024-07-08 20:21:30 +01:00
Dirk Brenken d17f661aee banip: update 1.0.0-4
* relax the firewall pre-check if fw4 is not running
* replace former stale tor feed source with 'https://www.dan.me.uk/torlist/?exit'
* add openvpn log term/search pattern example to the readme
* the default config now includes only log terms for dropbear and LuCI, all others are optional
* readme update

Signed-off-by: Dirk Brenken <dev@brenken.org>
2024-06-22 10:13:22 +02:00
Dirk Brenken 2cc7cf3ca0 banip: update 1.0.0-3
* fixed a regression in the split Set function (reported in the forum)
* fixed regex for urlhaus feed

Signed-off-by: Dirk Brenken <dev@brenken.org>
2024-06-18 17:04:15 +02:00
Dirk Brenken 059a530329 banip: update 1.0.0-2
* fixed a possible "Argument list too long" error in the f_log function
* fixed multiple, incomplete digit character classes
* fixed/optimized split file handling
* cosmetics

Signed-off-by: Dirk Brenken <dev@brenken.org>
2024-06-16 21:52:10 +02:00
Dirk Brenken cc709768b5 banip: release 1.0
* made sure, that the domain lookup always add the found IPs to the underlying allow-/blocklist-Set
* major readme update

Signed-off-by: Dirk Brenken <dev@brenken.org>
2024-06-08 10:34:09 +02:00
Dirk Brenken 3584187f69 banip: update 0.9.6-3
* fixed concurrent, too high nft loads during feed processing (seen in LuCI frontend)

Signed-off-by: Dirk Brenken <dev@brenken.org>
2024-06-01 16:06:59 +02:00