{"id":16634478,"url":"https://github.com/machou/cloudflare-block","last_synced_at":"2025-06-13T00:06:11.663Z","repository":{"id":122968037,"uuid":"43491939","full_name":"Machou/Cloudflare-Block","owner":"Machou","description":"Bash script that automatically activates Cloudflare's \"I'm Under Attack!\" mode if the server detects an attack.","archived":false,"fork":false,"pushed_at":"2024-08-20T09:29:14.000Z","size":65,"stargazers_count":87,"open_issues_count":0,"forks_count":27,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T21:49:43.333Z","etag":null,"topics":["api","cloudflare","server","shell","spam"],"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/Machou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2015-10-01T11:05:48.000Z","updated_at":"2025-04-07T02:29:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"69ca4b69-6ae0-460b-9a44-af60fef9489a","html_url":"https://github.com/Machou/Cloudflare-Block","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Machou/Cloudflare-Block","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Machou%2FCloudflare-Block","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Machou%2FCloudflare-Block/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Machou%2FCloudflare-Block/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Machou%2FCloudflare-Block/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Machou","download_url":"https://codeload.github.com/Machou/Cloudflare-Block/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Machou%2FCloudflare-Block/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259553131,"owners_count":22875609,"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":["api","cloudflare","server","shell","spam"],"created_at":"2024-10-12T05:38:20.419Z","updated_at":"2025-06-13T00:06:11.628Z","avatar_url":"https://github.com/Machou.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudflare-Block\n\nThis script enable *I'm Under Attack Mode* of [Cloudflare](https://www.cloudflare.com/) if your server's load average exceeds a predefined limit.\n\n**Cloudflare.sh** will create a file named **attacked** to check if the protection is *enabled* or *disabled*.\n\nLoad average is checked via a cron job (default: every 20 minutes)\n\n## Configuration\n\n### Script\n\n```bash\ngit clone https://github.com/Machou/Cloudflare-Block.git DDoS\n```\n\n### Configure you API\n\nCopy config file `config.template` to `config` and edit it:\nadd API keys (mandatory) and optionally change some of the other values.\n\n**API_KEY**: Your Global API Key (https://dash.cloudflare.com/profile)\n\n**MAIL_ACCOUNT**: Email of your Cloudflare account\n\n**DOMAIN**: Zone ID (https://dash.cloudflare.com/_zone-id_/domain.com)\n\n[Cloudflare API Documentation](https://api.cloudflare.com/#zone-settings-get-security-level-setting)\n\n| Mode         | Description   |\n|:------------:|:-------------:|\n| high         | Threat scores greater than 0 will be challenged   |\n| medium       | Threat scores greater than 14 will be challenged  |\n| low          | Threat scores greater than 24 will be challenged  |\n|under_attack  | Under Attack Mode                                 |\n\n### Cron\n\n```bash\ncrontab -e\n\n*/1 * * * * /root/DDoS/Cloudflare.sh 0 # check every 1 minute if protection is not enabled\n*/20 * * * * /root/DDoS/Cloudflare.sh 1 # check every 20 minutes if protection is enabled\n```\n\n### License\n\n**Cloudflare-Block** are distributed under the [The MIT License](https://opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachou%2Fcloudflare-block","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmachou%2Fcloudflare-block","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachou%2Fcloudflare-block/lists"}