Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.2.4] - 2025-06-30
Fixed
- Move regexes in module attributes to functions in order to support OTP 28
[0.2.3] - 2025-02-17
Added
- Raises
NimbleOptions.ValidationErrorif an unknown configuration option is added tophx_2_ban. This should prevent misconfigurations due to e.g. typos in the config options. - Expose
phx2ban_enabled?/0,route_ignored?/2andip_address_ignored?/2onAnalyzerto make it easier to debug your configuration and why an IP was blocked. You can request the second arguments for these functions (allow_listandrouters) throughFirewallConfig.fetch!(option).
[0.2.2] - 2024-11-30
Added
- Respect CSP nonces in LiveDashboard Plugin. You can now add your nonce values using the
csp_nonce_assign_keyoption in your router. See the Docs for more info. Closes #4
Fixed
- We properly sanitize IPv4 or IPv6 addresses everywhere now. Fixes this bug
[0.2.1] - 2024-11-29
Fixed
- Fixes a
FunctionClauseErrorin theKnownMaliciousIPrule when an IPv6 address was checked. - Bumped the dependency
phoenix_live_dashboardto at least0.8.0because versions below that were missing some functions we use in the LiveDashboardPlugin and that lead to compilation errors. (See #2)
[0.2.0] - 2024-11-28
Added
- New Rule
KnownMaliciousIP. Fetches a public blocklist of ~85k known malicious IPs tracked by AbuseIPDB from ezsuite.dev and blocks requests originating from these IPs. Phx2Ban.manually_block_ip_address/1function will manually add an IP address to the block list..Phx2Ban.ip_address_status/1function will return the current status of an IP address.- Config option
allow_list. Accepts a list of IP addresses as strings so that you can avoid analyzing/blocking traffic from certain trusted IP addresses. - Config option
enabledfor enabling/disabling the firewall. Can be triggered through the LiveDashboard plugin or manually throughPhx2Ban.FirewallConfig.put!(:enabled, true|false). - Config option
ignore_routes. Accepts a list of routes as string or regex that Phx2ban should ignore. Any requests to these routes are excluded from analysis and will never get blocked.
[0.1.0] - 2024-10-28
Added
- Initial release