{"id":46283107,"url":"https://github.com/brahma-dev/ufw-bots","last_synced_at":"2026-03-04T06:18:44.766Z","repository":{"id":37724651,"uuid":"248218734","full_name":"brahma-dev/ufw-bots","owner":"brahma-dev","description":"List of datacenter IPs to block and script to automate it.","archived":false,"fork":false,"pushed_at":"2026-02-28T11:00:48.000Z","size":76032,"stargazers_count":24,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-28T15:36:36.701Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brahma-dev.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-03-18T11:56:22.000Z","updated_at":"2026-02-28T11:00:51.000Z","dependencies_parsed_at":"2026-02-28T13:02:53.583Z","dependency_job_id":null,"html_url":"https://github.com/brahma-dev/ufw-bots","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brahma-dev/ufw-bots","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brahma-dev%2Fufw-bots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brahma-dev%2Fufw-bots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brahma-dev%2Fufw-bots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brahma-dev%2Fufw-bots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brahma-dev","download_url":"https://codeload.github.com/brahma-dev/ufw-bots/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brahma-dev%2Fufw-bots/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30074035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-03-04T06:18:43.983Z","updated_at":"2026-03-04T06:18:44.754Z","avatar_url":"https://github.com/brahma-dev.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ufw-bots\n\nThis project provides lists of datacenter IP addresses and scripts to help you block them using `ufw` or `iptables`. By blocking these IPs, you can reduce the amount of bot traffic to your servers.\n\nIt gets ASNs of hosting providers from [O-X-L/risk-db-lists](https://github.com/O-X-L/risk-db-lists/blob/main/asn/kind_hosting.csv \"https://github.com/O-X-L/risk-db-lists/blob/main/asn/kind_hosting.csv\") and generates the subnet lists from that.\n\nI have excluded the following ASNs from the above list. See `notSoBadASNs` in `index.ts`\n- Cloudflare (13335)\n\nA GitHub workflow automatically updates the IP lists in this repo every 6 hours. You can directly download those if you need them for some other purpose like risk scores...\n\n## Safety Warning\n\n**Modifying firewall rules can be dangerous and may lock you out of your server if not done carefully.** Before using these scripts, please ensure you have:\n\n1.  **Backup access to your server:** This could be through a cloud provider's web console or physical access.\n2.  **Whitelisted your own IP address:** Make sure your current IP address is allowed by your firewall rules to prevent losing access. You can add a rule like `sudo ufw allow from YOUR_IP_ADDRESS to any` to allow your own IP.\n\n**Use these scripts at your own risk.**\n\n## Prerequisites\n\nYou must have [Bun](https://bun.sh) installed on your system to generate the firewall scripts.\n\n## Installation and Usage\n\n1.  **Clone the Repository**\n\n    ```bash\n    git clone https://github.com/brahma-dev/ufw-bots.git\n    cd ufw-bots\n    ```\n\n2.  **Install Dependencies**\n\n    ```bash\n    bun install\n    ```\n\n3.  **Generate the lists**\n\n    ```bash\n    bun start\n    ```\n\n    This command will generate `ipv4.txt`,`ipv6.txt` and `combined.txt` in the `files` directory.\n\n4.  **Run the Script**\n\n    You can inspect the scripts. When you are ready, run the appropriate script for your firewall:\n\n    *   **For UFW:**\n\n        ```bash\n        sudo ./files/ufw.sh\n        ```\n\n    *   **For IPTables:**\n\n        (Requires `ipset` to be installed)\n\n        ```bash\n        sudo ./files/iptables.sh\n        ```\n\n## Automating with Cron\n\nTo keep your blocklist updated automatically, you can set up a cron job. The safest way to run scheduled tasks that require root permissions is to add them to the `root` user's crontab.\n\n1.  Open the root user's crontab editor.\n\n    ```bash\n    sudo crontab -e\n    ```\n\n2.  Add one of the following lines to the file. This will run the update script every 6 hours. Make sure to replace `/path/to/ufw-bots` with the actual path to where you cloned the repository. Replace `bun` with it's full path if it's not in root's $PATH\n\n    *   **For UFW:**\n\n        ```cron\n        0 */6 * * * cd /path/to/ufw-bots \u0026\u0026 bun install \u0026\u0026 bun start \u0026\u0026 ./files/ufw.sh\n        ```\n\n        ```cron\n        0 */6 * * * cd /home/username/ufw-bots \u0026\u0026 /home/username/.bun/bin/bun install \u0026\u0026 /home/username/.bun/bin/bun start \u0026\u0026 ./files/ufw.sh\n        ```\n\n    *   **For IPTables:**\n\n        ```cron\n        0 */6 * * * cd /path/to/ufw-bots \u0026\u0026 bun install \u0026\u0026 bun start \u0026\u0026 ./files/iptables.sh\n        ```\n        ```cron\n        0 */6 * * * cd /home/username/ufw-bots \u0026\u0026 /home/username/.bun/bin/bun install \u0026\u0026 /home/username/.bun/bin/bun start \u0026\u0026 ./files/iptables.sh\n        ```\n\n3.  Save and exit the editor. The cron job is now active.\n\n## Uninstall\n\nIf you need to remove the firewall rules added by this script, follow these instructions.\n\n### UFW\n\n```bash\ncd /path/to/ufw-bots\nsudo ./files/ufw_remove.sh\n```\n\n### IPTables\n\n```bash\ncd /path/to/ufw-bots\nsudo ./files/iptables_remove.sh\n```\n\n### Help Needed\n\nShell expert to vet / improve the scripts.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrahma-dev%2Fufw-bots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrahma-dev%2Fufw-bots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrahma-dev%2Fufw-bots/lists"}