Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@seek/kms-config

Package Overview
Dependencies
Maintainers
35
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@seek/kms-config

Decrypt KMS encrypted values in config files

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
35
Created
Source

config ⇒ Promise

Decrypt KMS encrypted values in config files. This tool is optimised for use in node 4.3.2 AWS Lambda functions but should work in any modern node runtime.

Install

npm install --save @seek/kms-config

Usage

The user that is running the lambda will need kms:Decrypt permission to the master key used for generating the ciphertext. Warning* To reduce KMS overhead you should just call this once and cache the result if possible.

myConfig.json
{
    "foo" : "bar",
    "kms" { //All the values in this object are expected to be KMS ciphertext 
        "secretToHappiness" : "base64_encoded_ciphertext"
    }
}
handler.js
const myConfig = require('./myConfig')
const config  = require('@seek/kms-config')(myConfig)

config.then(resolved => {
    console.log(resolved.foo) // "bar"
    console.log(resolved.kms.secretToHappiness) // "eat more chocolate"
}).catch(err => {
    console.log(err, "Oh dear perhaps you are missing KMS permissions")
})
...

Returns: Promise - A promise to the loaded config which will be resolved with all kms values decrypted.

ParamTypeDescription
configObjectA config object which may contain a child kms object who's values are KMS ciphertext

FAQs

Package last updated on 15 Jan 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc