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

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The resource name of the ScanConfig. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are generated by the system.
authenticationobjectThe authentication configuration. If specified, service will use the authentication configuration during scanning. (id: Authentication)
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.
latestRunobjectA ScanRun is a output-only resource representing an actual run of the scan. Next id: 12 (id: ScanRun)
managedScanbooleanWhether the scan config is managed by Web Security Scanner, output only.
maxQpsinteger (int32)The 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
scheduleobjectThe schedule of the ScanConfig. (id: Schedule)
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.
targetPlatformsarraySet of Google Cloud platforms targeted by the scan. If empty, APP_ENGINE will be used as a default.
userAgentstringThe user agent used during scanning.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, scanConfigsIdGets a ScanConfig.
listselectprojectsIdpageToken, pageSizeLists ScanConfigs under a given project.
createinsertprojectsIdCreates a new ScanConfig.
patchupdateprojectsId, scanConfigsIdupdateMaskUpdates a ScanConfig. This method support partial update of a ScanConfig.
deletedeleteprojectsId, scanConfigsIdDeletes an existing ScanConfig and its child resources.
startexecprojectsId, scanConfigsIdStart a ScanRun according to the given ScanConfig.

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
projectsIdstring
scanConfigsIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets a ScanConfig.

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

INSERT examples

Creates a new ScanConfig.

INSERT INTO google.websecurityscanner.scan_configs (
data__name,
data__displayName,
data__maxQps,
data__startingUrls,
data__authentication,
data__userAgent,
data__blacklistPatterns,
data__schedule,
data__exportToSecurityCommandCenter,
data__riskLevel,
data__managedScan,
data__staticIpScan,
data__ignoreHttpStatusErrors,
data__latestRun,
data__targetPlatforms,
projectsId
)
SELECT
'{{ name }}',
'{{ displayName }}',
{{ maxQps }},
'{{ startingUrls }}',
'{{ authentication }}',
'{{ userAgent }}',
'{{ blacklistPatterns }}',
'{{ schedule }}',
'{{ exportToSecurityCommandCenter }}',
'{{ riskLevel }}',
{{ managedScan }},
{{ staticIpScan }},
{{ ignoreHttpStatusErrors }},
'{{ latestRun }}',
'{{ targetPlatforms }}',
'{{ projectsId }}'
RETURNING
name,
authentication,
blacklistPatterns,
displayName,
exportToSecurityCommandCenter,
ignoreHttpStatusErrors,
latestRun,
managedScan,
maxQps,
riskLevel,
schedule,
startingUrls,
staticIpScan,
targetPlatforms,
userAgent
;

UPDATE examples

Updates a ScanConfig. This method support partial update of a ScanConfig.

UPDATE google.websecurityscanner.scan_configs
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__maxQps = {{ maxQps }},
data__startingUrls = '{{ startingUrls }}',
data__authentication = '{{ authentication }}',
data__userAgent = '{{ userAgent }}',
data__blacklistPatterns = '{{ blacklistPatterns }}',
data__schedule = '{{ schedule }}',
data__exportToSecurityCommandCenter = '{{ exportToSecurityCommandCenter }}',
data__riskLevel = '{{ riskLevel }}',
data__managedScan = {{ managedScan }},
data__staticIpScan = {{ staticIpScan }},
data__ignoreHttpStatusErrors = {{ ignoreHttpStatusErrors }},
data__latestRun = '{{ latestRun }}',
data__targetPlatforms = '{{ targetPlatforms }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND scanConfigsId = '{{ scanConfigsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
authentication,
blacklistPatterns,
displayName,
exportToSecurityCommandCenter,
ignoreHttpStatusErrors,
latestRun,
managedScan,
maxQps,
riskLevel,
schedule,
startingUrls,
staticIpScan,
targetPlatforms,
userAgent;

DELETE examples

Deletes an existing ScanConfig and its child resources.

DELETE FROM google.websecurityscanner.scan_configs
WHERE projectsId = '{{ projectsId }}' --required
AND scanConfigsId = '{{ scanConfigsId }}' --required;

Lifecycle Methods

Start a ScanRun according to the given ScanConfig.

EXEC google.websecurityscanner.scan_configs.start 
@projectsId='{{ projectsId }}' --required,
@scanConfigsId='{{ scanConfigsId }}' --required;