karimsa / secrets

Manage secrets in config files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logo for secrets

secrets

Build status

Manage secrets in configuration files.

Installation

curl -sf https://gobinaries.com/karimsa/secrets/cmd/secrets | sh

Features

  • Encrypt/decrypt selective values
  • Supports yaml, json, and .env files
  • Editor mode to selectively re-encrypt secrets (better git diffs)

Usage

Encrypting secrets in a .env file

Encrypt example gif

$ cat .env
HELLO=SECURE-WORLD
HI=INSECURE-WORLD
$ secrets encrypt --in .env --out .env --key .HELLO
Passphrase: ******
$ cat .env
HELLO=64745a1f754b45bb60c40e14c04ead39afb0d774e9f25f90459de9f714da3ed19c94063e79649d38b0ebb5cc3eaf06554476cbf7bc65ef0cd472c28370bcdb57105343180700523771733f8cfe2e7222
HI=INSECURE-WORLD

Reveal secrets from .env file

Decrypt example gif

$ cat .env
HELLO=64745a1f754b45bb60c40e14c04ead39afb0d774e9f25f90459de9f714da3ed19c94063e79649d38b0ebb5cc3eaf06554476cbf7bc65ef0cd472c28370bcdb57105343180700523771733f8cfe2e7222
HI=INSECURE-WORLD
$ secrets decrypt --in .env --key .HELLO
Passphrase: ******
HELLO=SECURE-WORLD
HI=INSECURE-WORLD
$ cat .env
HELLO=64745a1f754b45bb60c40e14c04ead39afb0d774e9f25f90459de9f714da3ed19c94063e79649d38b0ebb5cc3eaf06554476cbf7bc65ef0cd472c28370bcdb57105343180700523771733f8cfe2e7222
HI=INSECURE-WORLD

Edit config file then re-encrypt changed values

Edit example gif

License

Licensed under MIT license.

About

Manage secrets in config files.

License:MIT License


Languages

Language:Go 100.0%