
Research
/Security News
11 Malicious Go Packages Distribute Obfuscated Remote Payloads
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
@google-cloud/synthetics-sdk-api
Advanced tools
NodeJS distribution of the API Specification that must be complied with for integrating with Google Cloud Monitoring Synthetics
Note: This is an experimental package under active development. New releases may include breaking changes.
npm install --save @google-cloud/synthetics-sdk-api
Google Cloud Monitoring Synthetics requires a Cloud Function v2 target, and as such, this guide explains how to set up a simple function that uses the @google-cloud/synthetics-sdk-api
package.
$ npm init
$ npm install --save @google-cloud/synthetics-sdk-api
$ npm install --save @google-cloud/functions-framework
# This example uses node-fetch for http requests
$ npm install --save node-fetch
This package provides an easy to use express compatible middleware for writing code that is invoked by Google Cloud Monitoring Synthetics. When a user written function is provided to it, a response is sent that may be consumed by Google's services. The following is an example index.js
file that can be used as the entrypoint for a cloud function.
// index.js
const assert = require("node:assert");
const functions = require('@google-cloud/functions-framework');
const fetch = require("node-fetch");
const GcmSynthetics = require('@google-cloud/synthetics-sdk-api');
functions.http('SyntheticFunction', GcmSynthetics.runSyntheticHandler(async () => {
const url = 'https://www.google.com/'; // URL to send the request to
return await assert.doesNotReject(fetch(url));
}));
As long as a Google Cloud Function exposes an http endpoint that complies with the API spec as defined in the Synthetics SDK API package, the Cloud Function will work as a target for a Synthetic Monitor. As such, this package includes a proto definition that contains the api spec, as well as typescript types that are generated from that proto.
This is predominantly important if you want to run a programmatic workflow for which other SyntheticSDKs are not a good fit, or if you want to use another language for your Google Cloud function for which there is no direct support.
const functions = require('@google-cloud/functions-framework');
const { SyntheticResult, GenericResultV1 } = require('@google-cloud/synthetics-sdk-api');
FAQs
NodeJS distribution of the API Specification that must be complied with for integrating with Google Cloud Monitoring Synthetics
The npm package @google-cloud/synthetics-sdk-api receives a total of 1,501 weekly downloads. As such, @google-cloud/synthetics-sdk-api popularity was classified as popular.
We found that @google-cloud/synthetics-sdk-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).