Skip to content

Commit 009e66c

Browse files
committed
Update policies
1 parent 4ed5eff commit 009e66c

File tree

4 files changed

+73
-33
lines changed

4 files changed

+73
-33
lines changed

src/content/docs/page-shield/policies/create-dashboard.mdx

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ sidebar:
77
description: Learn how to create a Page Shield policy in the Cloudflare dashboard.
88
---
99

10+
import { Tabs, TabItem } from "~/components";
11+
12+
<Tabs syncKey="dashNewNav"> <TabItem label="Old dashboard">
13+
1014
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account and domain.
1115

12-
2. Go to **Page Shield** > **Policies**.
16+
2. Go to **Security** > **Page Shield** > **Policies**.
1317

1418
3. Select **Create policy**.
1519

16-
4. <a id="rule-form" />
17-
Enter a descriptive name for the rule in **Description**.
20+
4. Enter a descriptive name for the rule in **Description**.
1821

1922
5. Under **If incoming requests match**, define the policy scope. You can use the Expression Builder (specifying one or more values for **Field**, **Operator**, and **Value**) or manually enter an expression using the Expression Editor. For more information, refer to [Edit expressions in the dashboard](/ruleset-engine/rules-language/expressions/edit-expressions/).
2023

@@ -33,3 +36,38 @@ description: Learn how to create a Page Shield policy in the Cloudflare dashboar
3336
- _Log_: Logs any policy violations without blocking any resources not covered by the policy.
3437

3538
8. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**.
39+
40+
</TabItem> <TabItem label="New dashboard" icon="rocket">
41+
42+
:::note
43+
In the [new security dashboard](/security/), policies are called content security rules.
44+
:::
45+
46+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account and domain.
47+
48+
2. Go to **Security** > **Security rules**.
49+
50+
3. Select **Create** > **Content security rules**.
51+
52+
4. <a id="rule-form" />
53+
Enter a descriptive name for the rule in **Description**.
54+
55+
5. Under **If incoming requests match**, define the scope of the content security rule (or policy). You can use the Expression Builder (specifying one or more values for **Field**, **Operator**, and **Value**) or manually enter an expression using the Expression Editor. For more information, refer to [Edit expressions in the dashboard](/ruleset-engine/rules-language/expressions/edit-expressions/).
56+
57+
6. Under **Allow these directives**, select the desired [CSP directives](/page-shield/policies/csp-directives/) for the content security rule by enabling one or more checkboxes.
58+
59+
- To manually enter an allowed source, select **Add source**.
60+
- To refresh the displayed sources based on detected resources, select **Refresh suggestions**.
61+
62+
:::note
63+
Cloudflare provides suggestions for **Default**, **Scripts**, and **Connections** directives. For the **Default** directive, suggestions are based on monitored scripts and connections resources.
64+
:::
65+
66+
7. Under **Then take action**, select the desired action:
67+
68+
- _Allow_: Enforces the CSP directives configured in the content security rule, blocking any other resources from being loaded on your website, and logging any [policy violations](/page-shield/policies/violations/).
69+
- _Log_: Logs any rule violations without blocking any resources not covered by the content security rule.
70+
71+
8. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**.
72+
73+
</TabItem> </Tabs>

src/content/docs/page-shield/policies/csp-directives.mdx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,23 @@ sidebar:
55
order: 6
66
head: []
77
description: CSP directives supported by policies
8-
98
---
109

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

13-
Page Shield policies support most <GlossaryTooltip term="content security policy (CSP)">Content Security Policy (CSP)</GlossaryTooltip> directives, covering both monitored and unmonitored resources. You can use a policy to control other types of resources besides scripts and their connections, even though Page Shield is not monitoring these resources.
12+
Page Shield policies support most <GlossaryTooltip term="content security policy (CSP)">Content Security Policy (CSP)</GlossaryTooltip> directives, covering both monitored and unmonitored resources. You can use a policy to control other types of resources besides scripts and their connections, even though Cloudflare is not monitoring these resources.
1413

1514
Each CSP directive can contain multiple values, including:
1615

17-
* Schemes
18-
* Hostnames
19-
* URIs
20-
* Special keywords between single quotes (for example, `'none'`)
21-
* Hashes between single quotes (for example, `'sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC'`)
16+
- Schemes
17+
- Hostnames
18+
- URIs
19+
- Special keywords between single quotes (for example, `'none'`)
20+
- Hashes between single quotes (for example, `'sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC'`)
2221

2322
Hostname and URI values support a `*` wildcard for the leftmost subdomain.
2423

25-
The following table lists the supported CSP directives and special values you can use in Page Shield policies:
26-
27-
24+
The following table lists the supported CSP directives and special values you can use in policies:
2825

2926
| Directive | Name in the dashboard | Supported special values | Monitored |
3027
| --------------------------- | ------------------------- | ------------------------------------------------------------------------------ | ---------------------------------------------------------- |
@@ -45,11 +42,9 @@ The following table lists the supported CSP directives and special values you ca
4542
| `frame-ancestors` | Frame ancestors | `'none'`<br/>`'self'` | No |
4643
| `upgrade-insecure-requests` | Upgrade insecure requests | N/A | No |
4744

48-
49-
5045
## More resources
5146

5247
For more information on CSP directives and their values, refer to the following resources in the MDN documentation:
5348

54-
* [Content-Security-Policy response header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy)
55-
* [CSP guide](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP)
49+
- [Content-Security-Policy response header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy)
50+
- [CSP guide](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP)

src/content/docs/page-shield/policies/index.mdx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,30 @@ Only available to Enterprise customers with a paid add-on.
1515

1616
Policies define the resources allowed on your applications through <GlossaryTooltip term="content security policy (CSP)">Content Security Policy (CSP)</GlossaryTooltip> directives. Policies can log violations and also enforce an allowlist of resources, effectively blocking resources not included in the policies.
1717

18+
In the [new security dashboard](/security/), policies are called content security rules, and they are one of the available types of [security rules](/security/rules/). Security rules perform security-related actions on incoming requests that match specified filters.
19+
1820
Create [allow policies](#policy-actions) to define a positive security model, also known as positive blocking. According to this model, you define what is allowed and reject everything else. Such an approach helps you reduce the attack surface for unwanted third-party scripts in your application.
1921

20-
A policy can control both resources monitored by Page Shield, such as scripts and their connections, and other types of resources. Refer to [Supported CSP directives](/page-shield/policies/csp-directives/) for details.
22+
A policy can control both client-side resources monitored by Cloudflare, such as scripts and their connections, and other types of resources. Refer to [Supported CSP directives](/page-shield/policies/csp-directives/) for details.
23+
24+
### Important remarks
2125

22-
:::note
2326
Third-party service providers may require specific CSP directives. Refer to your provider's documentation for more information on the CSP directives you need to include in your policy.
24-
:::
2527

2628
## Policy actions
2729

28-
A policy can perform one of the following actions:
30+
A policy — or content security rule — can perform one of the following actions:
2931

30-
- **Log**: Page Shield will log any resources not covered by the policy, without blocking any resources. Use this action to validate a new policy before deploying it. Resources not covered by the policy will be reported as [policy violations](/page-shield/policies/violations/).
31-
- **Allow**: Page Shield will block any resources not explicitly allowed by the policy. Switch to the _Allow_ action after validating a new policy with the _Log_ action, so that your policy does not block essential application resources, which would affect your application's end users. Policies with the _Allow_ action will log [policy violations](/page-shield/policies/violations/) for any blocked resources.
32+
- **Log**: Cloudflare will log any resources not covered by the policy, without blocking any resources. Use this action to validate a new policy before deploying it. Resources not covered by the policy will be reported as [policy violations](/page-shield/policies/violations/).
33+
- **Allow**: Cloudflare will block any resources not explicitly allowed by the policy. Switch to the _Allow_ action after validating a new policy with the _Log_ action, so that your policy does not block essential application resources, which would affect your application's end users. Policies with the _Allow_ action will log [policy violations](/page-shield/policies/violations/) for any blocked resources.
3234

33-
For details on the CSP directives Page Shield creates for each type of policy action, refer to [How Page Shield works](/page-shield/how-it-works/#positive-security-model-using-policies). For more information on the CSP directives supported by Page Shield policies, refer to [Supported CSP directives](/page-shield/policies/csp-directives/).
35+
For details on the CSP directives Cloudflare creates for each type of policy action, refer to [How Page Shield works](/page-shield/how-it-works/#positive-security-model-using-policies). For more information on the CSP directives supported by policies, refer to [Supported CSP directives](/page-shield/policies/csp-directives/).
3436

3537
## Next steps
3638

37-
Refer to the following pages for instructions on creating a policy in Page Shield:
39+
Refer to the following pages for instructions on creating a policy or content security rule:
3840

3941
- [Create a policy in the dashboard](/page-shield/policies/create-dashboard/)
4042
- [Page Shield API: Create a policy](/page-shield/reference/page-shield-api/#create-a-policy)
4143

42-
Once you have configured one or more allow policies in a zone you can filter alert notifications according to those policies. These alerts are called [scoped alerts](/page-shield/alerts/#scoped-alerts).
44+
Once you have configured one or more allow policies in a zone, you can filter alert notifications according to those policies. These alerts are called [scoped alerts](/page-shield/alerts/#scoped-alerts).

src/content/docs/page-shield/policies/violations.mdx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pcx_content_type: concept
44
sidebar:
55
order: 4
66
head: []
7-
description: Page Shield reports any violations to your custom Page Shield policies.
7+
description: Cloudflare reports any violations to your content security rules (also known as policies).
88
---
99

1010
import { Details, GlossaryTooltip } from "~/components";
@@ -13,16 +13,21 @@ import { Details, GlossaryTooltip } from "~/components";
1313
Only available to Enterprise customers with a paid add-on.
1414
:::
1515

16-
Shortly after you configure Page Shield policies, the Cloudflare dashboard will start displaying any violations of those policies. This information will be available for policies with any [action](/page-shield/policies/#policy-actions) (_Allow_ and _Log_).
16+
Shortly after you configure policies (or content security rules), the Cloudflare dashboard will start displaying any violations of those policies. This information will be available for policies with any [action](/page-shield/policies/#policy-actions) (_Allow_ and _Log_).
1717

1818
Information about policy violations is also available via [GraphQL API](/analytics/graphql-api/) and [Logpush](/logs/about/).
1919

2020
## Review policy violations in the dashboard
2121

22-
The policy violation information is available in **Security** > **Page Shield** > **Policies**. It includes the following:
22+
To view policy violation information:
2323

24-
- A sparkline next to the policy name, showing policy violations in the past seven days.
25-
- For policies with associated violations, an expandable details section for each policy, with the top resources present in policy violation events and a sparkline per top resource.
24+
- Old dashboard: Go to **Security** > **Page Shield** > **Policies**.
25+
- New dashboard: Go to **Security** > **Security rules**, and filter by **Content security rules**.
26+
27+
The displayed information includes the following:
28+
29+
- A sparkline next to the policy/rule name, showing violations in the past seven days.
30+
- For policies with associated violations, an expandable details section for each policy, with the top resources present in violation events and a sparkline per top resource.
2631

2732
## Get policy violations via GraphQL API
2833

@@ -125,6 +130,6 @@ https://api.cloudflare.com/client/v4/graphql \
125130

126131
[Cloudflare Logpush](/logs/about/) supports pushing logs to storage services, <GlossaryTooltip term="SIEM">SIEM systems</GlossaryTooltip>, and log management providers.
127132

128-
Information about Page Shield policy violations is available in the [`page_shield_events` dataset](/logs/reference/log-fields/zone/page_shield_events/).
133+
Information about policy violations is available in the [`page_shield_events` dataset](/logs/reference/log-fields/zone/page_shield_events/).
129134

130135
For more information on configuring Logpush jobs, refer to [Logs: Get started](/logs/get-started/).

0 commit comments

Comments
 (0)