{"id":16908954,"url":"https://github.com/yaleman/fail2ban-importer","last_synced_at":"2026-05-20T10:38:33.494Z","repository":{"id":37049157,"uuid":"443460275","full_name":"yaleman/fail2ban-importer","owner":"yaleman","description":"Pull from JSON lists and fail2ban things.","archived":false,"fork":false,"pushed_at":"2025-02-11T03:24:19.000Z","size":525,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-11T04:25:56.031Z","etag":null,"topics":["fail2ban","https","python","s3","security"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/fail2ban_importer/","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/yaleman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.MD","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-01T02:51:59.000Z","updated_at":"2025-02-11T03:24:23.000Z","dependencies_parsed_at":"2023-10-14T16:22:27.138Z","dependency_job_id":"d6611045-133d-42ad-a63b-31a6ec437ee4","html_url":"https://github.com/yaleman/fail2ban-importer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaleman%2Ffail2ban-importer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaleman%2Ffail2ban-importer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaleman%2Ffail2ban-importer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaleman%2Ffail2ban-importer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaleman","download_url":"https://codeload.github.com/yaleman/fail2ban-importer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244665676,"owners_count":20490275,"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":["fail2ban","https","python","s3","security"],"created_at":"2024-10-13T18:53:39.769Z","updated_at":"2026-05-20T10:38:28.444Z","avatar_url":"https://github.com/yaleman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fail2ban-from-s3\n\nGrabs a JSON-encoded list of things to ban and bans them using [fail2ban](https://www.fail2ban.org).\n\n# Installation\n\n`python -m pip install --upgrade fail2ban-importer`\n\n# Usage\n\n`fail2ban-importer [--oneshot|--dryrun]`\n\n# Configuration\n\nThe following paths will be tested (in order) and the first one loaded:\n\n - `./fail2ban-importer.json`\n - `/etc/fail2ban-importer.json`\n - `~/.config/fail2ban-importer.json`\n\n## Fields \n\nNote the `fail2ban_jail` field. If you're going to pick up your logs from fail2ban, and use them for the source of automation, make sure to filter out the actions by this system - otherwise you'll end up in a loop!\n\n| Field Name        | Value Type | Default Value     | Required | Description |\n| ---               |     ---    |     ---           |  ---     |    ---   |\n| `download_module` | `str`      | `http`            | No       | The download module to use (either `http` or `s3`)  |\n| `fail2ban_jail`   | `str`      | unset             | **Yes**  | The jail to use for banning - DO NOT REUSE AN EXISTING JAIL |\n| `source`          | `str`      | `blank`           | **Yes**  | Where to pull the file from, can be a `http(s)://` or `s3://` URL. |\n| `fail2ban_client` | `str`      | `fail2ban_client` | No       |  The path to the `fail2ban-client` executable, in case it's not in the user's `$PATH` |\n| `schedule_mins`   | `int`      | 15                | No       | How often to run the action. |\n| `ignore_list`     | `List[str]`| '[\"127.0.0.1\",]`  | No       | A list of IPs which will never be added to the ban list. |\n| `s3_endpoint`     | `str`      |                   | No       | The endpoint URL if you need to force it for s3, eg if you're using minio or another S3-compatible store. |\n| `s3_v4`           | `bool`     | `false`           | No       | Whether to force `s3_v4` requests (useful for minio) |\n| `s3_minio`        | `bool`     | `false`           | No       | Enable minio mode, force `s3_v4` requests |\n\n## HTTP(S) Source\n\n```json fail2ban-importer.json\nx\n{\n    \"source\": \"https://example.com/fail2ban.json\",\n    \"fail2ban_client\": \"/usr/bin/fail2ban-client\",\n    \"fail2ban_jail\" : \"automated\",\n    \"schedule_mins\" : 15\n}\n```\n\n## S3-compatible Source\n\nYou can use the usual [boto3 AWS configuration](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html#configuration), or put the options in the config file.\n\n```json fail2ban-importer.json\n{\n    \"source\": \"s3://my-magic-fail2ban-bucket/fail2ban.json\",\n    \"AWS_ACCESS_KEY_ID\" : \"exampleuser\",\n    \"AWS_SECRET_ACCESS_KEY\" : \"hunter2\",\n    \"schedule_mins\" : 1\n}\n```\n\nIf you're using minio as your backend, you should add the following additional options to the config file:\n\n```json\n{\n    \"s3_v4\" : true,\n    \"s3_endpoint\" : \"https://example.com\",\n}\n```\n\n# Example source data file\n\n```json data.json\n[\n  {\n    \"jail\": \"sshd\",\n    \"ip\": \"196.30.15.254\"\n  },\n  {\n    \"jail\": \"sshd\",\n    \"ip\": \"119.13.89.28\"\n  }\n]\n```\n\n# Thanks\n\n - [fail2ban](https://www.fail2ban.org)\n - [boto3](https://boto3.amazonaws.com)\n - [requests](https://docs.python-requests.org/en/master/index.html)\n - [schedule](https://schedule.readthedocs.io/en/stable/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaleman%2Ffail2ban-importer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaleman%2Ffail2ban-importer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaleman%2Ffail2ban-importer/lists"}