GithubHelp home page GithubHelp logo

karanpal-dhillon / self-destruct-o Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juzerali/self-destruct-o

0.0 1.0 0.0 31 KB

Serverless one-time password sharing app

JavaScript 30.21% HTML 69.79%

self-destruct-o's Introduction

Self-destruct-o

A serverless service for posting/retrieving secrets that self destruct from the backend on read.

Secrets are stored in DynamoDB with a 7 day TTL.

DynamoDB stores the data at rest encrypted via DynamoDB server side encryption.

Individual items are encrypted using envelope encryption with per-item encryption keys.

The master key is stored in AWS KMS and only accessible to the root AWS account, and the Lambda function that reads from DynamoDB.

Users can optionally provide a passphrase. When using a passphrase, an encryption key is derived from the passphrase using PBDKF2, and the secret is encrypted with AES-256 in CBC mode (in the browser) prior to being sent to the backend.

Installation

First, you need to provision a KMS key (which will cost you 1$/month)

Creating a KMS key:

aws kms create-key --region us-east-1 --description 'self-destruct-o'

Take note of that KSM key id.

Setup a SSM parameter for the key id:

aws ssm put-parameter --region us-east-1 \
--name "/self-destruct-o/kms-key-id" \
--value "YOURKEYIDHERE" --type SecureString

Setup dependancies

npm i serverless -g
npm i

Deploy the code to AWS. This will create a DynamoDB table, setup the API Gateway endpoint, upload the Lambda.

sls deploy -s dev --region us-east-1

This command should output the three API gateway endpoints. To hit the one with the UI, look for the GET endpoint that doesn't have a parameter.

Enjoy your newly created password sharing system.

Key management

To rotate the key, simply create a new key in KMS, and update the SSM parameter used by the Lambdas. Old secrets will still work as long as the KMS key is ok. Once you've updated SSM, schedule the old key to be deleted.

self-destruct-o's People

Contributors

marksteele avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.