Skip to main content

scan_configs

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

Overview

Namescan_configs
TypeResource
Idgoogle.websecurityscanner.scan_configs

Fields

NameDatatypeDescription
namestringThe resource name of the ScanConfig. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are generated by the system.
authenticationobjectScan authentication configuration.
blacklistPatternsarrayThe excluded URL patterns as described in https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
displayNamestringRequired. The user provided display name of the ScanConfig.
exportToSecurityCommandCenterstringControls export of scan configurations and results to Security Command Center.
ignoreHttpStatusErrorsbooleanWhether to keep scanning even if most requests return HTTP error codes.
managedScanbooleanWhether the scan config is managed by Web Security Scanner, output only.
maxQpsintegerThe maximum QPS during scanning. A valid value ranges from 5 to 20 inclusively. If the field is unspecified or its value is set 0, server will default to 15. Other values outside of [5, 20] range will be rejected with INVALID_ARGUMENT error.
riskLevelstringThe risk level selected for the scan
scheduleobjectScan schedule configuration.
startingUrlsarrayRequired. The starting URLs from which the scanner finds site pages.
staticIpScanbooleanWhether the scan configuration has enabled static IP address scan feature. If enabled, the scanner will access applications from static IP addresses.
userAgentstringThe user agent used during scanning.

Methods

NameAccessible byRequired ParamsDescription
getSELECTprojectsId, scanConfigsIdGets a ScanConfig.
listSELECTprojectsIdLists ScanConfigs under a given project.
createINSERTprojectsIdCreates a new ScanConfig.
deleteDELETEprojectsId, scanConfigsIdDeletes an existing ScanConfig and its child resources.
patchUPDATEprojectsId, scanConfigsIdUpdates a ScanConfig. This method support partial update of a ScanConfig.
startEXECprojectsId, scanConfigsIdStart a ScanRun according to the given ScanConfig.

SELECT examples

Lists ScanConfigs under a given project.

SELECT
name,
authentication,
blacklistPatterns,
displayName,
exportToSecurityCommandCenter,
ignoreHttpStatusErrors,
managedScan,
maxQps,
riskLevel,
schedule,
startingUrls,
staticIpScan,
userAgent
FROM google.websecurityscanner.scan_configs
WHERE projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new scan_configs resource.

/*+ create */
INSERT INTO google.websecurityscanner.scan_configs (
projectsId,
startingUrls,
authentication,
riskLevel,
displayName,
blacklistPatterns,
ignoreHttpStatusErrors,
staticIpScan,
managedScan,
name,
userAgent,
maxQps,
schedule,
exportToSecurityCommandCenter
)
SELECT
'{{ projectsId }}',
'{{ startingUrls }}',
'{{ authentication }}',
'{{ riskLevel }}',
'{{ displayName }}',
'{{ blacklistPatterns }}',
{{ ignoreHttpStatusErrors }},
{{ staticIpScan }},
{{ managedScan }},
'{{ name }}',
'{{ userAgent }}',
'{{ maxQps }}',
'{{ schedule }}',
'{{ exportToSecurityCommandCenter }}'
;

UPDATE example

Updates a scan_configs resource.

/*+ update */
UPDATE google.websecurityscanner.scan_configs
SET
startingUrls = '{{ startingUrls }}',
authentication = '{{ authentication }}',
riskLevel = '{{ riskLevel }}',
displayName = '{{ displayName }}',
blacklistPatterns = '{{ blacklistPatterns }}',
ignoreHttpStatusErrors = true|false,
staticIpScan = true|false,
managedScan = true|false,
name = '{{ name }}',
userAgent = '{{ userAgent }}',
maxQps = '{{ maxQps }}',
schedule = '{{ schedule }}',
exportToSecurityCommandCenter = '{{ exportToSecurityCommandCenter }}'
WHERE
projectsId = '{{ projectsId }}'
AND scanConfigsId = '{{ scanConfigsId }}';

DELETE example

Deletes the specified scan_configs resource.

/*+ delete */
DELETE FROM google.websecurityscanner.scan_configs
WHERE projectsId = '{{ projectsId }}'
AND scanConfigsId = '{{ scanConfigsId }}';