Skip to content
Start here

Page Shield

Get Page Shield settings
page_shield.get(PageShieldGetParams**kwargs) -> Setting
GET/zones/{zone_id}/page_shield
Update Page Shield settings
page_shield.update(PageShieldUpdateParams**kwargs) -> PageShieldUpdateResponse
PUT/zones/{zone_id}/page_shield
ModelsExpand Collapse
class Setting:
enabled: bool

When true, indicates that Page Shield is enabled.

updated_at: str

The timestamp of when Page Shield was last updated.

use_cloudflare_reporting_endpoint: bool
use_connection_url_path: bool

When true, the paths associated with connections URLs will also be analyzed.

class PageShieldUpdateResponse:
enabled: bool

When true, indicates that Page Shield is enabled.

updated_at: str

The timestamp of when Page Shield was last updated.

use_cloudflare_reporting_endpoint: bool
use_connection_url_path: bool

When true, the paths associated with connections URLs will also be analyzed.

Page ShieldPolicies

List Page Shield policies
page_shield.policies.list(PolicyListParams**kwargs) -> SyncSinglePage[PolicyListResponse]
GET/zones/{zone_id}/page_shield/policies
Get a Page Shield policy
page_shield.policies.get(strpolicy_id, PolicyGetParams**kwargs) -> PolicyGetResponse
GET/zones/{zone_id}/page_shield/policies/{policy_id}
Create a Page Shield policy
page_shield.policies.create(PolicyCreateParams**kwargs) -> PolicyCreateResponse
POST/zones/{zone_id}/page_shield/policies
Update a Page Shield policy
page_shield.policies.update(strpolicy_id, PolicyUpdateParams**kwargs) -> PolicyUpdateResponse
PUT/zones/{zone_id}/page_shield/policies/{policy_id}
Delete a Page Shield policy
page_shield.policies.delete(strpolicy_id, PolicyDeleteParams**kwargs)
DELETE/zones/{zone_id}/page_shield/policies/{policy_id}
ModelsExpand Collapse
class Policy:
action: Literal["allow", "log", "add_reporting_directives"]

The action to take if the expression matches

One of the following:
"allow"
"log"
"add_reporting_directives"
description: str

A description for the policy

enabled: bool

Whether the policy is enabled

expression: str

The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax

value: str

The policy which will be applied

class PolicyListResponse:
id: str

Identifier

maxLength32
action: Literal["allow", "log", "add_reporting_directives"]

The action to take if the expression matches

One of the following:
"allow"
"log"
"add_reporting_directives"
description: str

A description for the policy

enabled: bool

Whether the policy is enabled

expression: str

The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax

value: str

The policy which will be applied

class PolicyGetResponse:
id: str

Identifier

maxLength32
action: Literal["allow", "log", "add_reporting_directives"]

The action to take if the expression matches

One of the following:
"allow"
"log"
"add_reporting_directives"
description: str

A description for the policy

enabled: bool

Whether the policy is enabled

expression: str

The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax

value: str

The policy which will be applied

class PolicyCreateResponse:
id: str

Identifier

maxLength32
action: Literal["allow", "log", "add_reporting_directives"]

The action to take if the expression matches

One of the following:
"allow"
"log"
"add_reporting_directives"
description: str

A description for the policy

enabled: bool

Whether the policy is enabled

expression: str

The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax

value: str

The policy which will be applied

class PolicyUpdateResponse:
id: str

Identifier

maxLength32
action: Literal["allow", "log", "add_reporting_directives"]

The action to take if the expression matches

One of the following:
"allow"
"log"
"add_reporting_directives"
description: str

A description for the policy

enabled: bool

Whether the policy is enabled

expression: str

The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax

value: str

The policy which will be applied

Page ShieldConnections

List Page Shield connections
page_shield.connections.list(ConnectionListParams**kwargs) -> SyncSinglePage[Connection]
GET/zones/{zone_id}/page_shield/connections
Get a Page Shield connection
page_shield.connections.get(strconnection_id, ConnectionGetParams**kwargs) -> Connection
GET/zones/{zone_id}/page_shield/connections/{connection_id}
ModelsExpand Collapse
class Connection:
id: str

Identifier

maxLength32
added_at: datetime
formatdate-time
first_seen_at: datetime
formatdate-time
host: str
last_seen_at: datetime
formatdate-time
url: str
url_contains_cdn_cgi_path: bool
domain_reported_malicious: Optional[bool]
first_page_url: Optional[str]
malicious_domain_categories: Optional[List[str]]
malicious_url_categories: Optional[List[str]]
page_urls: Optional[List[str]]
url_reported_malicious: Optional[bool]

Page ShieldScripts

List Page Shield scripts
page_shield.scripts.list(ScriptListParams**kwargs) -> SyncSinglePage[Script]
GET/zones/{zone_id}/page_shield/scripts
Get a Page Shield script
page_shield.scripts.get(strscript_id, ScriptGetParams**kwargs) -> ScriptGetResponse
GET/zones/{zone_id}/page_shield/scripts/{script_id}
ModelsExpand Collapse
class Script:
id: str

Identifier

maxLength32
added_at: datetime
formatdate-time
first_seen_at: datetime
formatdate-time
host: str
last_seen_at: datetime
formatdate-time
url: str
url_contains_cdn_cgi_path: bool
cryptomining_score: Optional[int]

The cryptomining score of the JavaScript content.

maximum99
minimum1
Deprecateddataflow_score: Optional[int]

The dataflow score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.

maximum99
minimum1
domain_reported_malicious: Optional[bool]
fetched_at: Optional[str]

The timestamp of when the script was last fetched.

first_page_url: Optional[str]
hash: Optional[str]

The computed hash of the analyzed script.

maxLength64
minLength64
js_integrity_score: Optional[int]

The integrity score of the JavaScript content.

maximum99
minimum1
magecart_score: Optional[int]

The magecart score of the JavaScript content.

maximum99
minimum1
malicious_domain_categories: Optional[List[str]]
malicious_url_categories: Optional[List[str]]
malware_score: Optional[int]

The malware score of the JavaScript content.

maximum99
minimum1
Deprecatedobfuscation_score: Optional[int]

The obfuscation score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.

maximum99
minimum1
page_urls: Optional[List[str]]
url_reported_malicious: Optional[bool]
class ScriptGetResponse:
id: str

Identifier

maxLength32
added_at: datetime
formatdate-time
first_seen_at: datetime
formatdate-time
host: str
last_seen_at: datetime
formatdate-time
url: str
url_contains_cdn_cgi_path: bool
cryptomining_score: Optional[int]

The cryptomining score of the JavaScript content.

maximum99
minimum1
Deprecateddataflow_score: Optional[int]

The dataflow score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.

maximum99
minimum1
domain_reported_malicious: Optional[bool]
fetched_at: Optional[str]

The timestamp of when the script was last fetched.

first_page_url: Optional[str]
hash: Optional[str]

The computed hash of the analyzed script.

maxLength64
minLength64
js_integrity_score: Optional[int]

The integrity score of the JavaScript content.

maximum99
minimum1
magecart_score: Optional[int]

The magecart score of the JavaScript content.

maximum99
minimum1
malicious_domain_categories: Optional[List[str]]
malicious_url_categories: Optional[List[str]]
malware_score: Optional[int]

The malware score of the JavaScript content.

maximum99
minimum1
Deprecatedobfuscation_score: Optional[int]

The obfuscation score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.

maximum99
minimum1
page_urls: Optional[List[str]]
url_reported_malicious: Optional[bool]
versions: Optional[List[Version]]
cryptomining_score: Optional[int]

The cryptomining score of the JavaScript content.

maximum99
minimum1
Deprecateddataflow_score: Optional[int]

The dataflow score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.

maximum99
minimum1
fetched_at: Optional[str]

The timestamp of when the script was last fetched.

hash: Optional[str]

The computed hash of the analyzed script.

maxLength64
minLength64
js_integrity_score: Optional[int]

The integrity score of the JavaScript content.

maximum99
minimum1
magecart_score: Optional[int]

The magecart score of the JavaScript content.

maximum99
minimum1
malware_score: Optional[int]

The malware score of the JavaScript content.

maximum99
minimum1
Deprecatedobfuscation_score: Optional[int]

The obfuscation score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.

maximum99
minimum1

Page ShieldCookies

List Page Shield Cookies
page_shield.cookies.list(CookieListParams**kwargs) -> SyncSinglePage[CookieListResponse]
GET/zones/{zone_id}/page_shield/cookies
Get a Page Shield cookie
page_shield.cookies.get(strcookie_id, CookieGetParams**kwargs) -> CookieGetResponse
GET/zones/{zone_id}/page_shield/cookies/{cookie_id}
ModelsExpand Collapse
One of the following:
One of the following:
One of the following:
One of the following: