chef-vault 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzRiMDI2MTkzOTA2MzcxOTRmNWY0OWNjYmZlZjIzNjYyMDE0ZTdmMw==
4
+ MDMxOTgyNjE2N2UyYWE3YTcxMTUzZTIzZmNlYTY3NjU2ZDBkNzFkYw==
5
5
  data.tar.gz: !binary |-
6
- YzllYTQ2OGQyYzcyYjFjOTE4NWYyNTlhOTEyMGNiZDBmOTFmYTMyZA==
6
+ YjlmNzBhZDFiYzNmODI4MGVlYjljZDk2NGRiY2E4ZDliN2I1ODkzOA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZGM0NmM5Mzg2OTc1MmNlMzA1ZWQyZDY3N2VhYzViNGIzZTNiMjc3NmRhNDNm
10
- ODM2M2NhMmExMDljMjc2ODIzMWM3NGJiNzZlODc3MTFjNWE5ZGYxNDQwNWZi
11
- NGNhOWM4ZGRjN2JmMTYyYTVjYzJlNmZiZmY1ODI4MmU1NzI1Zjk=
9
+ YTY0YTFkZWNmOGY0ZTIwZDBmMWIwOGY4YmEwMDI5ZmJhZWRlOWI0MmI4MTYx
10
+ MGRjNDg2OTdjZDM2OWNiMWMyODk0ZmE5MWU5OGU3YWIyODBjOWY0NTQ5MTc4
11
+ MjdjNmQ5NjI0MGMyMDU5NzUzYTM3OTQ0ODMxYjYzYzEyZGQ4MWY=
12
12
  data.tar.gz: !binary |-
13
- YzE2MjY4MzY0N2U5ZjE3NzQ0NmY4YjMyM2Y4ZDI3Yjc5MDVhYTNmYWIwNzU4
14
- NWIzOGUwNjMzMmE5NTEyOTk3Mzc2MmRhNjIzN2FjODM4Yzg2ODQ2ZDIwNDlj
15
- NjIzNTdhN2E4MDQ0NDQ3MjE1NWU3MWQwODcxMGVlYzAxMDk0NTk=
13
+ MGY2M2RmODJkNTdhN2FmMzVlMjA5MmNmYzVkZGE3NjMzOTY0MDJlNThlODdj
14
+ MGY5MmM4NGE1YzAzMTcyMzk2MjhmNjUxNjlkNGM5MmE3ZjNhYzkxYjljYWQ4
15
+ MTRiNjAzMjQ4MWY2OTk2NjdlMDVlZDQ4OGRkZmZmOWUwYjZmNWI=
data/.gitignore CHANGED
@@ -1,2 +1,4 @@
1
1
  *.gem
2
2
  Gemfile.lock
3
+ vendor
4
+ .bundle
@@ -7,7 +7,7 @@ request to be merged sooner.
7
7
  ### Create an Issue
8
8
 
9
9
  Each pull request should have a corresponding [Chef-Vault GitHub
10
- issue](https://github.com/moserke/chef-vault/issues?state=open). Search the
10
+ issue](https://github.com/Nordstrom/chef-vault/issues?state=open). Search the
11
11
  issue list to make sure someone hasn't already submitted a pull request to fix
12
12
  your issue. If not, please create a new issue.
13
13
 
@@ -21,7 +21,7 @@ guide](https://help.github.com/articles/fork-a-repo) for more info.
21
21
  ```bash
22
22
  $ git clone https://github.com/<username>/chef-vault.git
23
23
  $ cd chef-vault
24
- $ git remote add upstream https://github.com/moserke/chef-vault.git
24
+ $ git remote add upstream https://github.com/Nordstrom/chef-vault.git
25
25
  ```
26
26
 
27
27
  ### Create a Local Feature Branch
@@ -92,7 +92,7 @@ Bug fixes and features should come with RSpec tests. Add your tests in the
92
92
  `spec` directory. Look at other tests to see how they should be
93
93
  structured (license boilerplate, common includes, etc.).
94
94
 
95
- Run `bundle && rake` to run the test suite.
95
+ Run `bundle install && bundle exec rake` to run the test suite.
96
96
 
97
97
  Make sure all tests pass.
98
98
 
@@ -1,6 +1,16 @@
1
1
  ## Planned (Unreleased)
2
2
 
3
- ## Released
3
+ ## Released
4
+ ## v2.2.0 / 2013-01-21
5
+ * Validate data bag ID before saving
6
+ * Add search_query to vault metadata
7
+ * Refactor knife commands to be knife vault verb
8
+ * Deprecate old knife commands
9
+ * Add knife vault show to deprecate knife decrypt
10
+ * Print admins, clients and search_query in show with -p
11
+ * Add knife vault edit to edit vault items
12
+ * Add mode option for knife.rb
13
+ * Fix more README typos
4
14
 
5
15
  ## v2.1.0 / 2013-12-23
6
16
  * Update README to correct typos
@@ -1,98 +1,146 @@
1
1
  # knife examples
2
2
 
3
- ## encrypt
4
- knife encrypt [create|update|remove|delete] VAULT ITEM VALUES
3
+ ## vault
4
+ knife vault *\<command\>* VAULT ITEM VALUES
5
5
 
6
- These are the commands that are used to take data in json format and encrypt that data into chef-vault style encrypted data bags in chef.
6
+ These are the commands that are used to take data in JSON format and encrypt that data into chef-vault style encrypted data bags in chef.
7
7
 
8
8
  * Vault - This is the name of the vault in which to store the encrypted item. This is analogous to a chef data bag name
9
9
  * Item - The name of the item going in to the vault. This is analogous to a chef data bag item id
10
- * Values - This is the json clear text data to be stored in the vault encrypted. This is analogous to a chef data bag item data
10
+ * Values - This is the JSON clear text data to be stored in the vault encrypted. This is analogous to a chef data bag item data
11
+
12
+ ## vault commands
11
13
 
12
14
  ### create
13
- Creat a vault called passwords and put an item called root in it with the given values for username and password encrypted for clients role:webserver and admins admin1 & admin2
15
+ Create a vault called passwords and put an item called root in it with the given values for username and password encrypted for clients role:webserver and admins admin1 & admin2
16
+
17
+ knife vault create passwords root '{"username": "root", "password": "mypassword"}' -S "role:webserver" -A "admin1,admin2"
18
+
19
+ Create a vault called passwords and put an item called root in it with the given values for username and password encrypted for clients role:webserver
14
20
 
15
- knife encrypt create passwords root "{username: 'root', password: 'mypassword'}" -S "role:webserver" -A "admin1,admin2"
21
+ knife vault create passwords root '{"username": "root", "password": "mypassword"}' -S "role:webserver"
16
22
 
17
- Creat a vault called passwords and put an item called root in it with the given values for username and password encrypted for clients role:webserver
23
+ Create a vault called passwords and put an item called root in it with the given values for username and password encrypted for admins admin1 & admin2
18
24
 
19
- knife encrypt create passwords root "{username: 'root', password: 'mypassword'}" -S "role:webserver"
25
+ knife vault create passwords root '{"username": "root", "password": "mypassword"}' -A "admin1,admin2"
20
26
 
21
- Creat a vault called passwords and put an item called root in it with the given values for username and password encrypted for admins admin1 & admin2
27
+ Create a vault called passwords and put an item called root in it encrypted for admins admin1 & admin2. *Leaving the data off the command-line will pop an editor to fill out the data*
22
28
 
23
- knife encrypt create passwords root "{username: 'root', password: 'mypassword'}" -A "admin1,admin2"
29
+ knife vault create passwords root -A "admin1,admin2"
24
30
 
25
31
  Note: A JSON file can be used in place of specifying the values on the command line, see global options below for details
26
32
 
27
33
  ### update
28
34
  Update the values in username and password in the vault passwords and item root. Will overwrite existing values if values already exist!
29
35
 
30
- knife encrypt update passwords root "{username: 'root', password: 'mypassword'}"
36
+ knife vault update passwords root '{"username": "root", "password": "mypassword"}'
31
37
 
32
38
  Update the values in username and password in the vault passwords and item root and add admin1 & admin2 to the encrypted admins. Will overwrite existing values if values already exist!
33
39
 
34
- knife encrypt update passwords root "{username: 'root', password: 'mypassword'}" -A "admin1,admin2"
40
+ knife vault update passwords root '{"username": "root", "password": "mypassword"}' -A "admin1,admin2"
35
41
 
36
42
  Update the values in username and password in the vault passwords and item root and add role:webserver to the encrypted clients. Will overwrite existing values if values already exist!
37
43
 
38
- knife encrypt update passwords root "{username: 'root', password: 'mypassword'}" -S "role:webserver"
44
+ knife vault update passwords root '{"username": "root", "password": "mypassword"}' -S "role:webserver"
39
45
 
40
46
  Update the values in username and password in the vault passwords and item root and add role:webserver to the encrypted clients and admin1 & admin2 to the encrypted admins. Will overwrite existing values if values already exist!
41
47
 
42
- knife encrypt update passwords root "{username: 'root', password: 'mypassword'}" -S "role:webserver" -A "admin1,admin2"
48
+ knife vault update passwords root '{"username": "root", "password": "mypassword"}' -S "role:webserver" -A "admin1,admin2"
43
49
 
44
50
  Add admin1 & admin2 to encrypted admins for the vault passwords and item root.
45
51
 
46
- knife encrypt update passwords root -A "admin1,admin2"
52
+ knife vault update passwords root -A "admin1,admin2"
47
53
 
48
54
  Add role:webserver to encrypted clients for the vault passwords and item root.
49
55
 
50
- knife encrypt update passwords root -S "role:webserver"
56
+ knife vault update passwords root -S "role:webserver"
51
57
 
52
58
  Add admin1 & admin2 to encrypted admins and role:webserver to encrypted clients for the vault passwords and item root.
53
59
 
54
- knife encrypt update passwords root -S "role:webserver" -A "admin1,admin2"
60
+ knife vault update passwords root -S "role:webserver" -A "admin1,admin2"
55
61
 
56
62
  Note: A JSON file can be used in place of specifying the values on the command line, see global options below for details
57
63
 
58
64
  ### remove
59
65
  Remove the values in username and password from the vault passwords and item root.
60
66
 
61
- knife encrypt remove passwords root "{username: 'root', password: 'mypassword'}"
67
+ knife vault remove passwords root '{"username": "root", "password": "mypassword"}'
62
68
 
63
69
  Remove the values in username and password from the vault passwords and item root and remove admin1 & admin2 from the encrypted admins.
64
70
 
65
- knife encrypt remove passwords root "{username: 'root', password: 'mypassword'}" -A "admin1,admin2"
71
+ knife vault remove passwords root '{"username": "root", "password": "mypassword"}' -A "admin1,admin2"
66
72
 
67
73
  Remove the values in username and password from the vault passwords and item root and remove role:webserver from the encrypted clients.
68
74
 
69
- knife encrypt remove passwords root "{username: 'root', password: 'mypassword'}" -S "role:webserver"
75
+ knife vault remove passwords root '{"username": "root", "password": "mypassword"}' -S "role:webserver"
70
76
 
71
77
  Remove the values in username and password from the vault passwords and item root and remove role:webserver from the encrypted clients and admin1 & admin2 from the encrypted admins.
72
78
 
73
- knife encrypt remove passwords root "{username: 'root', password: 'mypassword'}" -S "role:webserver" -A "admin1,admin2"
79
+ knife vault remove passwords root '{"username": "root", "password": "mypassword"}' -S "role:webserver" -A "admin1,admin2"
74
80
 
75
81
  Remove admin1 & admin2 from encrypted admins for the vault passwords and item root.
76
82
 
77
- knife encrypt remove passwords root -A "admin1,admin2"
83
+ knife vault remove passwords root -A "admin1,admin2"
78
84
 
79
85
  Remove role:webserver from encrypted clients for the vault passwords and item root.
80
86
 
81
- knife encrypt remove passwords root -S "role:webserver"
87
+ knife vault remove passwords root -S "role:webserver"
82
88
 
83
89
  Remove admin1 & admin2 from encrypted admins and role:webserver from encrypted clients for the vault passwords and item root.
84
90
 
85
- knife encrypt remove passwords root -S "role:webserver" -A "admin1,admin2"
91
+ knife vault remove passwords root -S "role:webserver" -A "admin1,admin2"
86
92
 
87
93
  ### delete
88
94
  Delete the item root from the vault passwords
89
95
 
90
- knife encrypt delete passwords root
96
+ knife vault delete passwords root
97
+
98
+ ### show
99
+ knife vault show VAULT ITEM [VALUES]
100
+
101
+ These are the commands that are used to decrypt a chef-vault encrypted item and show the requested values.
102
+
103
+ * Vault - This is the name of the vault in which to store the encrypted item. This is analogous to a chef data bag name
104
+ * Item - The name of the item going in to the vault. This is analogous to a chef data bag item id
105
+ * Values - This is a comma list of values to decrypt from the vault item. This is analogous to a list of hash keys.
106
+
107
+ Show the entire root item in the passwords vault and print in JSON format.
108
+
109
+ knife vault show passwords root -Fjson
110
+
111
+ Show the entire root item in the passwords vault and print in JSON format, including the search query, clients, and admins.
112
+
113
+ knife vault show passwords root -Fjson -p all
114
+
115
+ Show the username and password for the item root in the vault passwords.
116
+
117
+ knife vault show passwords root "username, password"
118
+
119
+ Show the contents for the item user_pem in the vault certs.
120
+
121
+ knife vault show certs user_pem "contents"
122
+
123
+ ### edit
124
+ knife vault edit VAULT ITEM
125
+
126
+ These are the commands that are used to edit a chef-vault encrypted item.
127
+
128
+ * Vault - This is the name of the vault in which to store the encrypted item. This is analogous to a chef data bag name
129
+ * Item - The name of the item going in to the vault. This is analogous to a chef data bag item id
130
+
131
+ Decrypt the entire root item in the passwords vault and open it in json format in your $EDITOR. Writing and exiting out the editor will save and encrypt the vault item.
132
+
133
+ knife vault edit passwords root
91
134
 
92
135
  ### rotate keys
93
- Rotate the shared key for the vault passwords and item root. The shared key is that which is used for the chef encrypted data bag item
136
+ Rotate the shared key for the vault passwords and item root. The shared key is that which is used for the chef encrypted data bag item.
137
+
138
+ knife vault rotate keys passwords root
94
139
 
95
- knife encrypt rotate secret passwords root
140
+ ### rotate all keys
141
+ Rotate the shared key for all vaults and items. The shared key is that which is used for the chef encrypted data bag item.
142
+
143
+ knife vault rotate all keys
96
144
 
97
145
  ### global options
98
146
  <table>
@@ -102,6 +150,15 @@ Rotate the shared key for the vault passwords and item root. The shared key is
102
150
  <th>Description</th>
103
151
  <th>Default</th>
104
152
  <th>Valid Values</th>
153
+ <th>Sub-Commands</th>
154
+ </tr>
155
+ <tr>
156
+ <td>-M MODE</td>
157
+ <td>--mode MODE</td>
158
+ <td>Chef mode to run in</td>
159
+ <td>solo</td>
160
+ <td>"solo", "client"</td>
161
+ <td>all</td>
105
162
  </tr>
106
163
  <tr>
107
164
  <td>-S SEARCH</td>
@@ -109,6 +166,7 @@ Rotate the shared key for the vault passwords and item root. The shared key is
109
166
  <td>Chef Server SOLR Search Of Nodes</td>
110
167
  <td>nil</td>
111
168
  <td></td>
169
+ <td>create, remove, update</td>
112
170
  </tr>
113
171
  <tr>
114
172
  <td>-A ADMINS</td>
@@ -116,66 +174,38 @@ Rotate the shared key for the vault passwords and item root. The shared key is
116
174
  <td>Chef clients or users to be vault admins, can be comma list</td>
117
175
  <td>nil</td>
118
176
  <td></td>
119
- </tr>
120
- <tr>
121
- <td>-M MODE</td>
122
- <td>--mode MODE</td>
123
- <td>Chef mode to run in</td>
124
- <td>solo</td>
125
- <td>"solo", "client"</td>
177
+ <td>create, remove, update</td>
126
178
  </tr>
127
179
  <tr>
128
180
  <td>-J FILE</td>
129
181
  <td>--json FILE</td>
130
- <td>json file to be used for values, will be merged with VALUES if VALUES is passed</td>
182
+ <td>JSON file to be used for values, will be merged with VALUES if VALUES is passed</td>
131
183
  <td>nil</td>
132
184
  <td></td>
185
+ <td>create, update</td>
133
186
  </tr>
134
- </table>
135
-
136
- ## decrypt
137
- knife decrypt VAULT ITEM [VALUES]
138
-
139
- These are the commands that are used to take a chef-vault encrypted item and decrypt the requested values.
140
-
141
- * Vault - This is the name of the vault in which to store the encrypted item. This is analogous to a chef data bag name
142
- * Item - The name of the item going in to the vault. This is analogous to a chef data bag item id
143
- * Values - This is a comma list of values to decrypt from the vault item. This is analogous to a list of hash keys.
144
-
145
- Decrypt the entire root item in the passwords vault and print in json
146
- format.
147
-
148
- knife decrypt passwords root -Fjson
149
-
150
- Decrypt the username and password for the item root in the vault passwords.
151
-
152
- knife decrypt passwords root "username, password"
153
-
154
- Decrypt the contents for the item user_pem in the vault certs.
155
-
156
- knife decrypt certs user_pem "contents"
157
-
158
- ### global options
159
- <table>
160
187
  <tr>
161
- <th>Short</th>
162
- <th>Long</th>
163
- <th>Description</th>
164
- <th>Default</th>
165
- <th>Valid Values</th>
188
+ <td>nil</td>
189
+ <td>--file FILE</td>
190
+ <td>File that chef-vault should encrypt. It adds "file-content" & "file-name" keys to the vault item</td>
191
+ <td>nil</td>
192
+ <td></td>
193
+ <td>create, update</td>
166
194
  </tr>
167
195
  <tr>
168
- <td>-M MODE</td>
169
- <td>--mode MODE</td>
170
- <td>Chef mode to run in</td>
171
- <td>solo</td>
172
- <td>"solo", "client"</td>
196
+ <td>-p DATA</td>
197
+ <td>--print DATA</td>
198
+ <td>Print extra vault data</td>
199
+ <td>nil</td>
200
+ <td>"search", "clients", "admins", "all"</td>
201
+ <td>show</td>
173
202
  </tr>
174
203
  <tr>
175
204
  <td>-F FORMAT</td>
176
205
  <td>--format FORMAT</td>
177
- <td>Format for output</td>
206
+ <td>Format for decrypted output</td>
178
207
  <td>summary</td>
179
208
  <td>"summary", "json", "yaml", "pp"</td>
209
+ <td>show</td>
180
210
  </tr>
181
211
  </table>
data/README.md CHANGED
@@ -22,15 +22,22 @@ Depending on your system's configuration, you may need to run this command with
22
22
  ## KNIFE COMMANDS:
23
23
  See KNIFE_EXAMPLES.md for examples of commands
24
24
 
25
+ ### knife.rb
26
+ To set 'client' as the default mode, add the following line to the knife.rb file.
27
+ knife[:vault_mode] = 'client'
28
+
25
29
  NOTE: chef-vault 1.0 knife commands are not supported! Please use chef-vault 2.0 commands.
26
30
 
27
- ### Encrypt
31
+ ### Vault
28
32
 
29
- knife encrypt create VAULT ITEM VALUES
30
- knife encrypt update VAULT ITEM VALUES
31
- knife encrypt remove VAULT ITEM VALUES
32
- knife encrypt delete VAULT ITEM
33
- knife encrypt rotate keys VAULT ITEM
33
+ knife vault create VAULT ITEM VALUES
34
+ knife vault edit VAULT ITEM
35
+ knife vault update VAULT ITEM VALUES
36
+ knife vault remove VAULT ITEM VALUES
37
+ knife vault delete VAULT ITEM
38
+ knife vault rotate keys VAULT ITEM
39
+ knife vault rotate all keys
40
+ knife vault show VAULT ITEM [VALUES]
34
41
 
35
42
  <i>Global Options:</i>
36
43
  <table>
@@ -40,6 +47,15 @@ NOTE: chef-vault 1.0 knife commands are not supported! Please use chef-vault 2.
40
47
  <th>Description</th>
41
48
  <th>Default</th>
42
49
  <th>Valid Values</th>
50
+ <th>Sub-Commands</th>
51
+ </tr>
52
+ <tr>
53
+ <td>-M MODE</td>
54
+ <td>--mode MODE</td>
55
+ <td>Chef mode to run in. Can be set in knife.rb</td>
56
+ <td>solo</td>
57
+ <td>"solo", "client"</td>
58
+ <td>all</td>
43
59
  </tr>
44
60
  <tr>
45
61
  <td>-S SEARCH</td>
@@ -47,6 +63,7 @@ NOTE: chef-vault 1.0 knife commands are not supported! Please use chef-vault 2.
47
63
  <td>Chef Server SOLR Search Of Nodes</td>
48
64
  <td>nil</td>
49
65
  <td></td>
66
+ <td>create, remove, update</td>
50
67
  </tr>
51
68
  <tr>
52
69
  <td>-A ADMINS</td>
@@ -54,55 +71,39 @@ NOTE: chef-vault 1.0 knife commands are not supported! Please use chef-vault 2.
54
71
  <td>Chef clients or users to be vault admins, can be comma list</td>
55
72
  <td>nil</td>
56
73
  <td></td>
57
- </tr>
58
- <tr>
59
- <td>-M MODE</td>
60
- <td>--mode MODE</td>
61
- <td>Chef mode to run in</td>
62
- <td>solo</td>
63
- <td>"solo", "client"</td>
74
+ <td>create, remove, update</td>
64
75
  </tr>
65
76
  <tr>
66
77
  <td>-J FILE</td>
67
78
  <td>--json FILE</td>
68
- <td>json file to be used for values, will be merged with VALUES if VALUES is passed</td>
79
+ <td>JSON file to be used for values, will be merged with VALUES if VALUES is passed</td>
69
80
  <td>nil</td>
70
81
  <td></td>
82
+ <td>create, update</td>
71
83
  </tr>
72
84
  <tr>
73
85
  <td>nil</td>
74
86
  <td>--file FILE</td>
75
- <td>File that chef-vault should encrypt. It adds "file-content" & "file-name" keys to the vault item. This is only valid in create & update</td>
87
+ <td>File that chef-vault should encrypt. It adds "file-content" & "file-name" keys to the vault item</td>
76
88
  <td>nil</td>
77
89
  <td></td>
78
- </table>
79
-
80
- ### Decrypt
81
-
82
- knife decrypt VAULT ITEM [VALUES]
83
-
84
- <i>Global Options:</i>
85
- <table>
86
- <tr>
87
- <th>Short</th>
88
- <th>Long</th>
89
- <th>Description</th>
90
- <th>Default</th>
91
- <th>Valid Values</th>
90
+ <td>create, update</td>
92
91
  </tr>
93
92
  <tr>
94
- <td>-M MODE</td>
95
- <td>--mode MODE</td>
96
- <td>Chef mode to run in</td>
97
- <td>solo</td>
98
- <td>"solo", "client"</td>
93
+ <td>-p DATA</td>
94
+ <td>--print DATA</td>
95
+ <td>Print extra vault data</td>
96
+ <td>nil</td>
97
+ <td>"search", "clients", "admins", "all"</td>
98
+ <td>show</td>
99
99
  </tr>
100
100
  <tr>
101
101
  <td>-F FORMAT</td>
102
102
  <td>--format FORMAT</td>
103
- <td>Format for output</td>
103
+ <td>Format for decrypted output</td>
104
104
  <td>summary</td>
105
105
  <td>"summary", "json", "yaml", "pp"</td>
106
+ <td>show</td>
106
107
  </tr>
107
108
  </table>
108
109
 
@@ -139,6 +140,7 @@ Do `chef-vault --help` for all available options
139
140
 
140
141
  Author:: Kevin Moser - @moserke<br>
141
142
  Author:: Eli Klein - @eliklein<br>
143
+ Author:: Joey Geiger - @jgeiger<br>
142
144
  Author:: Joshua Timberman - @jtimberman<br>
143
145
  Copyright:: Copyright (c) 2013 Nordstrom, Inc.<br>
144
146
  License:: Apache License, Version 2.0