scripts
Creates, updates, deletes, gets or lists a scripts resource.
Overview
| Name | scripts |
| Type | Resource |
| Id | cloudflare.page_shield.scripts |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get a Page Shield script response
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
added_at | string (date-time) | (example: 2021-08-18T10:51:10.09615Z) |
cryptomining_score | integer | The cryptomining score of the JavaScript content. |
dataflow_score | integer | The dataflow score of the JavaScript content. This field has been deprecated in favour of js_integrity_score. |
domain_reported_malicious | boolean | |
fetched_at | string | The timestamp of when the script was last fetched. |
first_page_url | string | (example: blog.cloudflare.com/page) |
first_seen_at | string (date-time) | (example: 2021-08-18T10:51:08Z) |
hash | string | The computed hash of the analyzed script. |
host | string | (example: blog.cloudflare.com) |
js_integrity_score | integer | The integrity score of the JavaScript content. |
last_seen_at | string (date-time) | (example: 2021-09-02T09:57:54Z) |
magecart_score | integer | The magecart score of the JavaScript content. |
malicious_domain_categories | array | |
malicious_url_categories | array | |
malware_score | integer | The malware score of the JavaScript content. |
obfuscation_score | integer | The obfuscation score of the JavaScript content. This field has been deprecated in favour of js_integrity_score. |
page_urls | array | |
url | string | (example: https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.min.js) |
url_contains_cdn_cgi_path | boolean | |
url_reported_malicious | boolean | |
versions | array |
List Page Shield scripts response
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
added_at | string (date-time) | (example: 2021-08-18T10:51:10.09615Z) |
cryptomining_score | integer | The cryptomining score of the JavaScript content. |
dataflow_score | integer | The dataflow score of the JavaScript content. This field has been deprecated in favour of js_integrity_score. |
domain_reported_malicious | boolean | |
fetched_at | string | The timestamp of when the script was last fetched. |
first_page_url | string | (example: blog.cloudflare.com/page) |
first_seen_at | string (date-time) | (example: 2021-08-18T10:51:08Z) |
hash | string | The computed hash of the analyzed script. |
host | string | (example: blog.cloudflare.com) |
js_integrity_score | integer | The integrity score of the JavaScript content. |
last_seen_at | string (date-time) | (example: 2021-09-02T09:57:54Z) |
magecart_score | integer | The magecart score of the JavaScript content. |
malicious_domain_categories | array | |
malicious_url_categories | array | |
malware_score | integer | The malware score of the JavaScript content. |
obfuscation_score | integer | The obfuscation score of the JavaScript content. This field has been deprecated in favour of js_integrity_score. |
page_urls | array | |
url | string | (example: https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.min.js) |
url_contains_cdn_cgi_path | boolean | |
url_reported_malicious | boolean |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | zone_id, script_id | Fetches a script detected by Page Shield by script ID. | |
list | select | zone_id | exclude_urls, urls, hosts, page, per_page, order_by, direction, prioritize_malicious, exclude_cdn_cgi, exclude_duplicates, status, page_url, export | Lists 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.
| Name | Datatype | Description |
|---|---|---|
script_id | string | |
zone_id | string | The Cloudflare zone ID. |
direction | string | |
exclude_cdn_cgi | boolean | |
exclude_duplicates | boolean | |
exclude_urls | string | |
export | string | |
hosts | string | |
order_by | string | |
page | string | |
page_url | string | |
per_page | number | |
prioritize_malicious | boolean | |
status | string | |
urls | string |
SELECT examples
- get
- list
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
;
Lists all scripts detected by Page Shield.
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
FROM cloudflare.page_shield.scripts
WHERE zone_id = '{{ zone_id }}' -- required
AND exclude_urls = '{{ exclude_urls }}'
AND urls = '{{ urls }}'
AND hosts = '{{ hosts }}'
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND order_by = '{{ order_by }}'
AND direction = '{{ direction }}'
AND prioritize_malicious = '{{ prioritize_malicious }}'
AND exclude_cdn_cgi = '{{ exclude_cdn_cgi }}'
AND exclude_duplicates = '{{ exclude_duplicates }}'
AND status = '{{ status }}'
AND page_url = '{{ page_url }}'
AND export = '{{ export }}'
;