All Projects → nalbion → serverless-plugin-encrypted

nalbion / serverless-plugin-encrypted

Licence: other
A Serverless plugin which encrypts Lambda environment variables using an KMS key which is automatically generated for each stage

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to serverless-plugin-encrypted

serverless-latest-layer-version
A serverless plugin that replaces 'latest' version tag to actual lambda layer version
Stars: ✭ 25 (+108.33%)
Mutual labels:  serverless-plugin
serverless-plugin-parcel
A Serverless framework plugin to bundle assets with Parcel (ES6/7 or Typescript)
Stars: ✭ 23 (+91.67%)
Mutual labels:  serverless-plugin
serverless-plugin-subscription-filter
Extend subscription filter events for the Serverless framework ⚡
Stars: ✭ 17 (+41.67%)
Mutual labels:  serverless-plugin
serverless-plugin-offline-kinesis-events
⚡ Serverless plugin that works with serverless-offline to allow offline testing of Serverless functions that are triggered by Kinesis events.
Stars: ✭ 15 (+25%)
Mutual labels:  serverless-plugin
serverless-certificate-creator
serverless plugin to manage the certificate of your lambdas custom domain (API Gateway=
Stars: ✭ 33 (+175%)
Mutual labels:  serverless-plugin
serverless-aws-static-file-handler
Easily serve static files with the Serverless Framework on AWS Lambda.
Stars: ✭ 43 (+258.33%)
Mutual labels:  serverless-plugin
Serverless Dotenv Plugin
Preload Environment Variables with Dotenv into Serverless
Stars: ✭ 250 (+1983.33%)
Mutual labels:  serverless-plugin
serverless-plugin-bespoken
⚡ Serverless plugin to use our bst proxy tool
Stars: ✭ 29 (+141.67%)
Mutual labels:  serverless-plugin
serverless-cloudformation-sub-variables
Serverless framework plugin for easily supporting AWS CloudFormation Sub intrinsic function variables
Stars: ✭ 25 (+108.33%)
Mutual labels:  serverless-plugin
serverless-python-requirements
⚡️🐍📦 Serverless plugin to bundle Python packages
Stars: ✭ 971 (+7991.67%)
Mutual labels:  serverless-plugin
serverless-vpc-discovery
Serverless plugin for discovering VPC / Subnet / Security Group configuration by name.
Stars: ✭ 35 (+191.67%)
Mutual labels:  serverless-plugin
serverless-fission
Use Fission through Serverless Framework https://serverless.com
Stars: ✭ 19 (+58.33%)
Mutual labels:  serverless-plugin
serverless-api-gateway-throttling
A plugin for the Serverless framework which configures throttling for API Gateway endpoints.
Stars: ✭ 54 (+350%)
Mutual labels:  serverless-plugin
serverless-appsync-simulator
A simple wrapper around Amplify AppSync Simulator to test serverless AppSync Apis
Stars: ✭ 106 (+783.33%)
Mutual labels:  serverless-plugin
serverless-plugin-epsagon
Epsagon's plugin for Serverless Framework ⚡️
Stars: ✭ 53 (+341.67%)
Mutual labels:  serverless-plugin
serverless-content-encoding
Serverless plugin to enable content encoding for response compression
Stars: ✭ 14 (+16.67%)
Mutual labels:  serverless-plugin
serverless-alexa-skills
Manage your Alexa Skills with Serverless Framework
Stars: ✭ 69 (+475%)
Mutual labels:  serverless-plugin
serverless-dynamodb-ttl
⚡️ Serverless Plugin to set DynamoDB TTL
Stars: ✭ 16 (+33.33%)
Mutual labels:  serverless-plugin
serverless-plugin-browserifier
Reduce the size and speed up your Node.js based lambda's using browserify.
Stars: ✭ 26 (+116.67%)
Mutual labels:  serverless-plugin
serverless-package-external
Add external folders to the deploy package 📦
Stars: ✭ 53 (+341.67%)
Mutual labels:  serverless-plugin

serverless-plugin-encrypted

A Serverless plugin which encrypts Lambda environment variables using an KMS key which is automatically generated for each stage.

Note

An alternative approach is to use AWS Secrets Manager

environment: #${ssm:/aws/reference/secretsmanager/${self:custom.stage}/config~true}

Installation

yarn add -D serverless-plugin-encrypted

or

npm install --save-dev serverless-plugin-encrypted

Usage

service: my-service
provider:
  name: aws
  runtime: nodejs6.10
  role: lambda-role
  stage: DEV
  region: ap-southeast-2
  
plugins:
  - serverless-plugin-encrypted
    
custom:
  kmsKeyId: ${self:provider.stage}-my-service
  encrypted:
    SECRET_PASSWORD: ${env:MY_SECRET_PASSWORD}
        
functions:
  my-function:
    handler: index.handler
    environment:
      NOT_SECRET: ${env:NOT_SECRET}
      SECRET_PASSWORD: ${self:custom.encrypted.SECRET_PASSWORD}
$ serverless deploy

The plugin will look for a KMS key with alias DEV-my-service, and create it if it does not exist. Then it will go through all environment variables within provider and each function.
If it finds an entry in custom.encrypted with a matching name it will use the KMS key to encrypt the value (eg: custom.encrypted.SECRET_PASSWORD) and update the provider and function values.

Note: The original values in the provider and functions will be discarded. ie functions.my-function.environment.SECRET_PASSWORD has been set to ${self:custom.encrypted.SECRET_PASSWORD} in the example above, but it could be anything really, although it is a recommended convention.

When the plugin creates the KMS key, a policy will be created for it which allows:

  • the account root user to manage the key
  • anybody to encrypt
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].