Skip to content

Commit ba0e6f2

Browse files
committed
Structure change
1 parent c4232ad commit ba0e6f2

File tree

5 files changed

+151
-117
lines changed

5 files changed

+151
-117
lines changed

src/content/docs/bots/concepts/bot/verified-bots/categories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pcx_content_type: reference
33
title: Verified bot categories
44
sidebar:
5-
order: 10
5+
order: 20
66
label: Categories
77

88
---
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
pcx_content_type: concept
3+
title: IP validation
4+
sidebar:
5+
order: 7
6+
label: IP validation
7+
8+
---
9+
10+
import { GlossaryTooltip, Steps } from "~/components"
11+
12+
The IP validation method aims to identify all of the IP addresses that a bot may use to send requests.
13+
14+
Cloudflare can achieve this in two ways:
15+
16+
- **Using IP list provided by the bot owner**: The bot owner can host a public list of IP ranges (for example, [Googlebot's list](https://developers.google.com/static/search/apis/ipranges/googlebot.json)). Cloudflare fetches and uses this list directly for validation.
17+
- **Using Domain-based reverse DNS**: The bot owner can provide a domain (or set of domains) that their bot requests originate from. Cloudflare collects the IP addresses observed in the requests with the bot's user agent, and performs reverse DNS lookups. If the reverse DNS of an IP resolves to one of the provided domains, Cloudflare considers it valid and stores it.
18+
19+
## Public IP List
20+
21+
To verify a bot using a public IP list, you need to provide:
22+
23+
- A fixed and limited set of IP addresses, which can be verified via publicly accessible plain-text, `JSON`, or `CSV`.
24+
- IP addresses used solely by the bot owner.
25+
- A user-agent match pattern.
26+
27+
## Reverse DNS
28+
29+
To verify a bot using reverse DNS, you need to provide:
30+
31+
- A list of domain suffixes to validate DNS records.
32+
- IP addresses should have PTR records set correctly.
33+
- A user-agent match pattern.
34+
35+
## Generic user-agents
36+
37+
User-agent patterns that match generic user-agents will be rejected by the Verified Bots API. When you add a user-agent pattern that is considered very common to the Verified Bot form, you may encounter an error message that will prompt you to correct the user-agent before you can submit again.
38+
39+
Generic user-agents include:
40+
41+
- `Dart`
42+
- `Go-http-client`
43+
- `GuzzleHttp`
44+
- `Google Chrome`
45+
- `Mozilla Firefox`
46+
- `Safari`
47+
- `Nessus`
48+
- `Websocket++`
49+
- `cloudflare-go`
50+
- `fasthttp`
51+
- `got`
52+
- `nginx-ssl early hints`
53+
- `node`
54+
- `node-fetch`
55+
- `okhttp`
56+
- `python-requests`
57+
- `uTorrent`
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
pcx_content_type: concept
3+
title: Overview
4+
sidebar:
5+
order: 3
6+
label: Overview
7+
8+
---
9+
10+
import { GlossaryTooltip } from "~/components"
11+
12+
A **verified bot** is a bot which has been added to Cloudflare's list of <GlossaryTooltip term="verified bot">verified bots</GlossaryTooltip>.
13+
14+
You can request for your bot to be added to Cloudflare's list of verified bots by filling out an [online application](https://dash.cloudflare.com/?to=/:account/configurations/verified-bots) in the Cloudflare dashboard.
15+
16+
## Verified bot requirement
17+
18+
For a bot to be verified, it must meet the following requirements:
19+
20+
1. The bot must follow [verified bots policy](/bots/concepts/bot/verified-bots/policy/).
21+
2. The bot must be verified using one of the following verification methods:
22+
- [Web Bot Auth](/bots/concepts/bot/verified-bots/web-bot-auth/)
23+
- [IP validation](/bots/concepts/bot/verified-bots/ip-validation/)
24+
25+
Once Cloudflare verifies a bot, it will appear on the [Cloudflare Radar's list of verified bots](https://radar.cloudflare.com/verified-bots).
26+
27+
:::note
28+
Bot operators who prefer not to create a free Cloudflare account can do so using our [old form](https://docs.google.com/forms/d/e/1FAIpQLSdqYNuULEypMnp4i5pROSc-uP6x65Xub9svD27mb8JChA_-XA/viewform?usp=sf_link), but the waiting time is up to several weeks for verified bot requests to be evaluated.
29+
:::
30+
31+
## Transient false negatives
32+
33+
Once Cloudflare lists a bot as a verified bot, this entry is cached and may get delisted if no traffic is seen in the Cloudflare network coming from the bot for a defined period of time.
34+
35+
It takes 24 hours for an inactive IP to be removed as a verified bot.
36+
37+
A bot can remain unlisted until Cloudflare sees traffic being sourced from the bot. When the bot is revalidated, it is listed as a verified bot again.

src/content/docs/bots/concepts/bot/verified-bots/requirements.mdx

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 56 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,17 @@
11
---
22
pcx_content_type: concept
3-
title: Verification methods
3+
title: Web Bot Auth
44
sidebar:
5-
order: 7
6-
label: Verification methods
5+
order: 6
6+
label: Web Bot Auth
77

88
---
99

1010
import { GlossaryTooltip, Steps } from "~/components"
1111

12-
To submit a verified bot that Cloudflare is not [currently tracking](https://radar.cloudflare.com/verified-bots), fill out an [online application](https://dash.cloudflare.com/?to=/:account/configurations/verified-bots) in the Cloudflare dashboard for the fastest possible results. Bot operators who prefer not to create a free Cloudflare account can do so using our [old form](https://docs.google.com/forms/d/e/1FAIpQLSdqYNuULEypMnp4i5pROSc-uP6x65Xub9svD27mb8JChA_-XA/viewform?usp=sf_link), but the waiting time is up to several weeks for verified bot requests to be evaluated.
12+
Web Bot Auth is an authentication method that leverages cryptographic signatures in HTTP messages to verify that a request comes from an automated bot.
1313

14-
Cloudflare can verify a bot in two ways:
15-
16-
- **Web Bot Auth**: An authentication method which leverages cryptographic signatures in HTTP messages to verify requests that come from an automated bot.
17-
- **IP validation**: An authentication method which identifies a bot by their range of IP addresses.
18-
19-
## Web Bot Auth
20-
21-
To authenticate a bot using Web Bot Auth, you need to:
22-
23-
1. Generate a valid signing key.
24-
2. Publish and host a URL which contains the public key derived from your signing key.
25-
3. Register your key directory URL with Cloudflare.
26-
27-
### 1. Generate a valid signing key
14+
## 1. Generate a valid signing key
2815

2916
You need to generate a signing key which will be used to authenticate your bot's requests.
3017

@@ -49,7 +36,7 @@ You need to generate a signing key which will be used to authenticate your bot's
4936

5037
By following these steps, you have generated a private key and a public key, then converted the public key to a JWK.
5138

52-
### 2. Host a key directory
39+
## 2. Host a key directory
5340

5441
You need to host a key directory which creates a way for Cloudflare to authenticate your bot's requests.
5542

@@ -94,7 +81,7 @@ Cloudflare will ignore all other key types and key parameters except those conta
9481

9582
You can use the Cloudflare-developed [`http-signature-directory` CLI tool](https://crates.io/crates/http-signature-directory) to assist you in validating your directory.
9683

97-
### 3. Register your bot and key directory
84+
## 3. Register your bot and key directory
9885

9986
You need to register your bot and its key directory to add your bot to the list of verified bots.
10087

@@ -115,99 +102,77 @@ The estimated review time is approximately 1 week.
115102
After successful verification, you will be able to send verified requests.
116103
:::
117104

118-
### 4. (After verification) Sign your requests
105+
## 4. (After verification) Sign your requests
119106

120107
After your bot has been successfully verified, you need to sign your bot's requests.
121108

122-
<Steps>
123-
1. Choose a set of components to sign. A component is either an HTTP header, or any [derived components](https://www.rfc-editor.org/rfc/rfc9421#name-derived-components) in the HTTP Message Signatures specification. Cloudflare recommends the following:
124-
- Choose at least the `@authority` derived component, which represents the domain you are sending requests to. For example, a request to `https://example.com` will be interpreted to have an `@authority` of `example.com`.
125-
- Use components that only contain ASCII values. HTTP Message Signature specification disallows non-ASCII characters, which will result in failure to validate your bot's requests.
126-
127-
:::note[Use components with only ASCII values]
128-
Cloudflare currently does not support `bs` or `sf` parameter designed to serialize non-ASCII values into ASCII equivalents.
129-
:::
130-
- Add a `Content-Digest` header if you wish to sign your [message content](https://www.rfc-editor.org/rfc/rfc9421#name-message-content), then specify `Content-Digest` as a component to sign.
131-
2. [Calculate the base64 URL-encoded JWK thumbprint](https://www.rfc-editor.org/rfc/rfc8037.html#appendix-A.3) associated with your Ed25519 public key registered with Cloudflare.
132-
3. Construct a [`Signature-Input` header](https://www.rfc-editor.org/rfc/rfc9421#name-the-signature-input-http-fi) over your chosen components. The header must meet the following requirements.
133-
134-
| Required component parameter | Requirement |
135-
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
136-
| `tag` | This should be equal to `web-bot-auth`. |
137-
| `alg` | This should be equal to `ed25519`. |
138-
| `keyid` | This should be equal to the thumbprint computed in step 2. |
139-
| `created` | This should be equal to a `Unix` timestamp associated with when the message was sent by your application. |
140-
| `expires` | This should be equal to a `Unix` timestamp associated with when Cloudflare should no longer attempt to verify the message. A short `expires` reduces the likelihood of replay attacks, and Cloudflare recommends choosing suitable short-lived intervals. |
141-
4. Construct a [`Signature` header](https://www.rfc-editor.org/rfc/rfc9421#name-the-signature-http-field) over your chosen components.
142-
5. Construct a [`Signature-Agent` header](https://www.ietf.org/archive/id/draft-meunier-http-message-signatures-directory-00.html#name-header-field-definition) that points to your key directory. Note that Cloudflare will fail to verify a message if:
143-
- The message includes a `Signature-Agent` header that is not an `https://`.
144-
- The message includes a valid URI but do not enclose it in double quotes.
145-
- The message has a valid `Signature-Agent` header, but does not include it in the component list in `Signature-Input`.
146-
6. Attach these three headers to your bot's requests.
147-
</Steps>
109+
### 4.1. Choose a set of components to sign
148110

149-
An example request may look like this:
111+
Choose a set of components to sign.
150112

151-
```txt
152-
Signature-Agent: "https://signature-agent.test"
153-
Signature-Input: sig2=("@authority" "signature-agent")
154-
;created=1735689600
155-
;keyid="poqkLGiymh_W0uP6PZFw-dvez3QJT5SolqXBCW38r0U"
156-
;alg="ed25519"
157-
;expires=1735693200
158-
;nonce="e8N7S2MFd/qrd6T2R3tdfAuuANngKI7LFtKYI/vowzk4lAZYadIX6wW25MwG7DCT9RUKAJ0qVkU0mEeLElW1qg=="
159-
;tag="web-bot-auth"
160-
Signature: sig2=:jdq0SqOwHdyHr9+r5jw3iYZH6aNGKijYp/EstF4RQTQdi5N5YYKrD+mCT1HA1nZDsi6nJKuHxUi/5Syp3rLWBA==:
161-
```
113+
A component is either an HTTP header, or any [derived components](https://www.rfc-editor.org/rfc/rfc9421#name-derived-components) in the HTTP Message Signatures specification. Cloudflare recommends the following:
114+
- Choose at least the `@authority` derived component, which represents the domain you are sending requests to. For example, a request to `https://example.com` will be interpreted to have an `@authority` of `example.com`.
115+
- Use components that only contain ASCII values. HTTP Message Signature specification disallows non-ASCII characters, which will result in failure to validate your bot's requests.
116+
117+
:::note[Use components with only ASCII values]
118+
Cloudflare currently does not support `bs` or `sf` parameter designed to serialize non-ASCII values into ASCII equivalents.
119+
:::
120+
- Add a `Content-Digest` header if you wish to sign your [message content](https://www.rfc-editor.org/rfc/rfc9421#name-message-content), then specify `Content-Digest` as a component to sign.
162121

163-
## IP validation
122+
### 4.2. Calculate the JWK thumbprint
164123

165-
There are two type of IP validation: public IP list and reverse DNS.
124+
[Calculate the base64 URL-encoded JWK thumbprint](https://www.rfc-editor.org/rfc/rfc8037.html#appendix-A.3) associated with your Ed25519 public key registered with Cloudflare.
166125

167-
### Public IP List
126+
### 4.3. Construct the required headers
168127

169-
To verify a bot using a public IP list, you need to provide:
128+
Construct the three required headers for Web Bot Auth.
170129

171-
- A fixed and limited set of IP addresses, which can be verified via publicly accessible plain-text, `JSON`, or `CSV`.
172-
- IP addresses used solely by the bot owner.
173-
- A user-agent match pattern.
130+
#### `Signature-Input` header
174131

175-
### Reverse DNS
132+
Construct a [`Signature-Input` header](https://www.rfc-editor.org/rfc/rfc9421#name-the-signature-input-http-fi) over your chosen components. The header must meet the following requirements.
176133

177-
To verify a bot using reverse DNS, you need to provide:
134+
| Required component parameter | Requirement |
135+
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
136+
| `tag` | This should be equal to `web-bot-auth`. |
137+
| `alg` | This should be equal to `ed25519`. |
138+
| `keyid` | This should be equal to the thumbprint computed in step 2. |
139+
| `created` | This should be equal to a `Unix` timestamp associated with when the message was sent by your application. |
140+
| `expires` | This should be equal to a `Unix` timestamp associated with when Cloudflare should no longer attempt to verify the message. A short `expires` reduces the likelihood of replay attacks, and Cloudflare recommends choosing suitable short-lived intervals. |
178141

179-
- A list of domain suffixes to validate DNS records.
180-
- IP addresses should have PTR records set correctly.
181-
- A user-agent match pattern.
142+
#### `Signature` header
182143

183-
## Generic user-agents
144+
Construct a [`Signature` header](https://www.rfc-editor.org/rfc/rfc9421#name-the-signature-http-field) over your chosen components.
184145

185-
User-agent patterns that match generic user-agents will be rejected by the Verified Bots API. When you add a user-agent pattern that is considered very common to the Verified Bot form, you may encounter an error message that will prompt you to correct the user-agent before you can submit again.
146+
#### `Signature-Agent` header
186147

187-
Generic user-agents include:
148+
Construct a [`Signature-Agent` header](https://www.ietf.org/archive/id/draft-meunier-http-message-signatures-directory-00.html#name-header-field-definition) that points to your key directory. Note that Cloudflare will fail to verify a message if:
149+
- The message includes a `Signature-Agent` header that is not an `https://`.
150+
- The message includes a valid URI but do not enclose it in double quotes.
151+
- The message has a valid `Signature-Agent` header, but does not include it in the component list in `Signature-Input`.
188152

189-
- `Dart`
190-
- `Go-http-client`
191-
- `GuzzleHttp`
192-
- `Google Chrome`
193-
- `Mozilla Firefox`
194-
- `Safari`
195-
- `Nessus`
196-
- `Websocket++`
197-
- `cloudflare-go`
198-
- `fasthttp`
199-
- `got`
200-
- `nginx-ssl early hints`
201-
- `node`
202-
- `node-fetch`
203-
- `okhttp`
204-
- `python-requests`
205-
- `uTorrent`
153+
### 4.4. Add the headers to your bot's requests
206154

155+
Attach these three headers to your bot's requests.
156+
157+
An example request may look like this:
158+
159+
```txt
160+
Signature-Agent: "https://signature-agent.test"
161+
Signature-Input: sig2=("@authority" "signature-agent")
162+
;created=1735689600
163+
;keyid="poqkLGiymh_W0uP6PZFw-dvez3QJT5SolqXBCW38r0U"
164+
;alg="ed25519"
165+
;expires=1735693200
166+
;nonce="e8N7S2MFd/qrd6T2R3tdfAuuANngKI7LFtKYI/vowzk4lAZYadIX6wW25MwG7DCT9RUKAJ0qVkU0mEeLElW1qg=="
167+
;tag="web-bot-auth"
168+
Signature: sig2=:jdq0SqOwHdyHr9+r5jw3iYZH6aNGKijYp/EstF4RQTQdi5N5YYKrD+mCT1HA1nZDsi6nJKuHxUi/5Syp3rLWBA==:
169+
```
207170

208171
## Additional resources
209172

210173
You may wish to refer to the following resources.
211174

175+
- Link to new blog TBC
176+
- Cloudflare blog: [Forget IPs: using cryptography to verify bot and agent traffic](https://blog.cloudflare.com/web-bot-auth/).
212177
- Cloudflare's [`web-bot-auth` library in Rust](https://crates.io/crates/web-bot-auth).
213178
- Cloudflare's [`web-bot-auth` npm package in Typescript](https://www.npmjs.com/package/web-bot-auth).

0 commit comments

Comments
 (0)