Source: factory.core/ObjFirewall.py
| Method | Signature | Description |
|---|---|---|
| check_ip | check_ip(ip: str, scope: str = 'ALL') -> tuple |
Check if an IP is allowed. |
| add_rule | add_rule(rule_type: str, ip_address: str = '', cidr_range: str = '', description: str = '', scope: str = 'ALL', expires_hours: int = 0, country_code: str = '', region: str = '', isp: str = '', asn: str = '', source: str = 'manual') -> bool |
Add a firewall rule. |
| remove_rule | remove_rule(rule_id: int) -> bool |
Deactivate a firewall rule. |
| list_rules | list_rules() -> list |
List active firewall rules. |
| clear_cache | clear_cache() |
Force reload rules on next check. |
| auto_ban | auto_ban(ip: str, reason: str = 'rate_limit', hours: int = 0, scope: str = 'ALL') -> bool |
Auto-ban an IP from rate limit or |
| check_abuseipdb | check_abuseipdb(ip: str) -> dict |
Check IP against AbuseIPDB honeypot. |
| check_ip_enhanced | check_ip_enhanced(ip: str, scope: str = 'ALL', honeypot: bool = False) -> tuple |
Check IP with optional honeypot lookup. |
| sync_to_ufw | sync_to_ufw(dry_run: bool = False) -> list |
Sync firewall rules to UFW (iptables). |
| ufw_status | ufw_status() -> str |
Return current UFW status output. |
| ufw_remove_rule | ufw_remove_rule(rule_number: int) -> tuple |
Remove a UFW rule by number. |