{"id":20398770,"url":"https://github.com/bcambl/fail2ban-blacklist","last_synced_at":"2025-10-17T23:24:13.829Z","repository":{"id":13368522,"uuid":"16056202","full_name":"bcambl/fail2ban-blacklist","owner":"bcambl","description":"Saves banned IP's in flat file for later use \u0026 importing.","archived":false,"fork":false,"pushed_at":"2015-07-09T06:29:20.000Z","size":168,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T10:51:38.748Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcambl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-19T22:58:19.000Z","updated_at":"2023-11-24T17:25:31.000Z","dependencies_parsed_at":"2022-09-05T18:00:37.470Z","dependency_job_id":null,"html_url":"https://github.com/bcambl/fail2ban-blacklist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcambl%2Ffail2ban-blacklist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcambl%2Ffail2ban-blacklist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcambl%2Ffail2ban-blacklist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcambl%2Ffail2ban-blacklist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcambl","download_url":"https://codeload.github.com/bcambl/fail2ban-blacklist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571872,"owners_count":21126530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T04:24:03.237Z","updated_at":"2025-10-17T23:24:08.811Z","avatar_url":"https://github.com/bcambl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Persistent IP banning with Fail2ban\n\n### Description\n\nThis project allows you to save all IP's that have been banned by fail2ban to a blacklist file via\nsome very basic python scripting.\n\nFail2ban will ban all ip's in the blacklist upon each restart. *(see: additional notes)*\n\n### Installation\n\n###### warning:\n*If you have overridden actions.d/iptables.conf with a iptables.local file, Please review the iptables.local\nfile that is provided with this project and make the appropriate modifications to your version.*\n\nAfter cloning this project:\n\n````\ncd fail2ban-blacklist\ncp -r * /etc/fail2ban\n````\nEnsure blacklist.py and reban.py are executable:\n\n```\nchmod +x blacklist.py reban.py\n```\n\nRestart the fail2ban service: *(will vary base on your linux distribution)*\n\n```\nservice fail2ban restart\n```\n\n### Usage\n\nIf the above installation instructions are followed, everything should work upon restarting fail2ban.\n\nYou can manually add IP's to the IP file:\n\n```\n/etc/fail2ban/blacklist.py \u003cip address\u003e\n```\nThe above command will add the IP to the ip.blacklist file if it does not already exist.\n\nRe-banning of IP's is disabled by default. Un-comment the line in actions.d/iptables.d to enable.\nYou may also execute the reban.py script manually:\n```\n/etc/fail2ban/reban.py\n```\n\n#### optional:\nEdit ```report.py``` with your email address and configure a cronjob to run daily.\n\ncopy ```report.py``` to ```/etc/cron.daily```\n\nThis will email you all the banned IP's from the previous day with the associated country code.\n\n### Dependencies\n\nTested with python 2.7.9 on CentOS 6.6\n\n##### Additional notes:\n\n - 1) If you are using the Fail2ban pyinotify functionality, Fail2ban will reban IP's when changes are\n  detected in secure.log. This may create duplicate iptables entries for some IP's if reban is enabled.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcambl%2Ffail2ban-blacklist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcambl%2Ffail2ban-blacklist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcambl%2Ffail2ban-blacklist/lists"}