Skip to main content

scans

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

Overview

Namescans
TypeResource
Idcloudflare.vulnerability_scanner.scans

Fields

The following fields are returned by SELECT queries:

Successful response.

NameDatatypeDescription
idstring (uuid)Scan identifier.
target_environment_idstring (uuid)The target environment this scan runs against.
reportobjectVulnerability report produced after the scan completes. The shape depends on the scan type. Present only for finished scans.
scan_typestringThe type of vulnerability scan. (bola)
statusstringCurrent lifecycle status of the scan. (created, scheduled, planning, running, finished, failed)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, scan_idReturns a single scan by ID.
listselectaccount_idpage, per_pageReturns all scans for the account.
createinsertaccount_id, target_environment_id, scan_type, open_api, credential_setsCreates and starts a new vulnerability scan. The response may include non-fatal warnings in the messages array.
delete_scandeleteaccount_id, scan_idDeletes a scan and all associated data. Only scans in a terminal state (finished, failed) may be deleted. Attempting to delete a scan that is still being created or executed (created, scheduled, planning, running) returns 400.

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
account_idstringThe Cloudflare account ID.
scan_idstring (uuid)Scan identifier.
pageintegerPage number of paginated results.
per_pageintegerNumber of results per page.

SELECT examples

Returns a single scan by ID.

SELECT
id,
target_environment_id,
report,
scan_type,
status
FROM cloudflare.vulnerability_scanner.scans
WHERE account_id = '{{ account_id }}' -- required
AND scan_id = '{{ scan_id }}' -- required
;

INSERT examples

Creates and starts a new vulnerability scan. The response may include non-fatal warnings in the messages array.

INSERT INTO cloudflare.vulnerability_scanner.scans (
credential_sets,
open_api,
scan_type,
target_environment_id,
account_id
)
SELECT
'{{ credential_sets }}' /* required */,
'{{ open_api }}' /* required */,
'{{ scan_type }}' /* required */,
'{{ target_environment_id }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
result_info,
success
;

DELETE examples

Deletes a scan and all associated data. Only scans in a terminal state (finished, failed) may be deleted. Attempting to delete a scan that is still being created or executed (created, scheduled, planning, running) returns 400.

DELETE FROM cloudflare.vulnerability_scanner.scans
WHERE account_id = '{{ account_id }}' --required
AND scan_id = '{{ scan_id }}' --required
;