scans
Creates, updates, deletes, gets or lists a scans resource.
Overview
| Name | scans |
| Type | Resource |
| Id | digitalocean.security.scans |
Fields
The following fields are returned by SELECT queries:
- security_get_scan
- security_list_scans
- security_get_latest_scan
The response will be a JSON object with a key called scan.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for the scan. (title: id, example: 760e09ef-dc84-11e8-981e-3cfdfeaae000) |
created_at | string (date-time) | When scan was created. (title: created_at, example: 2025-12-04T00:00:00Z) |
findings | array | (title: findings) |
status | string | The status of the scan. (IN_PROGRESS, COMPLETED, FAILED, CSPM_NOT_ENABLED, SCAN_NOT_RUN) (title: status, example: COMPLETED) |
The response will be a JSON object with a key called scans. This will be set to an array of objects, each of which will contain the standard attributes associated with a scan.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for the scan. (title: id, example: 760e09ef-dc84-11e8-981e-3cfdfeaae000) |
created_at | string (date-time) | When scan was created. (title: created_at, example: 2025-12-04T00:00:00Z) |
findings | array | (title: findings) |
status | string | The status of the scan. (IN_PROGRESS, COMPLETED, FAILED, CSPM_NOT_ENABLED, SCAN_NOT_RUN) (title: status, example: COMPLETED) |
The response will be a JSON object with a key called scan.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for the scan. (title: id, example: 760e09ef-dc84-11e8-981e-3cfdfeaae000) |
created_at | string (date-time) | When scan was created. (title: created_at, example: 2025-12-04T00:00:00Z) |
findings | array | (title: findings) |
status | string | The status of the scan. (IN_PROGRESS, COMPLETED, FAILED, CSPM_NOT_ENABLED, SCAN_NOT_RUN) (title: status, example: COMPLETED) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
security_get_scan | select | scan_id | severity, per_page, page, type | To get a CSPM scan by ID, send a GET request to /v2/security/scans/{scan_id}. |
security_list_scans | select | per_page, page | To list all CSPM scans, send a GET request to /v2/security/scans. | |
security_get_latest_scan | select | per_page, page, severity, type | To get the latest CSPM scan, send a GET request to /v2/security/scans/latest. | |
security_create_scan | insert | To create a CSPM scan, send a POST request to /v2/security/scans. |
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 |
|---|---|---|
scan_id | string (uuid) | The scan UUID. (example: 497dcba3-ecbf-4587-a2dd-5eb0665e6880) |
page | integer | Which 'page' of paginated results to return. (example: 1) |
per_page | integer | Number of items returned per page (example: 2) |
severity | string | The finding severity level to include. (example: CRITICAL) |
type | string | The finding type to include. (example: CSPM) |
SELECT examples
- security_get_scan
- security_list_scans
- security_get_latest_scan
To get a CSPM scan by ID, send a GET request to /v2/security/scans/{scan_id}.
SELECT
id,
created_at,
findings,
status
FROM digitalocean.security.scans
WHERE scan_id = '{{ scan_id }}' -- required
AND severity = '{{ severity }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
AND type = '{{ type }}'
;
To list all CSPM scans, send a GET request to /v2/security/scans.
SELECT
id,
created_at,
findings,
status
FROM digitalocean.security.scans
WHERE per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
To get the latest CSPM scan, send a GET request to /v2/security/scans/latest.
SELECT
id,
created_at,
findings,
status
FROM digitalocean.security.scans
WHERE per_page = '{{ per_page }}'
AND page = '{{ page }}'
AND severity = '{{ severity }}'
AND type = '{{ type }}'
;
INSERT examples
- security_create_scan
- Manifest
To create a CSPM scan, send a POST request to /v2/security/scans.
INSERT INTO digitalocean.security.scans (
)
SELECT
RETURNING
scan
;
# Description fields are for documentation purposes
- name: scans
props: