Constructor
new SecurityCenterClient(optionsopt)
Construct an instance of SecurityCenterClient.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. See the subsequent parameters for more details. Properties
|
- Source:
Members
(static) apiEndpoint
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
(static) port
The port for this API service.
(static) scopes
The scopes needed to make gRPC calls for every method defined in this service.
(static) servicePath
The DNS address for this API service.
Methods
assetSecurityMarksPath(organization, asset) → {String}
Return a fully-qualified asset_security_marks resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
organization |
String | |
asset |
String |
createFinding(request, optionsopt, callbackopt) → {Promise}
Creates a finding. The corresponding source must exist for finding creation to succeed.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Finding. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]');
const findingId = '';
const finding = {};
const request = {
parent: formattedParent,
findingId: findingId,
finding: finding,
};
client.createFinding(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
createSource(request, optionsopt, callbackopt) → {Promise}
Creates a source.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Source. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedParent = client.organizationPath('[ORGANIZATION]');
const source = {};
const request = {
parent: formattedParent,
source: source,
};
client.createSource(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
findingPath(organization, source, finding) → {String}
Return a fully-qualified finding resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
organization |
String | |
source |
String | |
finding |
String |
findingSecurityMarksPath(organization, source, finding) → {String}
Return a fully-qualified finding_security_marks resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
organization |
String | |
source |
String | |
finding |
String |
getIamPolicy(request, optionsopt, callbackopt) → {Promise}
Gets the access control policy on the specified Source.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Policy. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]');
client.getIamPolicy({resource: formattedResource})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
getOrganizationSettings(request, optionsopt, callbackopt) → {Promise}
Gets the settings for an organization.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing OrganizationSettings. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedName = client.organizationSettingsPath('[ORGANIZATION]');
client.getOrganizationSettings({name: formattedName})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
getProjectId(callback)
Return the project ID used by this class.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
the callback to be called with the current project Id. |
getSource(request, optionsopt, callbackopt) → {Promise}
Gets a source.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Source. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedName = client.sourcePath('[ORGANIZATION]', '[SOURCE]');
client.getSource({name: formattedName})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
groupAssets(request, optionsopt, callbackopt) → {Promise}
Filters an organization's assets and groups them by their specified properties.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is Array of GroupResult. When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing GroupAssetsResponse. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
// Iterate over all elements.
const formattedParent = client.organizationPath('[ORGANIZATION]');
const groupBy = '';
const request = {
parent: formattedParent,
groupBy: groupBy,
};
client.groupAssets(request)
.then(responses => {
const resources = responses[0];
for (const resource of resources) {
// doThingsWith(resource)
}
})
.catch(err => {
console.error(err);
});
// Or obtain the paged response.
const formattedParent = client.organizationPath('[ORGANIZATION]');
const groupBy = '';
const request = {
parent: formattedParent,
groupBy: groupBy,
};
const options = {autoPaginate: false};
const callback = responses => {
// The actual resources in a response.
const resources = responses[0];
// The next request if the response shows that there are more responses.
const nextRequest = responses[1];
// The actual response object, if necessary.
// const rawResponse = responses[2];
for (const resource of resources) {
// doThingsWith(resource);
}
if (nextRequest) {
// Fetch the next page.
return client.groupAssets(nextRequest, options).then(callback);
}
}
client.groupAssets(request, options)
.then(callback)
.catch(err => {
console.error(err);
});
groupAssetsStream(request, optionsopt) → {Stream}
Equivalent to groupAssets, but returns a NodeJS Stream object.
This fetches the paged responses for groupAssets continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedParent = client.organizationPath('[ORGANIZATION]');
const groupBy = '';
const request = {
parent: formattedParent,
groupBy: groupBy,
};
client.groupAssetsStream(request)
.on('data', element => {
// doThingsWith(element)
}).on('error', err => {
console.log(err);
});
groupFindings(request, optionsopt, callbackopt) → {Promise}
Filters an organization or source's findings and groups them by their specified properties.
To group across all sources provide a - as the source id.
Example: /v1beta1/organizations/123/sources/-/findings
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is Array of GroupResult. When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing GroupFindingsResponse. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
// Iterate over all elements.
const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]');
const groupBy = '';
const request = {
parent: formattedParent,
groupBy: groupBy,
};
client.groupFindings(request)
.then(responses => {
const resources = responses[0];
for (const resource of resources) {
// doThingsWith(resource)
}
})
.catch(err => {
console.error(err);
});
// Or obtain the paged response.
const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]');
const groupBy = '';
const request = {
parent: formattedParent,
groupBy: groupBy,
};
const options = {autoPaginate: false};
const callback = responses => {
// The actual resources in a response.
const resources = responses[0];
// The next request if the response shows that there are more responses.
const nextRequest = responses[1];
// The actual response object, if necessary.
// const rawResponse = responses[2];
for (const resource of resources) {
// doThingsWith(resource);
}
if (nextRequest) {
// Fetch the next page.
return client.groupFindings(nextRequest, options).then(callback);
}
}
client.groupFindings(request, options)
.then(callback)
.catch(err => {
console.error(err);
});
groupFindingsStream(request, optionsopt) → {Stream}
Equivalent to groupFindings, but returns a NodeJS Stream object.
This fetches the paged responses for groupFindings continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]');
const groupBy = '';
const request = {
parent: formattedParent,
groupBy: groupBy,
};
client.groupFindingsStream(request)
.on('data', element => {
// doThingsWith(element)
}).on('error', err => {
console.log(err);
});
listAssets(request, optionsopt, callbackopt) → {Promise}
Lists an organization's assets.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is Array of ListAssetsResult. When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListAssetsResponse. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
// Iterate over all elements.
const formattedParent = client.organizationPath('[ORGANIZATION]');
client.listAssets({parent: formattedParent})
.then(responses => {
const resources = responses[0];
for (const resource of resources) {
// doThingsWith(resource)
}
})
.catch(err => {
console.error(err);
});
// Or obtain the paged response.
const formattedParent = client.organizationPath('[ORGANIZATION]');
const options = {autoPaginate: false};
const callback = responses => {
// The actual resources in a response.
const resources = responses[0];
// The next request if the response shows that there are more responses.
const nextRequest = responses[1];
// The actual response object, if necessary.
// const rawResponse = responses[2];
for (const resource of resources) {
// doThingsWith(resource);
}
if (nextRequest) {
// Fetch the next page.
return client.listAssets(nextRequest, options).then(callback);
}
}
client.listAssets({parent: formattedParent}, options)
.then(callback)
.catch(err => {
console.error(err);
});
listAssetsStream(request, optionsopt) → {Stream}
Equivalent to listAssets, but returns a NodeJS Stream object.
This fetches the paged responses for listAssets continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedParent = client.organizationPath('[ORGANIZATION]');
client.listAssetsStream({parent: formattedParent})
.on('data', element => {
// doThingsWith(element)
}).on('error', err => {
console.log(err);
});
listFindings(request, optionsopt, callbackopt) → {Promise}
Lists an organization or source's findings.
To list across all sources provide a - as the source id.
Example: /v1beta1/organizations/123/sources/-/findings
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is Array of Finding. When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListFindingsResponse. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
// Iterate over all elements.
const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]');
client.listFindings({parent: formattedParent})
.then(responses => {
const resources = responses[0];
for (const resource of resources) {
// doThingsWith(resource)
}
})
.catch(err => {
console.error(err);
});
// Or obtain the paged response.
const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]');
const options = {autoPaginate: false};
const callback = responses => {
// The actual resources in a response.
const resources = responses[0];
// The next request if the response shows that there are more responses.
const nextRequest = responses[1];
// The actual response object, if necessary.
// const rawResponse = responses[2];
for (const resource of resources) {
// doThingsWith(resource);
}
if (nextRequest) {
// Fetch the next page.
return client.listFindings(nextRequest, options).then(callback);
}
}
client.listFindings({parent: formattedParent}, options)
.then(callback)
.catch(err => {
console.error(err);
});
listFindingsStream(request, optionsopt) → {Stream}
Equivalent to listFindings, but returns a NodeJS Stream object.
This fetches the paged responses for listFindings continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]');
client.listFindingsStream({parent: formattedParent})
.on('data', element => {
// doThingsWith(element)
}).on('error', err => {
console.log(err);
});
listSources(request, optionsopt, callbackopt) → {Promise}
Lists all sources belonging to an organization.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is Array of Source. When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListSourcesResponse. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
// Iterate over all elements.
const formattedParent = client.organizationPath('[ORGANIZATION]');
client.listSources({parent: formattedParent})
.then(responses => {
const resources = responses[0];
for (const resource of resources) {
// doThingsWith(resource)
}
})
.catch(err => {
console.error(err);
});
// Or obtain the paged response.
const formattedParent = client.organizationPath('[ORGANIZATION]');
const options = {autoPaginate: false};
const callback = responses => {
// The actual resources in a response.
const resources = responses[0];
// The next request if the response shows that there are more responses.
const nextRequest = responses[1];
// The actual response object, if necessary.
// const rawResponse = responses[2];
for (const resource of resources) {
// doThingsWith(resource);
}
if (nextRequest) {
// Fetch the next page.
return client.listSources(nextRequest, options).then(callback);
}
}
client.listSources({parent: formattedParent}, options)
.then(callback)
.catch(err => {
console.error(err);
});
listSourcesStream(request, optionsopt) → {Stream}
Equivalent to listSources, but returns a NodeJS Stream object.
This fetches the paged responses for listSources continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedParent = client.organizationPath('[ORGANIZATION]');
client.listSourcesStream({parent: formattedParent})
.on('data', element => {
// doThingsWith(element)
}).on('error', err => {
console.log(err);
});
matchAssetFromAssetSecurityMarksName(assetSecurityMarksName) → {String}
Parse the assetSecurityMarksName from a asset_security_marks resource.
Parameters:
| Name | Type | Description |
|---|---|---|
assetSecurityMarksName |
String |
A fully-qualified path representing a asset_security_marks resources. |
matchFindingFromFindingName(findingName) → {String}
Parse the findingName from a finding resource.
Parameters:
| Name | Type | Description |
|---|---|---|
findingName |
String |
A fully-qualified path representing a finding resources. |
matchFindingFromFindingSecurityMarksName(findingSecurityMarksName) → {String}
Parse the findingSecurityMarksName from a finding_security_marks resource.
Parameters:
| Name | Type | Description |
|---|---|---|
findingSecurityMarksName |
String |
A fully-qualified path representing a finding_security_marks resources. |
matchOrganizationFromAssetSecurityMarksName(assetSecurityMarksName) → {String}
Parse the assetSecurityMarksName from a asset_security_marks resource.
Parameters:
| Name | Type | Description |
|---|---|---|
assetSecurityMarksName |
String |
A fully-qualified path representing a asset_security_marks resources. |
matchOrganizationFromFindingName(findingName) → {String}
Parse the findingName from a finding resource.
Parameters:
| Name | Type | Description |
|---|---|---|
findingName |
String |
A fully-qualified path representing a finding resources. |
matchOrganizationFromFindingSecurityMarksName(findingSecurityMarksName) → {String}
Parse the findingSecurityMarksName from a finding_security_marks resource.
Parameters:
| Name | Type | Description |
|---|---|---|
findingSecurityMarksName |
String |
A fully-qualified path representing a finding_security_marks resources. |
matchOrganizationFromOrganizationName(organizationName) → {String}
Parse the organizationName from a organization resource.
Parameters:
| Name | Type | Description |
|---|---|---|
organizationName |
String |
A fully-qualified path representing a organization resources. |
matchOrganizationFromOrganizationSettingsName(organizationSettingsName) → {String}
Parse the organizationSettingsName from a organization_settings resource.
Parameters:
| Name | Type | Description |
|---|---|---|
organizationSettingsName |
String |
A fully-qualified path representing a organization_settings resources. |
matchOrganizationFromSourceName(sourceName) → {String}
Parse the sourceName from a source resource.
Parameters:
| Name | Type | Description |
|---|---|---|
sourceName |
String |
A fully-qualified path representing a source resources. |
matchSourceFromFindingName(findingName) → {String}
Parse the findingName from a finding resource.
Parameters:
| Name | Type | Description |
|---|---|---|
findingName |
String |
A fully-qualified path representing a finding resources. |
matchSourceFromFindingSecurityMarksName(findingSecurityMarksName) → {String}
Parse the findingSecurityMarksName from a finding_security_marks resource.
Parameters:
| Name | Type | Description |
|---|---|---|
findingSecurityMarksName |
String |
A fully-qualified path representing a finding_security_marks resources. |
matchSourceFromSourceName(sourceName) → {String}
Parse the sourceName from a source resource.
Parameters:
| Name | Type | Description |
|---|---|---|
sourceName |
String |
A fully-qualified path representing a source resources. |
organizationPath(organization) → {String}
Return a fully-qualified organization resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
organization |
String |
organizationSettingsPath(organization) → {String}
Return a fully-qualified organization_settings resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
organization |
String |
runAssetDiscovery(request, optionsopt, callbackopt) → {Promise}
Runs asset discovery. The discovery is tracked with a long-running operation.
This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is a gax.Operation object. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedParent = client.organizationPath('[ORGANIZATION]');
// Handle the operation using the promise pattern.
client.runAssetDiscovery({parent: formattedParent})
.then(responses => {
const [operation, initialApiResponse] = responses;
// Operation#promise starts polling for the completion of the LRO.
return operation.promise();
})
.then(responses => {
const result = responses[0];
const metadata = responses[1];
const finalApiResponse = responses[2];
})
.catch(err => {
console.error(err);
});
const formattedParent = client.organizationPath('[ORGANIZATION]');
// Handle the operation using the event emitter pattern.
client.runAssetDiscovery({parent: formattedParent})
.then(responses => {
const [operation, initialApiResponse] = responses;
// Adding a listener for the "complete" event starts polling for the
// completion of the operation.
operation.on('complete', (result, metadata, finalApiResponse) => {
// doSomethingWith(result);
});
// Adding a listener for the "progress" event causes the callback to be
// called on any change in metadata when the operation is polled.
operation.on('progress', (metadata, apiResponse) => {
// doSomethingWith(metadata)
});
// Adding a listener for the "error" event handles any errors found during polling.
operation.on('error', err => {
// throw(err);
});
})
.catch(err => {
console.error(err);
});
const formattedParent = client.organizationPath('[ORGANIZATION]');
// Handle the operation using the await pattern.
const [operation] = await client.runAssetDiscovery({parent: formattedParent});
const [response] = await operation.promise();
setFindingState(request, optionsopt, callbackopt) → {Promise}
Updates the state of a finding.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Finding. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedName = client.findingPath('[ORGANIZATION]', '[SOURCE]', '[FINDING]');
const state = 'STATE_UNSPECIFIED';
const startTime = {};
const request = {
name: formattedName,
state: state,
startTime: startTime,
};
client.setFindingState(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
setIamPolicy(request, optionsopt, callbackopt) → {Promise}
Sets the access control policy on the specified Source.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Policy. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]');
const policy = {};
const request = {
resource: formattedResource,
policy: policy,
};
client.setIamPolicy(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
sourcePath(organization, source) → {String}
Return a fully-qualified source resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
organization |
String | |
source |
String |
testIamPermissions(request, optionsopt, callbackopt) → {Promise}
Returns the permissions that a caller has on the specified source.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing TestIamPermissionsResponse. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]');
const permissions = [];
const request = {
resource: formattedResource,
permissions: permissions,
};
client.testIamPermissions(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
updateFinding(request, optionsopt, callbackopt) → {Promise}
Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Finding. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const finding = {};
client.updateFinding({finding: finding})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
updateOrganizationSettings(request, optionsopt, callbackopt) → {Promise}
Updates an organization's settings.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing OrganizationSettings. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const organizationSettings = {};
client.updateOrganizationSettings({organizationSettings: organizationSettings})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
updateSecurityMarks(request, optionsopt, callbackopt) → {Promise}
Updates security marks.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing SecurityMarks. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const securityMarks = {};
client.updateSecurityMarks({securityMarks: securityMarks})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
updateSource(request, optionsopt, callbackopt) → {Promise}
Updates a source.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Source. |
Example
const securityCenter = require('@google-cloud/security-center');
const client = new securityCenter.v1beta1.SecurityCenterClient({
// optional auth parameters.
});
const source = {};
client.updateSource({source: source})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});