9 Commits

Author SHA1 Message Date
Tom Limoncelli
6711d715fe Empty 2023-11-14 14:29:35 -05:00
Tom Limoncelli
0e602cf18c Merge pull request #374 from efficks/patch-1
Instruction for WSL
2023-07-13 11:11:35 -04:00
efficks
49f422021a Instruction for WSL
Add instruction to make it works on WSL2 and Ubuntu 22.04
2023-07-07 10:08:08 -04:00
Tom Limoncelli
70260bdbcf FOUND-649: random validation problems (#373) 2023-05-19 11:04:16 -04:00
Tom Limoncelli
32fbb23bd0 Clarify README 2022-11-30 09:14:46 -05:00
Tom Limoncelli
c6ea0dc870 Set expectations about the project in README.md 2022-08-25 13:36:54 -04:00
Ben Iofel
6517bfd21d Package missing bins for deb, rpm, and macports (#360) 2022-08-06 09:35:32 -04:00
6543
abb3bbe275 Update golang deps (#359)
* git ignore golang vendor folder

* update golang deps
2022-07-25 10:01:41 -04:00
Ali Azam
221010228e edit (#358)
Fix typo: 'afterwards'.
2022-07-05 12:17:30 -04:00
9 changed files with 38 additions and 8 deletions

3
.gitignore vendored
View File

@@ -57,3 +57,6 @@ docs/_build/
bbintegration
.*.swp
/integrationTest/.blackbox
# golang
/vendor/

View File

@@ -3,10 +3,16 @@ BlackBox [![CircleCI](https://circleci.com/gh/StackExchange/blackbox.svg?style=s
Safely store secrets in a VCS repo (i.e. Git, Mercurial, Subversion or Perforce). These commands make it easy for you to Gnu Privacy Guard (GPG) encrypt specific files in a repo so they are "encrypted at rest" in your repository. However, the scripts make it easy to decrypt them when you need to view or edit them, and decrypt them for use in production. Originally written for Puppet, BlackBox now works with any Git or Mercurial repository.
A slide presentation about an older release [is on SlideShare](http://www.slideshare.net/TomLimoncelli/the-blackbox-project-sfae).
WARNING: The goal of this project is to be a simple wrapper around `gpg` so you and your coworkers don't have to remember its all those inscrutable and confusing flags. It is *not* intended to be a sophisticated encryption system that solves all problems or supports a large numbers of files. The ideal use-case is to keep secrets in a secure service such as Conjur, AWS KMS, Azure Key Vault or GCP KMS; then use Blackbox for safely storing the API keys needed to access that system. That way you are encrypting a single, tiny, file. Feature-requests for anything more will be rejected; do not expect or even request "enterprise features". If this disappoints you, please consider a competiting project such as https://www.agwa.name/projects/git-crypt
A slide presentation (about an older release) [is on SlideShare](http://www.slideshare.net/TomLimoncelli/the-blackbox-project-sfae).
Join our mailing list: [https://groups.google.com/d/forum/blackbox-project](https://groups.google.com/d/forum/blackbox-project)
## What blackbox is NOT:
Table of Contents
=================
@@ -153,7 +159,7 @@ To add or fix support for a new operating system, look for the case statements i
Using BlackBox on Windows
=========================
BlackBox can be used with Cygwin or MinGW.
BlackBox can be used with Cygwin, MinGW or WSL2.
### Protect the line endings
@@ -201,6 +207,15 @@ Development:
- unknown (if you develop Blackbox under MinGW, please let us know if any additional packages are required to run `make test`)
### WSL2
If you get the following error in WSL2, you can try to setup your environment with the following instructions (Tested with Ubuntu 22.04 on WSL2):
- Install [Gpg4win](https://www.gpg4win.org/) (Tested with version 4.1.0)
- Import your private key in Gpg4win (you can use Kleopatra on your Windows host if you wish).
- Edit the file `~/.gnupg/gpg-agent.conf` on WSL and add the following line: `pinentry-program "/mnt/c/Program Files (x86)/GnuPG/bin/pinentry-basic.exe"`
- Restart gpg agent on your linux system: `gpg-connect-agent reloadagent /bye`
How is the encryption done?
===========================

View File

@@ -15,6 +15,11 @@ source "${0%/*}"/_stack_lib.sh
# Where are we?
: "${BLACKBOX_HOME:="$(cd "${0%/*}" ; pwd)"}" ;
# Make grep and sort work like it did in the 1970s:
# Without this, blackbox fails to match filenames in blackbox-files.txt
export LC_ALL='C'
export LANG='en_US.UTF-8'
# What are the candidates for the blackbox data directory?
#
# The order of candidates matter. The first entry of the array

View File

@@ -89,7 +89,7 @@ func flags() *cli.App {
Aliases: []string{"en", "end"},
Usage: "Encrypts file(s)",
Flags: []cli.Flag{
&cli.BoolFlag{Name: "shred", Usage: "Remove plaintext afterwords"},
&cli.BoolFlag{Name: "shred", Usage: "Remove plaintext afterwards"},
},
Action: func(c *cli.Context) error { return cmdEncrypt(c) },
},

2
go.mod
View File

@@ -6,6 +6,6 @@ require (
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/olekukonko/tablewriter v0.0.4
github.com/sergi/go-diff v1.1.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/urfave/cli/v2 v2.2.0
)

6
go.sum
View File

@@ -1,5 +1,4 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/StackExchange/blackbox v0.0.0-20200527125317-e049c02655d2 h1:iihTTtoGPPfol75KUvwzSe+dlrVlAA78Ky2r+PA/tI0=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
@@ -12,7 +11,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
@@ -22,8 +20,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

View File

@@ -3,6 +3,7 @@ exec /usr/bin/_stack_lib.sh ../bin/_stack_lib.sh
exec /usr/bin/blackbox_addadmin ../bin/blackbox_addadmin
exec /usr/bin/blackbox_cat ../bin/blackbox_cat
exec /usr/bin/blackbox_decrypt_all_files ../bin/blackbox_decrypt_all_files
exec /usr/bin/blackbox_decrypt_file ../bin/blackbox_decrypt_file
exec /usr/bin/blackbox_deregister_file ../bin/blackbox_deregister_file
exec /usr/bin/blackbox_diff ../bin/blackbox_diff
exec /usr/bin/blackbox_edit ../bin/blackbox_edit
@@ -13,8 +14,10 @@ exec /usr/bin/blackbox_listadmins ../bin/blackbox_listadmins
exec /usr/bin/blackbox_list_files ../bin/blackbox_list_files
exec /usr/bin/blackbox_list_admins ../bin/blackbox_list_admins
exec /usr/bin/blackbox_postdeploy ../bin/blackbox_postdeploy
exec /usr/bin/blackbox_recurse ../bin/blackbox_recurse
exec /usr/bin/blackbox_register_new_file ../bin/blackbox_register_new_file
exec /usr/bin/blackbox_removeadmin ../bin/blackbox_removeadmin
exec /usr/bin/blackbox_shred_all_files ../bin/blackbox_shred_all_files
exec /usr/bin/blackbox_update_all_files ../bin/blackbox_update_all_files
exec /usr/bin/blackbox_view ../bin/blackbox_view
exec /usr/bin/blackbox_whatsnew ../bin/blackbox_whatsnew

View File

@@ -3,6 +3,7 @@ exec bin/_stack_lib.sh ../bin/_stack_lib.sh
exec bin/blackbox_addadmin ../bin/blackbox_addadmin
exec bin/blackbox_cat ../bin/blackbox_cat
exec bin/blackbox_decrypt_all_files ../bin/blackbox_decrypt_all_files
exec bin/blackbox_decrypt_file ../bin/blackbox_decrypt_file
exec bin/blackbox_deregister_file ../bin/blackbox_deregister_file
exec bin/blackbox_diff ../bin/blackbox_diff
exec bin/blackbox_edit ../bin/blackbox_edit
@@ -13,8 +14,10 @@ exec bin/blackbox_listadmins ../bin/blackbox_listadmins
exec bin/blackbox_list_files ../bin/blackbox_list_files
exec bin/blackbox_list_admins ../bin/blackbox_list_admins
exec bin/blackbox_postdeploy ../bin/blackbox_postdeploy
exec bin/blackbox_recurse ../bin/blackbox_recurse
exec bin/blackbox_register_new_file ../bin/blackbox_register_new_file
exec bin/blackbox_removeadmin ../bin/blackbox_removeadmin
exec bin/blackbox_shred_all_files ../bin/blackbox_shred_all_files
exec bin/blackbox_update_all_files ../bin/blackbox_update_all_files
exec bin/blackbox_view ../bin/blackbox_view
exec bin/blackbox_whatsnew ../bin/blackbox_whatsnew

View File

@@ -5,6 +5,7 @@ exec /usr/blackbox/bin/_stack_lib.sh ../bin/_stack_lib.sh
exec /usr/blackbox/bin/blackbox_addadmin ../bin/blackbox_addadmin
exec /usr/blackbox/bin/blackbox_cat ../bin/blackbox_cat
exec /usr/blackbox/bin/blackbox_decrypt_all_files ../bin/blackbox_decrypt_all_files
exec /usr/blackbox/bin/blackbox_decrypt_file ../bin/blackbox_decrypt_file
exec /usr/blackbox/bin/blackbox_deregister_file ../bin/blackbox_deregister_file
exec /usr/blackbox/bin/blackbox_diff ../bin/blackbox_diff
exec /usr/blackbox/bin/blackbox_edit ../bin/blackbox_edit
@@ -15,8 +16,10 @@ exec /usr/blackbox/bin/blackbox_listadmins ../bin/blackbox_listadmins
exec /usr/blackbox/bin/blackbox_list_files ../bin/blackbox_list_files
exec /usr/blackbox/bin/blackbox_list_admins ../bin/blackbox_list_admins
exec /usr/blackbox/bin/blackbox_postdeploy ../bin/blackbox_postdeploy
exec /usr/blackbox/bin/blackbox_recurse ../bin/blackbox_recurse
exec /usr/blackbox/bin/blackbox_register_new_file ../bin/blackbox_register_new_file
exec /usr/blackbox/bin/blackbox_removeadmin ../bin/blackbox_removeadmin
exec /usr/blackbox/bin/blackbox_shred_all_files ../bin/blackbox_shred_all_files
exec /usr/blackbox/bin/blackbox_update_all_files ../bin/blackbox_update_all_files
exec /usr/blackbox/bin/blackbox_view ../bin/blackbox_view
exec /usr/blackbox/bin/blackbox_whatsnew ../bin/blackbox_whatsnew