Skip to main content

sources

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

Overview

Namesources
TypeResource
Idgoogle.securitycenter.sources

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringThe relative resource name of this source. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: "organizations/{organization_id}/sources/{source_id}"
canonicalNamestringThe canonical name of the finding source. It's either "organizations/{organization_id}/sources/{source_id}", "folders/{folder_id}/sources/{source_id}", or "projects/{project_number}/sources/{source_id}", depending on the closest CRM ancestor of the resource associated with the finding.
descriptionstringThe description of the source (max of 1024 characters). Example: "Web Security Scanner is a web security scanner for common vulnerabilities in App Engine applications. It can automatically scan and detect four common vulnerabilities, including cross-site-scripting (XSS), Flash injection, mixed content (HTTP in HTTPS), and outdated or insecure libraries."
displayNamestringThe source's display name. A source's display name must be unique amongst its siblings, for example, two sources with the same parent can't share the same display name. The display name must have a length between 1 and 64 characters (inclusive).

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
organizations_sources_getselectorganizationsId, sourcesIdGets a source.
folders_sources_listselectfoldersIdpageToken, pageSizeLists all sources belonging to an organization.
projects_sources_listselectprojectsIdpageToken, pageSizeLists all sources belonging to an organization.
organizations_sources_listselectorganizationsIdpageToken, pageSizeLists all sources belonging to an organization.
organizations_sources_createinsertorganizationsIdCreates a source.
organizations_sources_patchupdateorganizationsId, sourcesIdupdateMaskUpdates a source.

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

SELECT examples

Gets a source.

SELECT
name,
canonicalName,
description,
displayName
FROM google.securitycenter.sources
WHERE organizationsId = '{{ organizationsId }}' -- required
AND sourcesId = '{{ sourcesId }}' -- required;

INSERT examples

Creates a source.

INSERT INTO google.securitycenter.sources (
data__name,
data__displayName,
data__description,
data__canonicalName,
organizationsId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ description }}',
'{{ canonicalName }}',
'{{ organizationsId }}'
RETURNING
name,
canonicalName,
description,
displayName
;

UPDATE examples

Updates a source.

UPDATE google.securitycenter.sources
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__canonicalName = '{{ canonicalName }}'
WHERE
organizationsId = '{{ organizationsId }}' --required
AND sourcesId = '{{ sourcesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
canonicalName,
description,
displayName;