Skip to content

Commit a9b814d

Browse files
Merge branch 'production' into WAF_updates
2 parents 63e669b + a7047db commit a9b814d

File tree

19 files changed

+364
-33
lines changed

19 files changed

+364
-33
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
/src/content/docs/cloudflare-for-platforms/workers-for-platforms/ @irvinebroque @angelampcosta @GregBrimble @cloudflare/deploy-config @cloudflare/pcx-technical-writing
141141
/src/content/docs/workers/observability/ @irvinebroque @mikenomitch @rohinlohe @ToriLindsay @cloudflare/pcx-technical-writing
142142
/src/content/docs/workers/static-assets @irvinebroque @GregBrimble @WalshyDev @ToriLindsay @cloudflare/deploy-config @cloudflare/pcx-technical-writing
143-
/src/content/docs/workflows/ @ToriLindsay @elithrar @celso @sidharthachatterjee @cloudflare/pcx-technical-writing
143+
/src/content/docs/workflows/ @elithrar @celso @sidharthachatterjee @cloudflare/pcx-technical-writing
144144

145145
# DDoS Protection
146146

13.8 MB
Loading
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: Import `env` to access bindings in your Worker's global scope
3+
description: More easily configure your Worker and call bindings from anywhere with an importable `env`
4+
products:
5+
- workers
6+
date: 2025-03-17T15:00:00Z
7+
---
8+
9+
import { Render, TypeScriptExample } from "~/components";
10+
11+
You can now access [bindings](/workers/runtime-apis/bindings/)
12+
from anywhere in your Worker by importing the `env` object from `cloudflare:workers`.
13+
14+
Previously, `env` could only be accessed during a request. This meant that
15+
bindings could not be used in the top-level context of a Worker.
16+
17+
Now, you can import `env` and access bindings such as [secrets](/workers/configuration/secrets/)
18+
or [environment variables](/workers/configuration/environment-variables/) in the
19+
initial setup for your Worker:
20+
21+
```js
22+
import { env } from "cloudflare:workers";
23+
import ApiClient from "example-api-client";
24+
25+
// API_KEY and LOG_LEVEL now usable in top-level scope
26+
const apiClient = ApiClient.new({ apiKey: env.API_KEY });
27+
const LOG_LEVEL = env.LOG_LEVEL || "info";
28+
29+
export default {
30+
fetch(req) {
31+
// you can use apiClient or LOG_LEVEL, configured before any request is handled
32+
},
33+
};
34+
```
35+
36+
:::note
37+
Workers do not allow I/O from outside a request context. This means that even
38+
though `env` is accessible from the top-level scope, you will not be able to access
39+
every binding's methods.
40+
41+
For instance, environment variables and secrets are accessible, and you are able to
42+
call `env.NAMESPACE.get` to get a [Durable Object stub](/durable-objects/api/stub/) in the
43+
top-level context. However, calling methods on the Durable Object stub, making [calls to a KV store](/kv/api/),
44+
and [calling to other Workers](/workers/runtime-apis/bindings/service-bindings) will not work.
45+
:::
46+
47+
Additionally, `env` was normally accessed as a argument to a Worker's entrypoint handler,
48+
such as [`fetch`](/workers/runtime-apis/fetch/).
49+
This meant that if you needed to access a binding from a deeply nested function,
50+
you had to pass `env` as an argument through many functions to get it to the
51+
right spot. This could be cumbersome in complex codebases.
52+
53+
Now, you can access the bindings from anywhere in your codebase
54+
without passing `env` as an argument:
55+
56+
```js
57+
// helpers.js
58+
import { env } from "cloudflare:workers";
59+
60+
// env is *not* an argument to this function
61+
export async function getValue(key) {
62+
let prefix = env.KV_PREFIX;
63+
return await env.KV.get(`${prefix}-${key}`);
64+
}
65+
```
66+
67+
For more information, see [documentation on accessing `env`](/workers/runtime-apis/bindings#how-to-access-env).
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Retry Pages & Workers Builds Directly from GitHub
3+
description: Rerun builds for your Workers and Pages projects directly inside of GitHub.
4+
products:
5+
- workers
6+
- pages
7+
date: 2025-03-17T11:00:00Z
8+
---
9+
10+
You can now retry your Cloudflare Pages and Workers builds directly from GitHub. No need to switch to the Cloudflare Dashboard for a simple retry!
11+
12+
![Workers Builds GitHub Reruns](src/assets/images/changelog/workers/builds-rerun.gif)
13+
14+
Let’s say you push a commit, but your build fails due to a spurious error like a network timeout. Instead of going to the Cloudflare Dashboard to manually retry, you can now rerun the build with just a few clicks inside GitHub, keeping you inside your workflow.
15+
16+
For Pages and Workers projects connected to a GitHub repository:
17+
18+
1. When a build fails, go to your GitHub repository or pull request
19+
2. Select the failed Check Run for the build
20+
3. Select "Details" on the Check Run
21+
4. Select "Rerun" to trigger a retry build for that commit
22+
23+
Learn more about [Pages Builds](/pages/configuration/git-integration/github-integration/) and [Workers Builds](/workers/ci-cd/builds/git-integration/github-integration/).
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
pcx_content_type: reference
3+
title: Custom dashboards
4+
sidebar:
5+
order: 8
6+
7+
---
8+
9+
Custom dashboards allow you to create tailored dashboards to monitor application security, performance, and usage. You can create monitors for ongoing monitoring of a previous incident, use them to identify indicators of suspicious activity, and access templates to help you get started.
10+
11+
Dashboards provide a visual interface that displays key metrics and analytics, helping you monitor and analyze data efficiently. Different dashboards serve different purposes. For example, a security dashboard tracks attack attempts and threats, a performance dashboard monitors API latency and uptime, and a usage dashboard analyzes traffic patterns and user behavior.
12+
13+
Different metrics serve distinct roles in providing insights into your application’s performance. For example, total HTTP requests offers an overview of traffic volume, while average response time helps assess application speed. Additionally, usage metrics such as traffic patterns and user behavior provide insight into how users interact with your application. These metrics together enable you to spot trends, identify problems, and make informed, data-driven decisions.
14+
15+
:::note
16+
Custom Dashboards is currently available to customers participating in the Log Explorer beta. To begin using custom dashboards, you will first need to request access to [Log Explorer](/logs/log-explorer/).
17+
:::
18+
19+
## Create a new dashboard
20+
21+
To create a new dashboard, log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account. Then, navigate to **Analytics & Logs** and open the **Dashboards** section.
22+
23+
When creating a dashboard, you have two options: building one from scratch or using a pre-designed template.
24+
25+
- A **from-scratch dashboard** gives you full control over its structure, allowing you to choose the exact datasets, metrics, and visualizations that fit your needs. This approach is ideal if you have specific monitoring goals or need a highly customized view of your data.
26+
- On the other hand, **templates** provide a faster way to set up a dashboard with commonly used metrics and charts. They are useful for standard use cases, such as monitoring security threats, API performance, or bot traffic. Templates help you get started quickly while still allowing modifications to fit your requirements.
27+
28+
Choosing between these options depends on whether you need a quick setup with predefined insights or a fully customized dashboard tailored to your unique analysis needs.
29+
30+
### Create a dashboard from scratch
31+
32+
When creating a dashboard from scratch, select the option **Create a new**. You can follow the instructions in the following sections to start adding charts to your dashboard.
33+
34+
#### Create a new chart
35+
36+
To create a new chart, select **Add chart**. There are two ways to create a chart:
37+
38+
- **Use a prompt**: Enter a query like `Compare status code ranges over time`. The AI model decides the most appropriate visualization and constructs your chart configuration.
39+
- **Customize your chart**: Select the chart elements manually, including the chart type, title, dataset to query, metrics, and filters. This option gives you full control over your chart’s structure.
40+
41+
Refer to the following sections for more information about the charts, datasets, fields, metrics, and filters available.
42+
43+
##### Chart types
44+
45+
The available chart types include:
46+
47+
- **Timeseries**: Displays trends over time, enabling comparisons across multiple series.
48+
- **Categorical**: Compares proportions across different series.
49+
- **Stat**: Highlights a single value, showing its delta and sparkline for quick insights.
50+
- **Percentage**: Represents one value as a percentage of another.
51+
- **Top N**: Identifies the highest-ranking values for a given attribute.
52+
53+
##### Datasets and metrics
54+
55+
The available metrics and filters vary based on the dataset you want to use. For example, when using the HTTP Requests dataset, you can select **origin response duration** as a metric. You can then choose your preferred aggregation method for that metric, such as total, median, or quantiles. The following table outlines the datasets, fields, and available metrics:
56+
57+
58+
| Dataset | Field | Definition | Metrics |
59+
|-----------------|-----------------|------------|---------|
60+
| HTTP Requests | Requests | The number of requests sent by a client to a server over the HTTP protocol. | Total |
61+
| | DNS Response Time | The time taken for a DNS query to be resolved, measured from when a request is made to when a response is received. | Total, Average, Median, 95th percentile, 99th percentile |
62+
| | Time to First Byte | The duration from when a request is made to when the first byte of the response is received from the server. | Total, Average, Median, 95th percentile, 99th percentile |
63+
| | Bytes returned to the Client | The amount of data (in bytes) sent from the server to the client in response to requests. | Total, Average, Median, 95th percentile, 99th percentile |
64+
| | Number of visits | Unique visits or sessions to a website or application. | Total |
65+
| | Origin response duration | The time taken by the origin server to process and respond to a request. | Total, Average, Median, 95th percentile, 99th percentile |
66+
| Security Events | Security events | Actions taken by Application Security products such as WAF and Bot Management. | Total |
67+
68+
##### Filters
69+
70+
You can also adjust the scope of your analytics by entering filter conditions. This allows you to focus on the most relevant data.
71+
72+
1. Select **Add filter**.
73+
2. Select a **field**, an **operator**, and a **value**. For example, to filter events by source IP address, select the _Source IP_ field, select the _equals_ operator, and enter the _IP address_.
74+
3. Select **Apply**.
75+
76+
### Create a dashboard from a template
77+
78+
Alternatively, you can choose to create your dashboard using a pre-designed dashboard template. The templates available are:
79+
80+
- **Bot monitoring**: Allows you to identify automated traffic accessing your website.
81+
- **API Security**: Allows you to monitor data transfers and exceptions for API endpoints in your application.
82+
- **API Performance**: Allows you to view timing data for API endpoints in your application, along with error rates.
83+
- **Account takeover**: Allows you to monitor login attempts, usage of leaked credentials, and account takeover attacks.
84+
85+
## Edit a dashboard or chart
86+
87+
After creating your dashboard, to view your saved dashboards, select **Back to all dashboards** to access the full list. Regardless of the way you choose to create your dashboard, you can always edit existing charts and add new ones as needed.
88+
89+
## Further analysis
90+
91+
For each chart, you can:
92+
93+
- Review related traffic in [Security Analytics](/waf/analytics/security-analytics/).
94+
- Explore detailed logs in [Log Explorer](/logs/log-explorer/).
95+
96+
This ensures deeper insights into your application's security, performance, and usage patterns.

src/content/docs/api-shield/management-and-monitoring/endpoint-labels.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ title: Endpoint labeling service
55
sidebar:
66
order: 1
77
label: Labeling service
8-
98
---
109

11-
import { Render } from "~/components"
10+
import { Render } from "~/components";
1211

1312
API Shield's labeling service will help you organize your endpoints and address vulnerabilities in your API. The labeling service comes with managed and user-defined labels.
1413

@@ -46,6 +45,8 @@ Use managed labels to identify endpoints by use case. Cloudflare may automatical
4645

4746
`cf-rss-feed`: Add this label to endpoints that expect traffic from RSS clients.
4847

48+
`cf-llm`: Services that are (partially) powered by Large Language Model (LLM).
49+
4950
### Risk labels
5051

5152
Cloudflare automatically runs risk scans every 24 hours on your saved endpoints. API Shield applies these labels when a scan finds security risks on your endpoints. A corresponding Security Center Insight is also raised when risks are found.
@@ -58,11 +59,11 @@ Cloudflare automatically runs risk scans every 24 hours on your saved endpoints.
5859

5960
`cf-risk-missing-schema`: Automatically added when a learned schema is available for an endpoint that has no active schema.
6061

61-
`cf-risk-error-anomaly`: Automatically added when an endpoint experiences a recent increase in response errors over the last 24 hours.
62+
`cf-risk-error-anomaly`: Automatically added when an endpoint experiences a recent increase in response errors over the last 24 hours.
6263

63-
`cf-risk-latency-anomaly`: Automatically added when an endpoint experiences a recent increase in response latency over the last 24 hours.
64+
`cf-risk-latency-anomaly`: Automatically added when an endpoint experiences a recent increase in response latency over the last 24 hours.
6465

65-
`cf-risk-size-anomaly`: Automatically added when an endpoint experiences a spike in response body size over the last 24 hours.
66+
`cf-risk-size-anomaly`: Automatically added when an endpoint experiences a spike in response body size over the last 24 hours.
6667

6768
:::note
6869
Cloudflare will only add authentication labels to endpoints with successful response codes. Refer to the below table for more details.
@@ -108,4 +109,4 @@ Alternatively, you can create a user-defined label via Endpoint Management in AP
108109

109110
## Availability
110111

111-
Endpoint Management's labeling service is currently available to Enterprise API Shield subscribers.
112+
Endpoint Management's labeling service is currently available to Enterprise API Shield subscribers.

src/content/docs/fundamentals/api/how-to/create-via-api.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Create tokens via API
33
pcx_content_type: how-to
4+
description: Learn how to create API tokens via Cloudflare's API. Follow steps to define access policies, set restrictions, and generate tokens securely.
45
sidebar:
56
order: 3
67

src/content/docs/fundamentals/api/how-to/make-api-calls.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Make API calls
3+
description: Learn how to make API calls using Cloudflare's API with step-by-step instructions for Windows, including using curl and PowerShell, and handling JSON.
34
pcx_content_type: how-to
45
sidebar:
56
order: 2

src/content/docs/fundamentals/setup/account/account-security/multi-factor-email-authentication.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Multi-Factor Email Authentication
33
pcx_content_type: troubleshooting
4-
4+
description: Cloudflare's Multi-Factor Email Authentication prevents unauthorized access by sending one-time codes to your email.
55
---
66

77
## Overview

src/content/docs/fundamentals/setup/manage-domains/move-domain.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
pcx_content_type: reference
33
title: Move a domain between Cloudflare accounts
4+
description: Learn how to transfer a domain between Cloudflare accounts, including requirements, DNS settings, and SSL/TLS certificate management for seamless migration.
45

56
---
67

0 commit comments

Comments
 (0)