Skip to main content

sources

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

Overview

Namesources
TypeResource
Idgoogle.securitycenter.sources

Fields

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}"
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."
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.
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

NameAccessible byRequired ParamsDescription
folders_sources_listSELECTfoldersIdLists all sources belonging to an organization.
organizations_sources_getSELECTorganizationsId, sourcesIdGets a source.
organizations_sources_listSELECTorganizationsIdLists all sources belonging to an organization.
projects_sources_listSELECTprojectsIdLists all sources belonging to an organization.
organizations_sources_createINSERTorganizationsIdCreates a source.
organizations_sources_patchUPDATEorganizationsId, sourcesIdUpdates a source.

SELECT examples

Lists all sources belonging to an organization.

SELECT
name,
description,
canonicalName,
displayName
FROM google.securitycenter.sources
WHERE foldersId = '{{ foldersId }}';

INSERT example

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

/*+ create */
INSERT INTO google.securitycenter.sources (
organizationsId,
name,
displayName,
description,
canonicalName
)
SELECT
'{{ organizationsId }}',
'{{ name }}',
'{{ displayName }}',
'{{ description }}',
'{{ canonicalName }}'
;

UPDATE example

Updates a sources resource.

/*+ update */
UPDATE google.securitycenter.sources
SET
name = '{{ name }}',
displayName = '{{ displayName }}',
description = '{{ description }}',
canonicalName = '{{ canonicalName }}'
WHERE
organizationsId = '{{ organizationsId }}'
AND sourcesId = '{{ sourcesId }}';