📦 SukkaW / cloudflare-block-bad-bot-ruleset

📄 README.md · 57 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57<p align="center">
<img src="https://i.loli.net/2018/10/30/5bd7b06b077df.png" width="200px">
</p>
<h1 align="center">Cloudflare Block Bad Bot Ruleset</h1>

<p align="center">
<a href="https://skk.moe" target="_blank"><img alt="Author" src="https://img.shields.io/badge/Author-Sukka-b68469.svg?style=flat-square"/></a>
<a href="./LICENSE" target="_blank"><img alt="License" src="https://img.shields.io/github/license/sukkaw/cloudflare-block-bad-bot-rules.svg?style=flat-square"/></a>
</p>

> Block bad, possibly even malicious web crawlers (automated bots) using Cloudflare Firewall Rules<br>
> 使用 Cloudflare Firewall Rules 拦截恶意网络爬虫(自动机器人)和其它恶意流量

## Introduction 简介

`Cloudflare Block Bad Bot Ruleset` projects stop and block Bad Bot, Spam Referrer, Adware, Malware and any other kinds of bad internet traffic ever reaching your web sites. Inspired by [nginx-badbot-blocker](https://github.com/mariusv/nginx-badbot-blocker) & worked with Cloudflare Firewall Rules.

`Cloudflare Block Bad Bot Ruleset` 可以阻止恶意爬虫、垃圾引荐来源、广告、恶意软件以及任何其他类型的恶意互联网流量到达您的网站。灵感来自 [nginx-badbot-blocker](https://github.com/mariusv/nginx-badbot-blocker) 并与 Cloudflare Firewall Rules 搭配使用。

## Precautions 注意事项

`Cloudflare Block Bad Bot Ruleset` mainly based on User-Agent, which is known to all that could be changed easily. So the project can not replace the Web Application Firewall.

`Cloudflare Block Bad Bot Ruleset` 主要基于 User-Agent,但是众所周知 User-Agent 可以伪装,所以本项目并不能取代正规的 Web Application Firewall。

## Ruleset 规则

Rule Name | File Name | Action | What For
---- | ---- | ---- | ----
Good Bot | [good-bot.rules](./good-bot.rules) | Allow | Match known good bot.<br>匹配已知的正常爬虫
Aliyun Yundun | [aliyun-yd.rules](./aliyun-yd.rules) | Block | Match Aliyun Yundun based on known IP cidr.<br>基于已知 IP 段匹配阿里云盾
Basic Crawler | [basic-crawler.rules](./basic-crawler.rules) | Block/Challenge | Block some known bad bot.<br>匹配一些基本的 HTTP Request 库
Bad Crawler | [bad-crawler.rules](./bad-crawler.rules) | Block/Challenge | Match mostly known bad bot, basic ruleset not included.<br>匹配绝大部分已知的恶意爬虫、SEO 爬虫和营销爬虫
Security Scanner | [security-scan-bot.rules](./security-scan-bot.rules) | Block/Challenge | Match mostly known security scanner.<br>匹配大部分已知的漏洞扫描爬虫

## Usage 用法

![](https://i.loli.net/2018/10/30/5bd801833e8d3.png)

## More Information 更多详情

- [Announcing Firewall Rules | Cloudflare Blog](https://blog.cloudflare.com/announcing-firewall-rules/)
- [Cloudflare Firewall Rules | Cloudflare Documentations](https://developers.cloudflare.com/firewall/)
- [nginx-badbot-blocker | GitHub](https://github.com/mariusv/nginx-badbot-blocker)
- [nginx-ultimate-bad-bot-blocker | GitHub](https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker)

## Todo List

- [ ] Bad referrer list
- [ ] Known bad IP List

## Maintainer 维护者

**Cloudflare Block Bad Bot Ruleset** © [Sukka](https://github.com/SukkaW), Released under the [MIT](./LICENSE) License.

> [Personal Website](https://skk.moe) · [Blog](https://blog.skk.moe) · GitHub [@SukkaW](https://github.com/SukkaW) · Telegram Channel [@SukkaChannel](https://t.me/SukkaChannel) · Twitter [@isukkaw](https://twitter.com/isukkaw) · Keybase [@sukka](https://keybase.io/sukka)