Phx2Ban.Analyzer (Phx2Ban v0.2.3)

This module is responsible for analyzing inbound traffic to your application. It is meant to run under a PartitionSupervisor so that the workload is spread out across many processes so that traffic analysis does not fall behind incoming traffic. If malicious requests are detected, then those requests are passed on to the Phx2Ban.Blocklist GenServer so that the malicious request can be default with accordingly.

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns if an IP Address is ignored.

Returns if Phx2Ban is enabled.

Returns if a request route exists in any of the defined Routers.

Returns if a request path route is ignored.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

ip_address_ignored?(remote_ip, allow_list)

Returns if an IP Address is ignored.

Don't forget to send the conn.remote_ip through ConnData.normalize_ip/1 first.

phx2ban_enabled?()

Returns if Phx2Ban is enabled.

request_route_exists?(conn_data, routers)

Returns if a request route exists in any of the defined Routers.

route_ignored?(request_path, ignore_routes)

Returns if a request path route is ignored.