ecfg 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +22 -0
- data/bin/ecfg +23 -0
- data/build/darwin-amd64/ecfg +0 -0
- data/build/linux-amd64/ecfg +0 -0
- data/ecfg.gemspec +20 -0
- data/lib/ecfg/version.rb +3 -0
- data/man/man1/ecfg-decrypt.1 +25 -0
- data/man/man1/ecfg-encrypt.1 +28 -0
- data/man/man1/ecfg-keygen.1 +22 -0
- data/man/man1/ecfg.1 +59 -0
- data/man/man5/ecfg.5 +87 -0
- metadata +57 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8efdd4d0e48264d36d74d1f58e31f1845d9bcfff
|
4
|
+
data.tar.gz: 8c09c019102a2858b18a9c745f525c30d15dcb03
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cc6474f290df48e039877cdd3157d41b8266b8adcf4bc2b6476b6eb1e6f14281aab60507a468c643bcfbca058cc3ce2354c70b8eb653c3883270104ff67d1d56
|
7
|
+
data.tar.gz: 7b3fc93a30c82ae36bde6cdc566926d2d7628ee8ed482f6bd7fbe654b36f3c6e17513552b176fb31a0c9bf2c36e2d2106a47644ef951bf34d7397a401c7757e2
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 - 2016 Shopify
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/bin/ecfg
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
platform = `uname -sm`
|
4
|
+
|
5
|
+
platform_dir = case platform
|
6
|
+
when /^Darwin/
|
7
|
+
'darwin-amd64'
|
8
|
+
when /^Linux.*64/
|
9
|
+
'linux-amd64'
|
10
|
+
else
|
11
|
+
abort 'ecfg is not supported on your platform.'
|
12
|
+
end
|
13
|
+
|
14
|
+
bindir = File.expand_path("../../build/#{platform_dir}", __FILE__)
|
15
|
+
|
16
|
+
exec(
|
17
|
+
{
|
18
|
+
'PATH' => "#{bindir}:#{ENV['PATH']}",
|
19
|
+
'MANPATH' => File.expand_path('../../man', __FILE__)
|
20
|
+
},
|
21
|
+
'ecfg',
|
22
|
+
*ARGV
|
23
|
+
)
|
Binary file
|
Binary file
|
data/ecfg.gemspec
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require File.expand_path('../lib/ecfg/version', __FILE__)
|
3
|
+
|
4
|
+
files = File.read("MANIFEST").lines.map(&:chomp)
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ecfg"
|
8
|
+
spec.version = Ecfg::VERSION
|
9
|
+
spec.authors = ["Burke Libbey"]
|
10
|
+
spec.email = ["burke.libbey@shopify.com"]
|
11
|
+
spec.summary = %q{Asymmetric keywise encryption for configuration}
|
12
|
+
spec.description = %q{Secret management by encrypting values in a JSON or YAML file with a public/private keypair}
|
13
|
+
spec.homepage = "https://github.com/Shopify/ecfg"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = files
|
17
|
+
spec.executables = ["ecfg"]
|
18
|
+
spec.test_files = []
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
end
|
data/lib/ecfg/version.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "ECFG\-DECRYPT" "1" "July 2016" "Shopify" "Version 0.0.1"
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBecfg\-decrypt\fR \- decrypt an ecfg file
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBecfg decrypt\fR [\fB\-t\fR|\fB\-\-type\fR \fIfiletype\fR] [\fIfile\fR]
|
11
|
+
.
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
\fBecfg decrypt\fR decrypts the given file; that is, decrypts all the encrypted keys within it, printing the full decrypted file to stdout\. The key mentioned in the ecfg(5) file must be present in the keydir unless \fBECFG_PRIVATE_KEY\fR is present in the environment\. See ecfg(1) for more on key lookup semantics\.
|
14
|
+
.
|
15
|
+
.P
|
16
|
+
If no filename is given, data will instead be read from \fBstdin\fR\.
|
17
|
+
.
|
18
|
+
.SH "OPTIONS"
|
19
|
+
.
|
20
|
+
.TP
|
21
|
+
\fB\-t\fR, \fB\-\-type\fR="json|yaml"
|
22
|
+
Specify the filetype\. Required when passing data from \fBstdin\fR and when \fIfile\fR does not end in "\.ecfg\.json" or "\.ecfg\.yaml"\.
|
23
|
+
.
|
24
|
+
.SH "SEE ALSO"
|
25
|
+
ecfg(1), ecfg\-encrypt(1), ecfg\-keygen(1), ecfg(5)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "ECFG\-ENCRYPT" "1" "July 2016" "Shopify" "Version 0.0.1"
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBecfg\-encrypt\fR \- encrypt an ecfg file
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBecfg encrypt\fR [\fB\-t\fR|\fB\-\-type\fR \fIfiletype\fR] [\fIfile\fR]
|
11
|
+
.
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
\fBefcg encrypt\fR encrypts any unencrypted data in the given file or, if no filename is given, \fBstdin\fR\.
|
14
|
+
.
|
15
|
+
.P
|
16
|
+
If a filename is given, that file will be modified in place; or, if the data is being read from \fBstdin\fR, the encrypted file will be written to \fBstdout\fR\.
|
17
|
+
.
|
18
|
+
.P
|
19
|
+
See ecfg(5) for information on the structure of an encryptable file\.
|
20
|
+
.
|
21
|
+
.SH "OPTIONS"
|
22
|
+
.
|
23
|
+
.TP
|
24
|
+
\fB\-t\fR, \fB\-\-type\fR="json|yaml"
|
25
|
+
Specify the filetype\. Required when passing data from \fBstdin\fR and when \fIfile\fR does not end in "\.ecfg\.json" or "\.ecfg\.yaml"\.
|
26
|
+
.
|
27
|
+
.SH "SEE ALSO"
|
28
|
+
ecfg(1), ecfg\-decrypt(1), ecfg\-keygen(1), ecfg(5)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "ECFG\-KEYGEN" "1" "July 2016" "Shopify" "Version 0.0.1"
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBecfg\-keygen\fR \- generate a new keypair for use with ecfg
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBecfg keygen\fR [\fB\-w\fR|\fB\-\-write\fR]
|
11
|
+
.
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
Generates a new keypair suitable for use with ecfg(1) and prints the resulting public and private keys to \fBstdout\fR\. The public key should be inserted into an ecfg(5) document and the private key should be stored in the keydir of the decrypting system(s)\.
|
14
|
+
.
|
15
|
+
.SH "OPTIONS"
|
16
|
+
.
|
17
|
+
.TP
|
18
|
+
\fB\-w\fR, \fB\-\-write\fR
|
19
|
+
Rather than printing the keypair to the screen, write it directly to the keydir\. The public key will still be printed, but the private key will be inserted into the keydir
|
20
|
+
.
|
21
|
+
.SH "SEE ALSO"
|
22
|
+
ecfg(1), ecfg\-encrypt(1), ecfg\-decrypt(1), ecfg(5)
|
data/man/man1/ecfg.1
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "ECFG" "1" "July 2016" "Shopify" "Version 0.0.1"
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBecfg\fR \- manage application secrets via encrypted config
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBecfg\fR \fBcommand\fR [\fBargs\fR]
|
11
|
+
.
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
\fBecfg\fR is a utility for managing a collection of secrets, typically to be committed to source control\. The secrets are encrypted using public key, elliptic curve cryptography\. Secrets are collected in a JSON or YAML file, in which all the string values are encrypted\. Public keys are embedded in the file, and the decrypter looks up the corresponding private key from its local filesystem or process environment\.
|
14
|
+
.
|
15
|
+
.P
|
16
|
+
See ecfg(5) for more information on the \fBecfg\fR file format, and read on for a workflow example\.
|
17
|
+
.
|
18
|
+
.SH "COMMANDS"
|
19
|
+
.
|
20
|
+
.TP
|
21
|
+
\fBecfg help\fR [\fIcommand\fR]
|
22
|
+
Show (this) help for \fBecfg\fR in general, or for a specific command
|
23
|
+
.
|
24
|
+
.TP
|
25
|
+
\fBecfg encrypt\fR : ecfg\-encrypt(1)
|
26
|
+
Encrypt an \fBecfg\fR file (alias: \fBecfg e\fR)
|
27
|
+
.
|
28
|
+
.TP
|
29
|
+
\fBecfg decrypt\fR : ecfg\-decrypt(1)
|
30
|
+
Decrypt an \fBecfg\fR file (alias: \fBecfg d\fR)
|
31
|
+
.
|
32
|
+
.TP
|
33
|
+
\fBecfg keygen\fR : ecfg\-keygen(1)
|
34
|
+
Generate an \fBecfg\fR keypair (alias: \fBecfg g\fR)
|
35
|
+
.
|
36
|
+
.SH "ENVIRONMENT"
|
37
|
+
.
|
38
|
+
.TP
|
39
|
+
\fBECFG_KEYDIR\fR
|
40
|
+
Override the default key lookup directory of /opt/ecfg/keys\.
|
41
|
+
.
|
42
|
+
.TP
|
43
|
+
\fBECFG_PRIVATE_KEY\fR
|
44
|
+
When decrypting, instead of looking up the matching private key for the public key given in the input file, assume the file was encrypted to the provided private key\. This option is useful when running in environments such as heroku where obtaining keys from disk is impractical\.
|
45
|
+
.
|
46
|
+
.SH "WORKFLOW"
|
47
|
+
TODO
|
48
|
+
.
|
49
|
+
.SH "BUGS"
|
50
|
+
Report security issues to \fIburke\.libbey@shopify\.com\fR and \fIsecurity@shopify\.com\fR\.
|
51
|
+
.
|
52
|
+
.P
|
53
|
+
File non\-security\-related bugs at \fIhttps://github\.com/Shopify/ecfg\fR\.
|
54
|
+
.
|
55
|
+
.SH "COPYRIGHT"
|
56
|
+
\fBecfg\fR is copyright (C) 2016 Shopify under MIT license\.
|
57
|
+
.
|
58
|
+
.SH "SEE ALSO"
|
59
|
+
ecfg\-encrypt(1), ecfg\-decrypt(1), ecfg\-keygen(1), ecfg(5)
|
data/man/man5/ecfg.5
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "ECFG" "5" "July 2016" "Shopify" "Version 0.0.1"
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBecfg\fR \- JSON or YAML file with asymmetric\-key\-encrypted values
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
An \fBecfg\fR file is syntactically a \fBjson\fR or \fByaml\fR file, but with a few minor semantic additions described below\.
|
11
|
+
.
|
12
|
+
.SH "PUBLIC KEY"
|
13
|
+
Each \fBecfg\fR file must have a key at the top level named \fB_public_key\fR\. This implies that the top\-level structure must be a hashmap, not an array\.
|
14
|
+
.
|
15
|
+
.P
|
16
|
+
The \fB_public_key\fR key must have a string value, which is a hex\-encoded 32\-byte (totalling 64 ASCII bytes) public key as generated by \fIecfg\-keygen\fR(1)\.
|
17
|
+
.
|
18
|
+
.P
|
19
|
+
By convention, \fB_public_key\fR should be the first key in the file\.
|
20
|
+
.
|
21
|
+
.SH "ENCRYPTABLE VALUES"
|
22
|
+
A value is considered encryptable if:
|
23
|
+
.
|
24
|
+
.IP "1." 4
|
25
|
+
It is a string literal (numbers, true, false, null all remain unencrypted);
|
26
|
+
.
|
27
|
+
.IP "2." 4
|
28
|
+
It is not an object key (ie\. not immediately followed by a ":");
|
29
|
+
.
|
30
|
+
.IP "3." 4
|
31
|
+
Its corresponding object key did not begin with an underscore ("_")\.
|
32
|
+
.
|
33
|
+
.IP "" 0
|
34
|
+
.
|
35
|
+
.P
|
36
|
+
Take special note of point 3\. This is the reason \fB_public_key\fR isn\'t encrypted, and can be used to construct metadata schemes\. For example, in the excerpt below, only the values for \fBrotation_password\fR and \fBsecret\fR will be encrypted\.
|
37
|
+
.
|
38
|
+
.IP "" 4
|
39
|
+
.
|
40
|
+
.nf
|
41
|
+
|
42
|
+
"my_secret": {
|
43
|
+
"_description": "API key for foocorp",
|
44
|
+
"_rotation": "https://example\.com/foocorp/apikey",
|
45
|
+
"_rotation_username": "admin",
|
46
|
+
"rotation_password": "password",
|
47
|
+
"secret": "123123123123123123123"
|
48
|
+
}
|
49
|
+
.
|
50
|
+
.fi
|
51
|
+
.
|
52
|
+
.IP "" 0
|
53
|
+
.
|
54
|
+
.P
|
55
|
+
Also note that this underscore "unencryptable" attribute is not heritable\. For example, the password in this excerpt \fBwill\fR be encrypted\.
|
56
|
+
.
|
57
|
+
.IP "" 4
|
58
|
+
.
|
59
|
+
.nf
|
60
|
+
|
61
|
+
"_unencryptable": {
|
62
|
+
"password": "encrypted anyway"
|
63
|
+
}
|
64
|
+
.
|
65
|
+
.fi
|
66
|
+
.
|
67
|
+
.IP "" 0
|
68
|
+
.
|
69
|
+
.SH "SECRET SCHEMA"
|
70
|
+
When a value is encrypted, it will be replaced by a relatively long string of the form \fI"EJ[V:P:N:M]"\fR\. The fields are:
|
71
|
+
.
|
72
|
+
.IP "\(bu" 4
|
73
|
+
\fBV\fR (decimal\-as\-string int) Schema Version, hard\-coded to "1" for now
|
74
|
+
.
|
75
|
+
.IP "\(bu" 4
|
76
|
+
\fBP\fR (base64\-encoded 32\-byte array) Public key of an ephemeral keypair used to encrypt this key
|
77
|
+
.
|
78
|
+
.IP "\(bu" 4
|
79
|
+
\fBN\fR (base64\-encoded 24\-byte array) Nonce used to encrypt this key
|
80
|
+
.
|
81
|
+
.IP "\(bu" 4
|
82
|
+
\fBM\fR (base64\-encoded variable\-length array) Raw ciphertext
|
83
|
+
.
|
84
|
+
.IP "" 0
|
85
|
+
.
|
86
|
+
.SH "SEE ALSO"
|
87
|
+
ecfg(1), ecfg\-encrypt(1), ecfg\-decrypt(1), ecfg\-keygen(1)
|
metadata
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ecfg
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Burke Libbey
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-07-08 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Secret management by encrypting values in a JSON or YAML file with a
|
14
|
+
public/private keypair
|
15
|
+
email:
|
16
|
+
- burke.libbey@shopify.com
|
17
|
+
executables:
|
18
|
+
- ecfg
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- LICENSE
|
23
|
+
- bin/ecfg
|
24
|
+
- build/darwin-amd64/ecfg
|
25
|
+
- build/linux-amd64/ecfg
|
26
|
+
- ecfg.gemspec
|
27
|
+
- lib/ecfg/version.rb
|
28
|
+
- man/man1/ecfg-decrypt.1
|
29
|
+
- man/man1/ecfg-encrypt.1
|
30
|
+
- man/man1/ecfg-keygen.1
|
31
|
+
- man/man1/ecfg.1
|
32
|
+
- man/man5/ecfg.5
|
33
|
+
homepage: https://github.com/Shopify/ecfg
|
34
|
+
licenses:
|
35
|
+
- MIT
|
36
|
+
metadata: {}
|
37
|
+
post_install_message:
|
38
|
+
rdoc_options: []
|
39
|
+
require_paths:
|
40
|
+
- lib
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
requirements: []
|
52
|
+
rubyforge_project:
|
53
|
+
rubygems_version: 2.2.3
|
54
|
+
signing_key:
|
55
|
+
specification_version: 4
|
56
|
+
summary: Asymmetric keywise encryption for configuration
|
57
|
+
test_files: []
|