Skip to main content

scripts

Creates, updates, deletes, gets or lists a scripts resource.

Overview

Namescripts
TypeResource
Idcloudflare.page_shield.scripts

Fields

The following fields are returned by SELECT queries:

Get a Page Shield script response

NameDatatypeDescription
idstringIdentifier (example: 023e105f4ecef8ad9ca31a8372d0c353)
added_atstring (date-time) (example: 2021-08-18T10:51:10.09615Z)
cryptomining_scoreintegerThe cryptomining score of the JavaScript content.
dataflow_scoreintegerThe dataflow score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.
domain_reported_maliciousboolean
fetched_atstringThe timestamp of when the script was last fetched.
first_page_urlstring (example: blog.cloudflare.com/page)
first_seen_atstring (date-time) (example: 2021-08-18T10:51:08Z)
hashstringThe computed hash of the analyzed script.
hoststring (example: blog.cloudflare.com)
js_integrity_scoreintegerThe integrity score of the JavaScript content.
last_seen_atstring (date-time) (example: 2021-09-02T09:57:54Z)
magecart_scoreintegerThe magecart score of the JavaScript content.
malicious_domain_categoriesarray
malicious_url_categoriesarray
malware_scoreintegerThe malware score of the JavaScript content.
obfuscation_scoreintegerThe obfuscation score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.
page_urlsarray
urlstring (example: https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.min.js)
url_contains_cdn_cgi_pathboolean
url_reported_maliciousboolean
versionsarray

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectzone_id, script_idFetches a script detected by Page Shield by script ID.
listselectzone_idexclude_urls, urls, hosts, page, per_page, order_by, direction, prioritize_malicious, exclude_cdn_cgi, exclude_duplicates, status, page_url, exportLists all scripts detected by Page Shield.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
script_idstring
zone_idstringThe Cloudflare zone ID.
directionstring
exclude_cdn_cgiboolean
exclude_duplicatesboolean
exclude_urlsstring
exportstring
hostsstring
order_bystring
pagestring
page_urlstring
per_pagenumber
prioritize_maliciousboolean
statusstring
urlsstring

SELECT examples

Fetches a script detected by Page Shield by script ID.

SELECT
id,
added_at,
cryptomining_score,
dataflow_score,
domain_reported_malicious,
fetched_at,
first_page_url,
first_seen_at,
hash,
host,
js_integrity_score,
last_seen_at,
magecart_score,
malicious_domain_categories,
malicious_url_categories,
malware_score,
obfuscation_score,
page_urls,
url,
url_contains_cdn_cgi_path,
url_reported_malicious,
versions
FROM cloudflare.page_shield.scripts
WHERE zone_id = '{{ zone_id }}' -- required
AND script_id = '{{ script_id }}' -- required
;