It is a package and command line application that provides you to store encrypted credentials/secrets in your repository.

sypher[ ⚠️ Work in progress]

sypher provides you to store your credentials and secrets as encrypted in your repository.

Usage

Install the command line application:

go get github.com/sertangulveren/sypher/sypher

Generate credential(s):

The gen command as below will create your credentials under the sypher folder in your working directory:

sypher gen

It will be generate your credentials as below:

sypher
├── master.enc
└── master.key

You can provide names to generator.

For example:

sypher gen development test production

The program will generate files as below:

sypher
├── development.enc
├── development.key
├── production.enc
├── production.key
├── test.enc
└── test.key

Definitely ignore the key files with .gitignore:

You can ignore your key files manually with the .gitignore file or use the gitignore command. This command will generate or modify your .gitignore file.

sypher gitignore

⚠️ Before commit, be sure to check that the ignore operation is working properly:

How to make changes on credentials:

Use edit command to make changes on your credentials. In this case, sypher will launch an editor(vim by default) with your decrypted credentials. When you save the changes and close the editor, sypher immediately reads your new credentials and writes it to encrypted credential file in your project.

For example:

sypher edit production

To use another editor like Visual Studio Code:

EDITOR=code sypher edit production

How to deploy key files:

Instead of using key files in your cloud or development environment, you should set the SYPHER_MASTER_KEY environment variable.

Package Usage

In your program, all your need to do is to import sypher.

package main

import "github.com/sertangulveren/sypher"

func main() {
  // loads sypher/master.enc with sypher/master.key OR SYPHER_MASTER_KEY.
  sypher.Load()
  awsKey := sypher.Get("AWS_SECRET_KEY")
  //...
}

Example for production:

package main

import (
	"github.com/sertangulveren/sypher"
	"os"
)

func main() {
	// APP_ENV=production
	// SYPHER_MASTER_KEY=abcd...
	// production.key application has no production.key
	// loads sypher/production.enc with SYPHER_MASTER_KEY.
	sypher.Load(
	  sypher.Config{Name: os.Getenv("APP_ENV")},
	)

	awsKey := sypher.Get("AWS_SECRET_KEY")
	//...
}

Todos:

  • Embed on building.
  • Get it ready to be used.
  • Missing tests should be done.
  • Code quality improvements.
  • ...
Similar Resources

High-level YugabyteDB RPC and command line client

YugabyteDB Client API YugabyteDB Client API provides high level API operations and command line interface for YugabyteDB RPC. Command line interface i

Jan 8, 2022

Package captcha is a middleware that provides captcha service for Flamego

auth Package captcha is a middleware that provides captcha service for Flamego. Installation The minimum requirement of Go is 1.16. go get github.com/

Dec 14, 2022

Utilcanvas is a package which provides some utilities to interface with the Canvas LMS Api.

Utilcanvas Utilcanvas is a package which provides some utilities to interface with the Canvas LMS Api. Example usage c := utilcanvas.NewClient("https:

Dec 21, 2022

This package provides a Go interface for the Typeform API.

typeform This package provides a Go interface for the Typeform API

Dec 4, 2022

Package anko provides a golang SDK to the Anko Investor Forecasts gRPC service.

github.com/anglo-korean/anko-go-sdk Package anko provides a golang SDK to the Anko Investor Forecasts gRPC service. import "github.com/anglo-korean/an

Jan 3, 2022

Package figtree provides a multi-paradigm SDK for sophisticated configuration file access

Package figtree provides a multi-paradigm SDK for sophisticated configuration file access. Motivation Figtree syntax is based on classic key/value pai

Dec 31, 2021

Command line interface to windows clipboard over KiTTY remote-control printing

kclip Command line interface to windows clipboard over KiTTY remote-control printing About This tool behaves like the cat command, it just tries to pa

Dec 12, 2021

GoSearch: Search the Go packages via command-line

GoSearch Search the Go packages for pkg.go.dev via command-line. It supports all search options in Search Help. Installation go get github.com/mingram

Jun 23, 2022

A small command line tool for testing grok patterns on file contents.

grogg A small command line tool for testing grok patterns on file contents. It uses the vjeantet/grok library for parsing and pterm for some extra glo

Feb 5, 2022
starenv allows populating environmental variables from variety of sources, such as AWS Parameter Store, GPG encrypted files and more, with extreme ease.

starenv (*env) allows populating environmental variables from variety of sources, such as AWS Parameter Store, GPG encrypted files and more, with extr

Nov 25, 2022
Easily manage your github credentials
Easily manage your github credentials

HUB ADMIN Hub Admin is a command-line tool managing your github credentials Installation go get github.com/crewdevio/HubAdmin How to use Open he

Oct 20, 2021
csg ("Credential Storage with Go") - a tool to organize the storage of credentials found during a CTF or Pentest.
csg (

csg csg ("Credential Storage with Go") - a tool to organize the storage of credentials found during a CTF or Pentest. Check out my blog on csg for mor

Dec 9, 2021
Assume-shell - A tool to create a shell with AWS environment credentials set

assume-shell This tool will request AWS credentials for a given profile/role and

Sep 29, 2022
Assume AWS IAM roles from GitHub Actions workflows with no stored secrets
Assume AWS IAM roles from GitHub Actions workflows with no stored secrets

AWS IAM roles for GitHub Actions workflows Background and rationale GitHub Actions are a pretty nice solution for CI/CD. Where they fall short is inte

Feb 12, 2022
A command-line tool to pretty print your system's PATH environment variable.
A command-line tool to pretty print your system's PATH environment variable.

Description A command-line tool to pretty print your system's PATH environment variable. The output paths are colorized if they have special associati

Nov 9, 2022
Plot your repository stars over time.

Plot your repository stars over time.

Dec 30, 2022
Is a microservice which provides payment token service for application users.

Tulip Is a microservice which provides payment token service for application users. Description A transactional-based token usually used for transacti

Feb 17, 2022
A simple command line -based snake game built with go and termbox
A simple command line -based snake game built with go and termbox

snake-task Snake Game A simple command line -based snake game built with go and termbox library. This is a test task for a Golang positon. It took me

Jan 16, 2022
Maven-client - A command line tool to query first order and transitive maven coordinates based off an initial list of coordinates.

maven-client Description This CLI reads a list of maven group artifact version (GAV) coordinates and returns an ordered list of first order and transi

Jan 6, 2022