Crates.io | pff |
lib.rs | pff |
version | 0.6.2 |
source | src |
created_at | 2022-05-13 11:49:59.557926 |
updated_at | 2024-03-09 16:41:33.795853 |
description | pf filter - parse Nginx access.log for unwanted regexp patterns, and block them on the PF firewall |
homepage | |
repository | https://github.com/dmilith/pff |
max_upload_size | |
id | 585812 |
size | 39,881 |
Daniel (dmilith) Dettlaff (@dmilith)
This is a cli application that parses Nginx access.log for unwanted regexp patterns, which are later added to the blocked list of PF firewall.
Precompiled, configurable Regexps (wanted and unwanted)
Configurable buffer (if 0 then whole access.log is parsed each run, if specified will determine of how much of the log tail gets parsed)
Follows simple rule, that if access.log line is matching the "wanted" regexp it's not checked further, when is matching "unwanted" regexp it's considered malicious and will be added to the firewall block
LOG=debug cargo run
If no configuration is found in default paths, the local "pff.conf" will be created with default configuration. The file is stored in the RON format.
table <blocked> persist file "/etc/spammers"
block drop in quick from <blocked>
block drop out quick to <blocked>
Pff assumes that /etc/spammers is writable and user is root. On MacOS sudo is used to reload PF as a regular user.