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:

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. (EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED, ENABLED, DISABLED)
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 (RISK_LEVEL_UNSPECIFIED, NORMAL, LOW)
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. (USER_AGENT_UNSPECIFIED, CHROME_LINUX, CHROME_ANDROID, SAFARI_IPHONE)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, scanConfigsIdGets a ScanConfig.
listselectprojectsIdpageSize, pageTokenLists 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__authentication,
data__blacklistPatterns,
data__displayName,
data__exportToSecurityCommandCenter,
data__ignoreHttpStatusErrors,
data__latestRun,
data__managedScan,
data__maxQps,
data__name,
data__riskLevel,
data__schedule,
data__startingUrls,
data__staticIpScan,
data__targetPlatforms,
data__userAgent,
projectsId
)
SELECT
'{{ authentication }}',
'{{ blacklistPatterns }}',
'{{ displayName }}',
'{{ exportToSecurityCommandCenter }}',
{{ ignoreHttpStatusErrors }},
'{{ latestRun }}',
{{ managedScan }},
{{ maxQps }},
'{{ name }}',
'{{ riskLevel }}',
'{{ schedule }}',
'{{ startingUrls }}',
{{ staticIpScan }},
'{{ targetPlatforms }}',
'{{ userAgent }}',
'{{ 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__authentication = '{{ authentication }}',
data__blacklistPatterns = '{{ blacklistPatterns }}',
data__displayName = '{{ displayName }}',
data__exportToSecurityCommandCenter = '{{ exportToSecurityCommandCenter }}',
data__ignoreHttpStatusErrors = {{ ignoreHttpStatusErrors }},
data__latestRun = '{{ latestRun }}',
data__managedScan = {{ managedScan }},
data__maxQps = {{ maxQps }},
data__name = '{{ name }}',
data__riskLevel = '{{ riskLevel }}',
data__schedule = '{{ schedule }}',
data__startingUrls = '{{ startingUrls }}',
data__staticIpScan = {{ staticIpScan }},
data__targetPlatforms = '{{ targetPlatforms }}',
data__userAgent = '{{ userAgent }}'
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
;