Skip to content

Commit 6099445

Browse files
schema validation
1 parent a632999 commit 6099445

File tree

1 file changed

+223
-85
lines changed
  • src/content/docs/api-shield/security/schema-validation

1 file changed

+223
-85
lines changed

src/content/docs/api-shield/security/schema-validation/index.mdx

Lines changed: 223 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar:
66

77
---
88

9-
import { GlossaryDefinition, GlossaryTooltip, Plan, Steps } from "~/components"
9+
import { GlossaryDefinition, GlossaryTooltip, Plan, Steps, Tabs, TabItem } from "~/components"
1010

1111
<Plan type="all" />
1212

@@ -33,43 +33,84 @@ To view the contents in your learned schema, refer to [Export a schema](/api-shi
3333

3434
### Add validation by uploading a schema
3535

36-
<Steps>
37-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
38-
2. Select **Security** > **API Shield**.
39-
3. Go to **Schema Validation** and select **Add validation**.
40-
4. Select your schema file for upload.
41-
5. Observe the listed endpoints, their host, method, and path. Any new endpoints will automatically be added to Endpoint Management.
42-
6. Choose an action for the non-compliant requests to your endpoints.
43-
7. Select **Add schema and endpoints**.
44-
</Steps>
36+
<Tabs syncKey="dashNewNav">
37+
<TabItem label="Old dashboard">
38+
<Steps>
39+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
40+
2. Select **Security** > **API Shield**.
41+
3. Go to **Schema Validation** and select **Add validation**.
42+
4. Select your schema file for upload.
43+
5. Observe the listed endpoints, their host, method, and path. Any new endpoints will automatically be added to Endpoint Management.
44+
6. Choose an action for the non-compliant requests to your endpoints.
45+
7. Select **Add schema and endpoints**.
46+
</Steps>
47+
</TabItem>
48+
<TabItem label="New dashboard" icon="rocket">
49+
<Steps>
50+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
51+
2. Go to **Security** > **Web assets** > **Schema Validation**.
52+
3. Select **Add validation**.
53+
4. Upload a schema file.
54+
5. Select **Add schema and endpoints**.
55+
</Steps>
56+
</TabItem>
57+
</Tabs>
4558

4659
:::note
4760
Changes may take a few minutes to process depending on the number of added endpoints.
4861
:::
4962

5063
### Add validation by applying a learned schema to a single endpoint
5164

52-
<Steps>
53-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
54-
2. Select **Security** > **API Shield**.
55-
3. Go to **Schema Validation** and filter by the learned schema available.
56-
4. Select **Apply learned schema**.
57-
5. Choose an action and select **Apply schema**.
58-
</Steps>
65+
<Tabs syncKey="dashNewNav">
66+
<TabItem label="Old dashboard">
67+
<Steps>
68+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
69+
2. Select **Security** > **API Shield**.
70+
3. Go to **Schema Validation** and filter by the learned schema available.
71+
4. Select **Apply learned schema**.
72+
5. Choose an action and select **Apply schema**.
73+
</Steps>
74+
</TabItem>
75+
<TabItem label="New dashboard" icon="rocket">
76+
<Steps>
77+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
78+
2. Go to **Security** > **Web assets** > **Schema Validation**.
79+
3. Select **Add validation**.
80+
4. Select **Apply learned schema**.
81+
5. Choose an action and select **Apply schema**.
82+
</Steps>
83+
</TabItem>
84+
</Tabs>
5985

6086
### Add validation by applying a learned schema to an entire hostname
6187

6288
At this time, learned schemas will not overwrite customer-uploaded schemas. If an endpoint is covered by a customer-uploaded schema and also appears in a learned schema, the **Changes** field is set to `Unaffected`.
6389

64-
<Steps>
65-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
66-
2. Select **Security** > **API Shield**.
67-
3. Go to **Schema Validation** and select **Add validation**.
68-
4. Select **Apply learned schema**.
69-
5. Choose a hostname and review the endpoints that will be protected by the learned schema.
70-
6. (Optional) Change the action if a request does not match the schema.
71-
7. Select **Apply schema**.
72-
</Steps>
90+
<Tabs syncKey="dashNewNav">
91+
<TabItem label="Old dashboard">
92+
<Steps>
93+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
94+
2. Select **Security** > **API Shield**.
95+
3. Go to **Schema Validation** and select **Add validation**.
96+
4. Select **Apply learned schema**.
97+
5. Choose a hostname and review the endpoints that will be protected by the learned schema.
98+
6. (Optional) Change the action if a request does not match the schema.
99+
7. Select **Apply schema**.
100+
</Steps>
101+
</TabItem>
102+
<TabItem label="New dashboard" icon="rocket">
103+
<Steps>
104+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
105+
2. Go to **Security** > **Web assets** > **Schema Validation**.
106+
3. Select **Add validation**.
107+
4. Select **Apply learned schema**.
108+
5. Choose a hostname and review the endpoints that will be protected by the learned schema.
109+
6. (Optional) Change the action if a request does not match the schema.
110+
7. Select **Apply schema**.
111+
</Steps>
112+
</TabItem>
113+
</Tabs>
73114

74115
:::note
75116
If an endpoint is currently protected by a learned schema, the date of the last applied learned schema will be shown in the current schema field.
@@ -83,35 +124,63 @@ By ensuring that all your endpoints in a schema are added to Endpoint Management
83124

84125
To set up a fallthrough action:
85126

86-
<Steps>
87-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
88-
2. Go to **Security** > **API Shield**.
89-
3. Under **Settings**, go to **Fallthrough settings**.
90-
4. Select **Use Template**.
91-
5. Choose one or more hostnames from the drop down menu. The fallthrough rule will act on all traffic that does not match an existing endpoint in Endpoint Management to the selected hostnames.
92-
6. Select **Continue to custom rule**.
93-
7. Name your rule and select your action.
94-
8. Select **Save as draft** to deploy later, or **Deploy** to deploy now.
95-
</Steps>
96-
97-
Your current fallthrough rules can be viewed in the custom rules list or in API Shield's settings under **Fallthrough settings**.
127+
<Tabs syncKey="dashNewNav">
128+
<TabItem label="Old dashboard">
129+
<Steps>
130+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
131+
2. Go to **Security** > **API Shield**.
132+
3. Under **Settings**, go to **Fallthrough settings**.
133+
4. Select **Use Template**.
134+
5. Choose one or more hostnames from the drop down menu. The fallthrough rule will act on all traffic that does not match an existing endpoint in Endpoint Management to the selected hostnames.
135+
6. Select **Continue to custom rule**.
136+
7. Name your rule and select your action.
137+
8. Select **Save as draft** to deploy later, or **Deploy** to deploy now.
138+
</Steps>
139+
</TabItem>
140+
<TabItem label="New dashboard" icon="rocket">
141+
<Steps>
142+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
143+
2. Go to **Security** > **Settings**.
144+
3. Under **Custom fallthrough rules**, select **Create custom fallthrough rule** to create a custom fallthrough rule with the template.
145+
4. Give your rule a descriptive name.
146+
5. Choose one or more hostnames from the dropdown menu and select your action.
147+
6. Select **Save as draft** to deploy later, or **Deploy** to deploy now.
148+
</Steps>
149+
</TabItem>
150+
</Tabs>
151+
152+
Your current fallthrough rules can be viewed in the custom rules list.
98153

99154
:::note
100155
You can use the `cf.api_gateway.fallthrough_triggered` syntax in your own custom rule for a more customized logic check. This detection will evaluate as `true` when a request does not match an endpoint in Endpoint Management, so it is important to check against your API's hostname or root path to ensure that you are not blocking any non-API traffic on your zone.
101156
:::
102157

103158
### Change the action of an entire schema
104159

105-
<Steps>
106-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
107-
2. Select **Security** > **API Shield**.
108-
3. Go to **Schema Validation** and select the schema in the Schema list.
109-
4. Check the multi-select box to select the endpoints shown on the current page.
110-
5. Choose **Select all endpoints**.
111-
6. Select **Change Action**.
112-
7. Choose an action from the dropdown menu.
113-
8. Select **Set action**.
114-
</Steps>
160+
<Tabs syncKey="dashNewNav">
161+
<TabItem label="Old dashboard">
162+
<Steps>
163+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
164+
2. Select **Security** > **API Shield**.
165+
3. Go to **Schema Validation** and select the schema in the Schema list.
166+
4. Check the multi-select box to select the endpoints shown on the current page.
167+
5. Choose **Select all endpoints**.
168+
6. Select **Change Action**.
169+
7. Choose an action from the dropdown menu.
170+
8. Select **Set action**.
171+
</Steps>
172+
</TabItem>
173+
<TabItem label="New dashboard" icon="rocket">
174+
<Steps>
175+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
176+
2. Go to **Security** > **Web assets** > **Schema Validation**.
177+
3. Check the multi-select box to select all endpoints associated with the schema.
178+
4. Select **Change Action**.
179+
5. Choose an action from the dropdown menu.
180+
6. Select **Set action**.
181+
</Steps>
182+
</TabItem>
183+
</Tabs>
115184

116185
### Change the global default action of Schema Validation
117186

@@ -123,16 +192,31 @@ Schema Validation’s default action is visible on the main Schema Validation pa
123192

124193
To change the default action:
125194

126-
<Steps>
127-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
128-
2. Go to **Security** > **API Shield**.
129-
3. Select **Schema Validation**.
130-
4. Under the default `Log` action, select **Change**.
131-
5. Choose a new action from the dropdown menu.
132-
6. Observe the current action and accept the change by selecting **Change default action** in the popup window.
133-
</Steps>
195+
<Tabs syncKey="dashNewNav">
196+
<TabItem label="Old dashboard">
197+
<Steps>
198+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
199+
2. Go to **Security** > **API Shield**.
200+
3. Select **Schema Validation**.
201+
4. Under the default `Log` action, select **Change**.
202+
5. Choose a new action from the dropdown menu.
203+
6. Observe the current action and accept the change by selecting **Change default action** in the popup window.
204+
</Steps>
205+
Alternatively, you can modify the global action via **Security** > **API Shield** > **Settings**.
206+
</TabItem>
207+
<TabItem label="New dashboard" icon="rocket">
208+
<Steps>
209+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
210+
2. Go to **Security** > **Web assets** > **Schema Validation**.
211+
3. Select **Schema Validation**.
212+
4. Under the default `Log` action, select **Change**.
213+
5. Choose a new action from the dropdown menu.
214+
6. Observe the current action and accept the change by selecting **Change default action** in the popup window.
215+
</Steps>
216+
Alternatively, you can modify the global action via **Security** > **Settings** > **Schema Validation**.
217+
</TabItem>
218+
</Tabs>
134219

135-
Alternatively, you can modify the global action via **Security** > **API Shield** > **Settings**.
136220

137221
### Change the action of a single endpoint
138222

@@ -142,53 +226,107 @@ This allows you to be stricter on blocking non-compliant requests on certain end
142226

143227
To change the action on an individual endpoint:
144228

145-
<Steps>
146-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
147-
2. Go to **Security** > **API Shield**.
148-
3. Select **Schema Validation** and filter the selected endpoint.
149-
4. Select the ellipses on the endpoint's row.
150-
5. Select **Change Action**.
151-
6. Choose a new action from the dropdown menu and select **Set action**.
152-
</Steps>
229+
<Tabs syncKey="dashNewNav">
230+
<TabItem label="Old dashboard">
231+
<Steps>
232+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
233+
2. Go to **Security** > **API Shield**.
234+
3. Select **Schema Validation** and filter the selected endpoint.
235+
4. Select the ellipses on the endpoint's row.
236+
5. Select **Change action**.
237+
6. Choose a new action from the dropdown menu and select **Set action**.
238+
</Steps>
239+
</TabItem>
240+
<TabItem label="New dashboard" icon="rocket">
241+
<Steps>
242+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
243+
2. Go to **Security** > **Web assets** > **Schema Validation**.
244+
3. Select **Schema Validation** and filter the selected endpoint.
245+
4. Select the ellipses on the endpoint's row.
246+
5. Select **Change action**.
247+
6. Choose a new action from the dropdown menu and select **Set action**.
248+
</Steps>
249+
</TabItem>
250+
</Tabs>
153251

154252
### Disable Schema Validation without changing actions
155253

156254
You can disable Schema Validation entirely for temporary troubleshooting. You can override all actions at once, preventing Schema Validation from taking any action while you complete your troubleshooting.
157255

158256
To disable Schema Validation without changing actions:
159257

160-
<Steps>
161-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
162-
2. Select **Security** > **API Shield**.
163-
3. Go to the **Schema Validation** settings.
164-
4. Select **Disable**.
165-
</Steps>
258+
<Tabs syncKey="dashNewNav">
259+
<TabItem label="Old dashboard">
260+
<Steps>
261+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
262+
2. Select **Security** > **API Shield**.
263+
3. Go to the **Schema Validation** settings.
264+
4. Select **Disable**.
265+
</Steps>
266+
</TabItem>
267+
<TabItem label="New dashboard" icon="rocket">
268+
<Steps>
269+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
270+
2. Go to **Security** > **Web assets** > **Schema Validation**.
271+
3. Select **Schema settings**.
272+
4. Filter by **API abuse**.
273+
5. Turn **Schema Validation** off.
274+
</Steps>
275+
</TabItem>
276+
</Tabs>
166277

167278
Your per-endpoint configurations will be saved when modifying the setting, so that you do not lose your configuration. To re-enable your configurations after troubleshooting, navigate back to the settings and select **Enable**.
168279

169280
### View active schemas
170281

171-
<Steps>
172-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
173-
2. Select **Security** > **API Shield**.
174-
3. Go to your **Schema Validation** settings.
175-
4. View your schemas under **Uploaded Schemas** and **Learned schemas**.
176-
5. Select **Filter** on the endpoints in either schema.
177-
</Steps>
282+
<Tabs syncKey="dashNewNav">
283+
<TabItem label="Old dashboard">
284+
<Steps>
285+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
286+
2. Select **Security** > **API Shield**.
287+
3. Go to your **Schema Validation** settings.
288+
4. View your schemas under **Uploaded Schemas** and **Learned schemas**.
289+
5. Select **Filter** on the endpoints in either schema.
290+
</Steps>
291+
</TabItem>
292+
<TabItem label="New dashboard" icon="rocket">
293+
<Steps>
294+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
295+
2. Go to **Security** > **Web assets** > **Schema Validation**.
296+
3. Select **Schema settings**.
297+
4. Filter by **API abuse**.
298+
5. View your schemas on **Schema Validation** > **Active schemas**.
299+
</Steps>
300+
</TabItem>
301+
</Tabs>
178302

179303
### Delete active schemas
180304

181305
Deleting the schema will remove validation from the currently associated endpoints, but it will not delete the endpoints from Endpoint Management.
182306

183307
To delete currently uploaded or learned schemas:
184308

185-
<Steps>
186-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
187-
2. Select **Security** > **API Shield**.
188-
3. Go to your **Schema Validation** settings.
189-
4. View your schemas under **Uploaded Schemas** and **Learned schemas**.
190-
5. Select the ellipses to access the menu and download or delete the listed schema.
191-
</Steps>
309+
<Tabs syncKey="dashNewNav">
310+
<TabItem label="Old dashboard">
311+
<Steps>
312+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
313+
2. Select **Security** > **API Shield**.
314+
3. Go to your **Schema Validation** settings.
315+
4. View your schemas under **Uploaded Schemas** and **Learned schemas**.
316+
5. Select the ellipses to access the menu and download or delete the listed schema.
317+
</Steps>
318+
</TabItem>
319+
<TabItem label="New dashboard" icon="rocket">
320+
<Steps>
321+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
322+
2. Go to **Security** > **Web assets** > **Schema Validation**.
323+
3. Select **Schema settings**.
324+
4. Filter by **API abuse**.
325+
5. View your schemas on **Schema Validation** > **Active schemas**.
326+
6. Select the ellipses to access the menu and download or delete the listed schema.
327+
</Steps>
328+
</TabItem>
329+
</Tabs>
192330

193331
## Specifications
194332

0 commit comments

Comments
 (0)