No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
project
src
.gitignore
.travis.yml
LICENSE
README.md
build.sbt

README.md

Secret Keeper - JAR

Build Status Download Coverage Status

Introduction

Without secret-keeper, you would have:

  • hard-coded your secrets in your version-controlled source code (Worst!), or
  • created a not-version-controlled config file and manually provide it when you deploy your code, or
  • let your deployment system - Jenkins CI, etc - mananage your not-version-controlled config file, but you have as many of them as your projects.

With secret-keeper, you can:

  • store your secrets in AWS and let your applications use it safely and conveniently.
  • let AWS manage contents of your secrets, keeping them encoded and safe.
  • version-control usage of secrets inside your applications, since secrets are referred only with their aliases.
  • simply provide access key and secret key of your dedicated IAM user to your deployment system. You don't have to manage per-project config files.

Install

Add following lines in your build.sbt:

resolvers += Resolver.bintrayRepo("ridi-data", "maven")
libraryDependencies += "com.ridi" %% "secret-keeper-jar" % "0.1.0"

Preparation

Usage

  • Write a sample application.

    import com.ridi.secretkeeper.SecretKeeper
    
    object Sample extends App {
      val secret = SecretKeeper.tell("sample.secret")
      println(s"Secret: $secret")
    }
  • Run the sample application. You must provide the dedicated user's access key and secret key, and the region as environment variables.

$ export CLASSPATH=/path/to/your/jar/files
$ export SECRETKEEPER_AWS_ACCESS_KEY="YOUR_ACCESS_KEY_ID"
$ export SECRETKEEPER_AWS_SECRET_KEY="YOUR_SECRET_ACCESS_KEY"
$ export SECRETKEEPER_AWS_REGION="us-east-1"
$ scalac Sample.scala
$ scala Sample
Secret: pa$$w@rd!