JasonLovesDoggo/caddy-defender
JasonLovesDoggo/caddy-defender has 593 GitHub stars and 26 forks. Star changes are not measured yet. Last checked 2026-11-13 04:07 UTC. Last push 2026-11-09.
Caddy module to block or manipulate requests originating from AIs or cloud services trying to train on your websites
What you can do
- IP Range Filtering: Block or manipulate requests from specific IP ranges.
- Embedded IP Ranges: Predefined IP ranges for popular AI services (e.g., OpenAI, DeepSeek, GitHub Copilot).
- Custom IP Ranges: Add your own IP ranges via Caddyfile configuration.
- Block: Return a 403 Forbidden response.
측정된 스타 증가
- in 24h
- 기록 수집 중
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalCaddy Defender Plugin
The Caddy Defender plugin is a middleware for Caddy that allows you to block or manipulate requests based on the client's IP address. It is particularly useful for preventing unwanted traffic or polluting AI training data by returning garbage responses.
Features
- IP Range Filtering: Block or manipulate requests from specific IP ranges.
- Embedded IP Ranges: Predefined IP ranges for popular AI services (e.g., OpenAI, DeepSeek, GitHub Copilot).
- Custom IP Ranges: Add your own IP ranges via Caddyfile configuration.
- Multiple Responder Backends:
- Block: Return a
403 Forbiddenresponse. - Custom: Return a custom message.
- Drop: Drops the connection.
- Garbage: Return garbage data to pollute AI training.
- Redirect: Return a
308 Permanent Redirectresponse with a custom URL. - Ratelimit: Ratelimit requests, configurable via caddy-ratelimit.
- Tarpit: Stream data at a slow, but configurable rate to stall bots and pollute AI training.
- Block: Return a
Installation
Using Docker
The easiest way to use the Caddy Defender plugin is by using the pre-built Docker image.
Pull the Docker Image:
docker pull ghcr.io/jasonlovesdoggo/caddy-defender:latestRun the Container: Use the following command to run the container with your
Caddyfile:docker run -d \ --name caddy \ -v /path/to/Caddyfile:/etc/caddy/Caddyfile \ -p 80:80 -p 443:443 \ ghcr.io/jasonlovesdoggo/caddy-defender:latestReplace
/path/to/Caddyfilewith the path to yourCaddyfile.
Please see the online documentation for other methods of installation.
Configuration
Caddyfile Syntax
The defender directive is used to configure the Caddy Defender plugin. It has the following syntax:
defender <responder> {
message <custom message>
ranges <ip_ranges...>
url <url>
}
<responder>: The responder backend to use. Supported values are:block: Returns a403 Forbiddenresponse.custom: Returns a custom message (requiresmessage).drop: Drops the connection.garbage: Returns garbage data to pollute AI training.redirect: Returns a308 Permanent Redirectresponse (requiresurl).ratelimit: Marks requests for rate limiting (requires Caddy-Ratelimit to be installed as well ).tarpit: Stream data at a slow, but configurable rate to stall bots and pollute AI training.
<ip_ranges...>: An optional list of CIDR ranges or predefined range keys to match against the client's IP. Defaults toaws azurepubliccloud deepseek gcloud githubcopilot openai.<custom message>: A custom message to return when using thecustomresponder.<url>: The URI that theredirectresponder would redirect to.
For more information about the configuration, refer to the configuration page on the website.
Quick Start
The documentation website has info that includes the configurations of the plugin, code examples, and more.
For a quick start, follow the Getting Started guide to protect your server using the Caddy Defender Plugin.
For examples, check out docs/examples.md
Embedded IP Ranges
The plugin includes predefined IP ranges for popular AI services. These ranges are embedded in the binary and can be used without additional configuration.
| Service | Key | IP Ranges |
|---|---|---|
| Alibaba Cloud | aliyun | aliyun.go |
| VPNs | vpn | vpn.go |
| AWS | aws | aws.go |
| AWS Region | aws-us-east-1, aws-us-west-1, aws-eu-west-1 | aws_region.go |
| DeepSeek | deepseek | deepseek.go |
| GitHub Copilot | githubcopilot | github.go |
| Google Cloud Platform | gcloud | gcloud.go |
| Oracle Cloud Infrastructure | oci | oracle.go |
| Microsoft Azure | azurepubliccloud | azure.go |
| OpenAI | openai | openai.go |
| Mistral | mistral | mistral.go |
| Vultr | vultr | vultr.go |
| Cloudflare | cloudflare | cloudflare.go |
| Digital Ocean | digitalocean | digitalocean.go |
| Linode | linode | linode.go |
| Datadog | datadog | datadog.go |
| Private | private | private.go |
| All IP addresses | all | all.go |
Disabled by default (require manual inclusion at build time)
| Service | Key | IP Ranges |
|---|---|---|
| Tor Exit Nodes | tor | tor.go |
| ASN (Autonomous System Numbers) | asn | asn.go |
More are welcome! for a precompiled list, see the embedded results
Contributing
We welcome contributions! To get started, see CONTRIBUTING.md.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
- The inspiration for this project.
- bart - Karl Gaissmaier's efficient routing table implementation (Balanced ART adaptation) enabling our high-performance IP matching
- Built with ❤️ using Caddy.
Star History
관련 프로젝트 살펴보기
trimstray/the-book-of-secret-knowledge
영감을 주는 목록, 매뉴얼, 치트시트, 블로그, 팁, 원라이너, CLI/웹 도구 등을 모은 컬렉션.
258,060 스타Hack-with-Github/Awesome-Hacking
해커, 펜테스터, 보안 연구자를 위한 다양한 Awesome 목록 모음.
125,360 스타swisskyrepo/PayloadsAllTheThings
웹 애플리케이션 보안과 모의 침투 테스트/CTF에 유용한 페이로드 및 우회 방법 목록.
82,623 스타caddyserver/caddy
빠르고 확장 가능한 멀티플랫폼 HTTP/1-2-3 웹 서버이며, 자동 HTTPS를 지원합니다
79,020 스타