syncret

command module
v0.0.0-...-7613d23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2021 License: MIT Imports: 18 Imported by: 0

README

Build Status Codacy Badge Codacy Badge Go Report Card

syncret

Sync encrypted secrets and their metadata from the local file system to AWS parameter store

Example:

Given the following file structure:

secrets
|_ prod
   |_my-service
        |_DB_URL.gpg
        |_DB_URL.pattern
        |_DB_URL.description
        |_SECRET_KEY.gpg
        |_SECRET_KEY.pattern
        |_SECRET_KEY.description

Basic decryption logic on path in a decrypt.sh like:

#!/usr/bin/env bash

set -e

gpg --decrypt ${1}

The following command will print all the metadata (not the values) for the matching secrets:

SYNCRET_DECRYPT=decrypt.sh syncret -prefix secrets/ secrets/prod/my-service/*.gpg

And this command will actually install the secrets in AWS:

SYNCRET_DECRYPT=decrypt.sh syncret -commit -prefix secrets/ secrets/prod/my-service/*.gpg

They'll be accessible within the parameter store as:

prod/my-service/DB_URL
prod/my-service/SECRET_KEY

decryption logic

Any encryption scheme can be swapped out; only constraint is that SYNCRET_DECRYPT be a command on your path that takes as its first argument the file to decrypt and spits it out onto stdout.

Intended use case

When used with version tracking as a push hook, syncret can provide continuous (and secure) deployment of secrets.

The following command installs any modified or added secrets in the secrets directory:

git diff --diff-filter=d --name-only ${SHA_1} ${SHA_2} -- secrets/ | syncret -prefix secrets/

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL