{"id":24983932,"url":"https://github.com/rubenhortas/fail2bangeolocation","last_synced_at":"2025-04-11T21:14:50.426Z","repository":{"id":44407255,"uuid":"499928889","full_name":"rubenhortas/fail2bangeolocation","owner":"rubenhortas","description":"Shows geolocation of failed attempts registered by fail2ban.","archived":false,"fork":false,"pushed_at":"2024-11-02T17:10:20.000Z","size":3568,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-11T21:14:44.617Z","etag":null,"topics":["ban","fail","fail2ban","geolocation","ip","python","python-3","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubenhortas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-04T20:22:22.000Z","updated_at":"2025-02-10T03:24:42.000Z","dependencies_parsed_at":"2024-09-12T01:32:39.045Z","dependency_job_id":"088148d4-1069-4237-88e2-c6f562530e67","html_url":"https://github.com/rubenhortas/fail2bangeolocation","commit_stats":{"total_commits":216,"total_committers":1,"mean_commits":216.0,"dds":0.0,"last_synced_commit":"98c469d73b1dd300afa103b21ddfd1d3bfe360f6"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenhortas%2Ffail2bangeolocation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenhortas%2Ffail2bangeolocation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenhortas%2Ffail2bangeolocation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenhortas%2Ffail2bangeolocation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubenhortas","download_url":"https://codeload.github.com/rubenhortas/fail2bangeolocation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480427,"owners_count":21110937,"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":["ban","fail","fail2ban","geolocation","ip","python","python-3","python3"],"created_at":"2025-02-04T09:40:37.400Z","updated_at":"2025-04-11T21:14:50.406Z","avatar_url":"https://github.com/rubenhortas.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fail2bangeolocation\n\nShows geolocation of failed attempts registered by *fail2ban*.  \nIt's useful to know from which locations you are being attacked the most.  \nYou can group locations by country or by country and by city.  \n\n![GitHub repo file count](https://img.shields.io/github/directory-file-count/rubenhortas/fail2bangeolocation)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/rubenhortas/fail2bangeolocation)\n![GitHub repo size](https://img.shields.io/github/repo-size/rubenhortas/fail2bangeolocation)\n\n![PyPI](https://img.shields.io/pypi/v/fail2bangeolocation?\u0026logo=pypi\u0026logoColor=yellow)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fail2bangeolocation?logo=python\u0026logoColor=yellow)\n![PyPI - Implementation](https://img.shields.io/pypi/implementation/fail2bangeolocation?logo=python\u0026logoColor=yellow)\n![PyPI - Wheel](https://img.shields.io/pypi/wheel/fail2bangeolocation?logo=pypi\u0026logoColor=yellow)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/fail2bangeolocation?\u0026logo=pypi\u0026logoColor=yellow)\n\n![GitHub issues](https://img.shields.io/github/issues-raw/rubenhortas/fail2bangeolocation?logo=github)\n![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/rubenhortas/fail2bangeolocation?logo=github)\n![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/rubenhortas/fail2bangeolocation?\u0026logo=github)\n![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed-raw/rubenhortas/fail2bangeolocation?logo=github)\n![GitHub all releases](https://img.shields.io/github/downloads/rubenhortas/fail2bangeolocation/total?logo=github)\n\n![GitHub](https://img.shields.io/github/license/rubenhortas/fail2bangeolocation)\n\n## Screenshots\n\n* Grouped by country\n\u003cimg src=\"https://github.com/rubenhortas/fail2bangeolocation/blob/main/screenshots/screenshot_grouped_by_country.png\" alt=\"Output grouped by country\" width=\"600\"\u003e\n\n* Grouped by country and city\n\u003cimg src=\"https://github.com/rubenhortas/fail2bangeolocation/blob/main/screenshots/screenshot_grouped_by_country_and_city.png\" alt=\"Output grouped by country and city\" width=\"600\"\u003e\n\n## reallyfreegeoip.org\n\nIP geolocation is done through [reallyfreegeoip.org](https://reallyfreegeoip.org). \nThis means you will need an active internet connection in order to geolocate the IPs.\n\n## Installation \n\nYou can install *fail2bangeolocation* via *pipx*:\n\n### Installation as user\n\n```shell\n$ pipx install fail2bangeolocation\n```\n\n### Installation as root\n\n```shell\n$ sudo su\n# pipx install fail2bangeolocation\n```\n\n## Usage\n\n* You can run *fail2bangeolocation* directly from the command line interface:\n\n  ```shell\n  fail2bangeolocation [-h] [-c] {fail2ban,log,server}\n  ```\n\n* *fail2bangeolocation* arguments\n\n  ```shell\n  usage: fail2bangeolocation.py [-h] [-c] {fail2ban,log,server} ...\n  \n  Shows geolocation of failed attempts registered by fail2ban\n  \n  positional arguments:\n    {fail2ban,log,server}\n                          These options are mutually exclusive\n      fail2ban            analyze all banned IPs by fail2ban (from fail2ban output)\n      log                 analyze a fail2ban log file. Use \"log -h\" to see more options\n      server              analyze all banned IPs by fail2ban (e.g. \"server sshd\")\n  \n  optional arguments:\n    -h, --help            show this help message and exit\n    -c, --show-city       group IPs by country and city \n  ```\n\n* ### Analyze all IPs registered by fail2ban \n\n  :warning: Requires root privileges  \n\n  Run *fail2bangeolocation* using the *fail2ban* argument:\n\n  ```shell\n  $ sudo su\n  # fail2bangeolocation fail2ban\n  ```\n\n* ### Analyze all IPs registered by fail2ban for a given jailed server/service, e.g. sshd \n\n  :warning: Requires root privileges  \n  Run *fail2bangeolocation* with the *server* argument and the jailed server name:\n\n  ```shell\n  $sudo su\n  # fail2bangeolocation server sshd\n  ```\n\n* ### Analyze a log file\n  :warning: May require root privileges depending on the file to be analyzed  \n  Run *fail2bangeolocation* with the *log* argument and the path to the log file:\n\n  ```shell\n  fail2bangeolocation log /var/log/fai2ban.log\n  ```\n\n  You can also geolocate the unbanned IPs contained in the log adding the **-u** argument:\n\n  ```shell\n  fail2bangeolocation log -u /var/log/fai2ban.log\n  ```\n  \n* ### Group the output by country and city\n  Run *fail2bangeolocation* with \"**-c**\" as first argument:\n\n  ```shell\n  fail2bangeolocation -c {fail2ban,log,server}\n  ```\n  \n## Troubleshooting\n\nIn case of any problem, you create an [issue](https://github.com/rubenhortas/fail2bangeolocation/issues/new).\n\n## Discussions\nIf you want ask (or answer) a question, leave an opinion or have an open-ended conversation you can create (or join) a [discussion](https://github.com/rubenhortas/fail2bangeolocation/discussions/new).\n\n## Support\n\nIf you find this application useful you can star this repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubenhortas%2Ffail2bangeolocation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubenhortas%2Ffail2bangeolocation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubenhortas%2Ffail2bangeolocation/lists"}