Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
serverless-google-cloudfunctions-awesome
Advanced tools
Provider plugin for the Serverless Framework v1.x which adds support for Google Cloud Functions.
This plugin enables support for Google Cloud Functions within the Serverless Framework.
This repo is a fork of the official Serverless Google Cloud Functions, but adds extra features
Google Cloud Functions recently got out of beta. This fork now uses their v1 instead of v1beta1. It also supports the NodeJS V8 environment, which is the default one.
To override, you can set the provider.runtime: nodejs6
option.
Since it's out of beta, it now supports more than one region.
You can set it with the provier.region: us-central1
option.
See https://cloud.google.com/functions/docs/locations for supported locations.
In the serverless.yml
, you can add prependService
and prependStage
to the provider
key.
For example, the configuration below
service: users
provider:
name: google
runtime: nodejs6
project: <project-id>
credentials: <credentials>
stage: purple
prependService: true
prependStage: true
functions:
login:
handler: login
entryPoint: login
events:
- http: path
will deploy your Google Cloud Function with:
name: my-awesome-service-purple-login
handler: login
// Note that the handler is not affected
trigger: https://us-central1-<project-id>.cloudfunctions.net/users-purple-login
It also adds an option to retry background jobs upon failure:
functions:
email:
handler: email
entryPoint: send
events:
- event:
eventType: providers/cloud.pubsub/eventTypes/topic.publish
resource: projects/${self:provider.project}/topics/${self:provider.stage}-new-account
retry: true
Use the environment
option to set environment variables.
It can be set at the provider
level, or at the function
level, or at both.
service: users
provider:
name: google
runtime: nodejs6
project: <project-id>
credentials: <credentials>
stage: purple
prependService: true
prependStage: true
environment:
KEY: my-dev-key
LANG: ca
functions:
login:
handler: login
entryPoint: login
events:
- http: path
environment:
KEY: my-prod-key
The function login
will have the environment variables as:
KEY: my-prod-key
LANG: ca
Special thanks to @CaptainJojo for his contribution to these awesome features.
The documentation can be found here.
You can spin up a Docker container which mounts this code with the following command:
docker-compose run node bash
FAQs
Provider plugin for the Serverless Framework v1.x which adds support for Google Cloud Functions.
We found that serverless-google-cloudfunctions-awesome demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.