opensecret 0.0.988 → 0.0.9925

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +56 -159
  3. data/bin/opensecret +2 -2
  4. data/bin/ops +17 -2
  5. data/lib/extension/string.rb +14 -16
  6. data/lib/{interpreter.rb → interprete.rb} +53 -29
  7. data/lib/keytools/binary.map.rb +49 -0
  8. data/lib/keytools/kdf.api.rb +249 -0
  9. data/lib/keytools/kdf.bcrypt.rb +64 -29
  10. data/lib/keytools/kdf.pbkdf2.rb +92 -83
  11. data/lib/keytools/kdf.scrypt.rb +190 -0
  12. data/lib/keytools/key.64.rb +326 -0
  13. data/lib/keytools/key.algo.rb +109 -0
  14. data/lib/keytools/key.api.rb +1281 -0
  15. data/lib/keytools/key.db.rb +265 -0
  16. data/lib/keytools/{key.module.rb → key.docs.rb} +55 -0
  17. data/lib/keytools/key.error.rb +110 -0
  18. data/lib/keytools/key.id.rb +271 -0
  19. data/lib/keytools/key.iv.rb +107 -0
  20. data/lib/keytools/key.local.rb +265 -0
  21. data/lib/keytools/key.mach.rb +248 -0
  22. data/lib/keytools/key.now.rb +402 -0
  23. data/lib/keytools/key.pair.rb +259 -0
  24. data/lib/keytools/key.pass.rb +120 -0
  25. data/lib/keytools/key.rb +428 -298
  26. data/lib/keytools/keydebug.txt +295 -0
  27. data/lib/logging/gem.logging.rb +3 -3
  28. data/lib/modules/cryptology/collect.rb +20 -0
  29. data/lib/session/require.gem.rb +1 -1
  30. data/lib/usecase/cmd.rb +417 -0
  31. data/lib/usecase/id.rb +36 -0
  32. data/lib/usecase/import.rb +174 -0
  33. data/lib/usecase/init.rb +78 -0
  34. data/lib/usecase/login.rb +70 -0
  35. data/lib/usecase/logout.rb +30 -0
  36. data/lib/usecase/open.rb +126 -0
  37. data/lib/{interprete → usecase}/put.rb +100 -47
  38. data/lib/usecase/read.rb +89 -0
  39. data/lib/{interprete → usecase}/safe.rb +0 -0
  40. data/lib/{interprete → usecase}/set.rb +0 -0
  41. data/lib/usecase/token.rb +111 -0
  42. data/lib/{interprete → usecase}/use.rb +0 -0
  43. data/lib/version.rb +1 -1
  44. data/opensecret.gemspec +4 -3
  45. metadata +39 -33
  46. data/lib/exception/cli.error.rb +0 -53
  47. data/lib/exception/errors/cli.errors.rb +0 -31
  48. data/lib/interprete/begin.rb +0 -232
  49. data/lib/interprete/cmd.rb +0 -621
  50. data/lib/interprete/export.rb +0 -163
  51. data/lib/interprete/init.rb +0 -205
  52. data/lib/interprete/key.rb +0 -119
  53. data/lib/interprete/open.rb +0 -148
  54. data/lib/interprete/seal.rb +0 -129
  55. data/lib/keytools/digester.rb +0 -245
  56. data/lib/keytools/key.data.rb +0 -227
  57. data/lib/keytools/key.derivation.rb +0 -341
  58. data/lib/modules/mappers/collateral.rb +0 -282
  59. data/lib/modules/mappers/envelope.rb +0 -127
  60. data/lib/modules/mappers/settings.rb +0 -170
  61. data/lib/notepad/scratch.pad.rb +0 -224
  62. data/lib/store-commands.txt +0 -180
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 66c7d8d35a57f8a3cdb9b474e91449ec0e99860a
4
- data.tar.gz: 613a5d83b7106f5ba575375a19d2afd2a800349a
2
+ SHA256:
3
+ metadata.gz: 8f4b662ec6f5f735a69275b840d1e1e86e7aee004c98251891ad0cd376d5a6e2
4
+ data.tar.gz: fd3e9024651b0ae1a113e7a1231ea8385bc55b1e51c5789acca1408134a15246
5
5
  SHA512:
6
- metadata.gz: b7f868866c2aeaefdf7175bc3908c6fd099c9b012459cabb95ce896bb3cbf97c07669e37fd821463d604e1a8b24096e7ba7522d2976a997e0e868402bae223d2
7
- data.tar.gz: e4c370058f6531ba3195d2555b8f1e53e3fbd61d27d8ebbbd5acce7dd71aa243c57e7c2558254aa8ba78a94b434e321494cc196fbcd035aaeef833c88d0faf17
6
+ metadata.gz: ef7586640543b9bdd9845e3c33217a4a02e1546d96f433884ab9a4db18ea09b051157fda0b3eed42e5e9961a72afe42298b21cbc217ae1220e9e55bcf4171ee8
7
+ data.tar.gz: 6dd7f152e8b66f7657a29327cd4a37b7addde818270a51396594c365808b20fd7b3e13b13c6eec32eacc6e4b1e05e367241fbb47f8d54bdc4407a34c96ddb1d0
data/README.md CHANGED
@@ -4,170 +4,79 @@ opensecret [![Build Status](https://secure.travis-ci.org/TwP/inifile.png)](http:
4
4
  opensecret | Install and Configure
5
5
  -----------
6
6
 
7
- opensecret locks secrets and sensitive data in a simple and highly secure manner. <b><em>It never accesses the cloud</em></b>. It produces files that are precious to you but <b><em>worthless</em></b> to everyone else. As well as the filesystem, you can choose Git, Amazon S3 or a remote drive as your backend store.
7
+ opensecret locks secrets and sensitive data in a simple and highly secure manner. <b><em>It never accesses the cloud</em></b>. It produces files that are precious to you but <b><em>worthless</em></b> to everyone else.
8
8
 
9
9
  opensecret takes a fresh approach in its quest to be both simple and highly secure.
10
10
 
11
-
12
- ### Install
11
+ ## install opensecret
13
12
 
14
13
  $ gem install opensecret
14
+ $ export OPEN_SESSION_TOKEN=`ops token` # setup a shell session variable
15
+ $ ops init joe@abc /home/joe/credentials # initialize a secrets domain
16
+ $ ops login joe@abc # login to the new domain
15
17
 
16
- ### Initialize
17
-
18
- $ opensecret init joe@example.com
19
-
20
- It doesn't have to be an email address. <tt>smith.family.info</tt> will do just fine. Choose a memorable (but not easily guessable) password.
21
-
22
- ### Open envelope | Put secrets | Seal envelope
23
-
18
+ You initialize then login to a **domain** like **joe@abc**. In the init command we specify where the encrypted material will be stored. Best use a USB key or phone to use your secrets on any drive or computer.
24
19
 
20
+ You only need to run init once on a computer for each domain - after that you simply login.
25
21
 
26
- - <tt>**keydir**</tt> &raquo; best practise is a usb key drive with your **actual keys**
27
- - <tt>**name**</tt> &raquo; single word lowercase and short - how your peers call you
28
- - <tt>**email**</tt> &raquo; email address (validation scheduled for end of March 2018)
29
- - <tt>**domain**</tt> &raquo; **joe@home** if single or a team like it-dept@ibm.com
30
- - <tt>**store**</tt> &raquo; a Git project URL to hold your encrypted secret material
22
+ ## open an envelope | put secrets | read
31
23
 
32
- ### opensecret | Create Keys
24
+ - <tt>**ops open email.accounts joe@gmail.com**</tt>
25
+ - <tt>**ops put username joebloggs**</tt>
26
+ - <tt>**ops put question "Mothers Maiden Name"**</tt>
27
+ - <tt>**ops put answer "Rumpelstiltskin"**</tt>
28
+ - <tt>**ops input password**</tt>
29
+ - <tt>**ops tell**</tt>
33
30
 
34
- Init(ialize) creates an uncrackable **8192 bit private/public key pair**, locked down with an amalgamated (human and machine generated) password.
31
+ **What happened?** Look in the configured folder and you'll see some breadcrumbs and your first envelope. What happened was
35
32
 
36
- $ opensecret init
33
+ - the "emal.accounts" envelope is created for joe@gmail.com
34
+ - the username and a memorable question are put in
35
+ - **ops input password** securely collects the password
36
+ - **ops tell** outputs all the data at the opened path
37
37
 
38
- Or you can enter the password on the command line.
39
-
40
- $ opensecret init --password="sEeKr33tp4$$w@RD"
38
+ Let's put data for the next email account into the same "email.acocunts" envelope.
41
39
 
40
+ - <tt>**ops open email.accounts joe@yahoo.com**</tt>
41
+ - <tt>**ops put username joey**</tt>
42
+ - <tt>**ops input secret**</tt>
43
+ - <tt>**ops tell**</tt>
42
44
 
43
45
  ### opensecret | All Done!
44
46
 
45
- **opensecret is configured!** Before locking and unlocking sensitive data let's ask ***"How can Susan <tt>steal</tt> Joe's secrets?*** Well, she would need to
46
-
47
- - **acquire** his USB drive key
48
- - *requisition* his laptop, crack the disk encryption and assail the login password
49
- - convince Joe that **revealing his password is the painless route, then
50
- - break into the backend store (AWS S3, GitHub, Google Drive, SSH)
51
-
52
- It's simple for Joe but nigh impossible for Susan. That's why you need a USB key drive, an offsite storage solution and an encrypted drive.
53
-
54
- Your ability to access your own secrets (even after disaster scenarios) is as important as preventing the secrets being accessed. This is why opensecret piggy backs off your (already configured) redundancy and backup solutions.
47
+ Cracking opensecret is infeasible for anyone other than the rightful owner. Only OpenSSL implemented tried and tested cryptographic algorithms are used. Both PBKDF2 and BCrypt are used for expensive key derivation. The content is encrypted with AES (Advanced Encryption Standard) and 48 byte random keys are employed along with initialization vectors.
55
48
 
49
+ Even with all this crypt technology it is **important** that you
56
50
 
57
- == Export the Session Key
51
+ - choose a robust password of between 10 and 32 characters
52
+ - align the number of salt derivation iteratios to your machine's resources
53
+ - backup the domain folders in case you lose your USB drive or phone
58
54
 
59
- export OPS_KEY=`ops key`
55
+ Your ability to access your own secrets (even after disaster scenarios) is as important as preventing the secrets being accessed.
60
56
 
61
-
62
- opensecret | Lock and Unlock
57
+ opensecret | moving computer
63
58
  -----------
64
59
 
65
- Joe wants to lock away his wifi password.
66
-
67
- $ opensecret init
68
-
69
-
70
-
71
- opensecret | moving to anoter computer
72
- -----------
73
-
74
- On computer where it is all working you do
75
-
76
- $ opensecret copy config
77
-
78
- Then you take out the USB key and (many hours or even days later)
79
- you put it back into another computer you do
80
-
81
- $ opensecret paste config
82
-
83
-
84
-
85
- One Lock | Two Keys
86
- -------------------
87
-
88
- With suitcases, the key that locks the suitcase also opens it.
89
-
90
- In cryptography - you have two keys. You give out your public key and anyone can lock any suitcase (of goodies) with your public key. Once done, that suitcase can only be opened with the other key, your private key. opensecret creates an 8192 bit private key which is simply uncrackable.
91
-
92
- The safest place to put your private key is on a USB key drive which you carry around with your real keys. And to top it all - a password that only you know is used to lock your private key.
93
-
94
- For scripts that cannot stop and wait for user input - keys can optionally be created with a password given at the command line.
95
-
96
- $ opensecret init --password="p455w0rd.!0NDUN"
97
-
98
- The Encryption Strategy
99
- -----------------------
100
-
101
- opensecret uses a symmetric key to perform the initial encryption of the data, followed by an asymmetric public key that encrypts the result.
102
-
103
- The encryption key itself is then locked down by the public key which is then thrown away. The file on the backend store is the doubly encrypted secret.
104
-
105
- A corresponding file appears on the front end (usb drive) store afer encryption by the master public key. This bundle (decryptable by the master private key) is an amalgamation of the
106
-
107
- - private key (to unlock the first layer of 1 secret and its encryption key)
108
- - the encrypted encryption key (unlockable by the aforementioned private key)
109
- - technical specification of the encryption algorithm plus settings
110
-
111
- The benefits of this strategy can now be assessed. First off, is the 3 isolated stores that are created.
112
-
60
+ We travel between laptops, desktops, virtual machines and even docker containers. Always run init the first time you use a domain on a different computer.
113
61
 
114
- ### The 3 Isolated (Worthless) Stores
115
-
116
- There is a grand design behind this mesh of keys, cipher text and symmetricity. The theoretical underpinning
117
- of opensecret is predicated on a tri-store security solution.
118
-
119
- **What is tri-store?** Use opensecret and you get 3 isolated (and individually worthless) information stores.
120
-
121
- - a backend store of doubly encrypted secrets
122
- - a middle store of doubly encrypted keys
123
- - a front end of encrypted master key (on USB), human password (in brain) and encrypted machine password (in machine)
124
-
125
- You can think of opensecret as a reference open source implementation of the tri-store concept.
126
-
127
- #### Sending a Wifi Password
128
-
129
- With the **one password culture**, just one password gives you access to everything. I can't send a Wifi password (which is gold dust to hackers) securely. I have to login (potentially exposing every secret) - copy and paste the Wifi password and then email it - even if I encrypt it I am still sending the ciphertext and then they key.
130
-
131
-
132
- #### benefits of a tri-store solution
133
-
134
- Think of your doubly encrypted ciphertext as the backend, the doubly encrypted keys as the middle and then the logical group of the master key (on USB), human password (in brain) and encrypted machine password (on machine).
62
+ $ gem install opensecret
63
+ $ export OPEN_SESSION_TOKEN=`ops token` # setup a shell session variable
64
+ $ ops init joe@abc /home/joe/credentials # initialize a secrets domain
65
+ $ ops login joe@abc # login to the new domain
135
66
 
136
- - you can transport and/or share secrets by sending the keys (not the backend material)
137
- - you can rotate your master key and passwords (again - no touching or accessing the backend)
138
- - you can (and should) assign separate (off-machine) stores for the middle and backend
139
- - you can select different local or cloud based storage locations for middle and backend stores
140
- - you can safely backup stores - and with Git you get this (and rollbacks) for no extra effort
141
- - you can invalidate, expire and revoke secrets by interacting with just the middle tier
142
- - when a secret is read - it is locked up again with new keys giving you a read audit trail
67
+ Run all four commands the first time. Then simply run the second and fourth commands whenever you open a new shell to interact with opensecret.
143
68
 
144
- #### the no-go no-clouds mantra
69
+ ## the no-go no-clouds mantra
145
70
 
146
- opensecret is designed to operate in highly secure locked down environments in which external access is not just constrained - it is non-existent.
71
+ opensecret is designed to operate in highly secure locked down environments in which external access is not just constrained - **it is non-existent**.
147
72
 
148
- opensecret does not contact nor talk to anything external. It never asks (nor needs to know) the credentials for accessing your stores - this means it compliments your storage security be it S3, Google Drive, databases, VPN, Git and even email/pop3 solutions.
73
+ opensecret does not contact nor talk to anything external. It never asks (nor needs to know) the credentials for accessing your stores - this means it compliments your storage security be it S3, Google Drive, Redis, Git and even email/pop3 solutions.
149
74
 
150
- #### the encrypted at rest mantra
75
+ ## the encrypted at rest mantra
151
76
 
152
77
  The ability to read data from drives (after the fact and) after deletion means **nothing unencrypted** should be put on any drive (including usb keys).
153
78
 
154
79
 
155
- #### easy adoption of new algorithms
156
-
157
- You can configure the algorithm (or algorithms) and implementation used and this information is encrypted within the middle tier store.
158
-
159
- Attacks usually target particular algorithms so putting this information away (or even randomly selecting from a pool of algorithms) - all adds to the worthlessness of the backend cipher text store.
160
-
161
- Algorithms can also be selected based on encryption targets like
162
-
163
- - binary files
164
- - large text files or
165
- - small 4 digit keys (like pin numbers)
166
-
167
- Not only do no two pieces of encrypted material share encryption keys, they also need not share encryption algorithms (and remember - they are doubly encrypted).
168
-
169
-
170
-
171
80
  opensecret configuration
172
81
  ------------------------
173
82
 
@@ -203,33 +112,8 @@ The planned list of backend storage systems (each onlined with a plugin), is
203
112
 
204
113
  Access management is configured EXTERNAL to opensecret. Opensecret simply piggybacks the network transport if authorization is granted.
205
114
 
206
- How to Join a Domain
207
- --------------------
208
115
 
209
- - opensecret will loop encrypting your public key's fingerprint with the public keys of present members
210
- - when they interact opensecret will ask if they trust the new id/email and key
211
- - if they say yes the fingerprint is imported and held with id/name
212
- - ongoing domainwide checks flag up public key / fingerprint mismatches
213
- - if keys are removed or updated similar questions are asked.
214
-
215
- Why Beg for Secrets?
216
- --------------------
217
-
218
- Why beg for a secret - why not just tell someone it?
219
-
220
- It is much more secure to beg for a secret than just have someone reveal it. When you beg for a secret - you are sending an encryption key to a single person who must possess the private key and they send back the secret encrypted with both your specific public key and the encryption key that originated from you.
221
-
222
- Any hijacker will need access to a great many things and be very precise with their timing in order to serrupticiously subvert the system.
223
-
224
-
225
- Git | S3 or ... | Which Backend Storage?
226
- ----------------------------------------
227
-
228
- If you have a choice and would like to know the pros and cons of one of the many backend storage options then visit the opensecret.io website.
229
-
230
-
231
-
232
- ### opensecret | Summary
116
+ ## opensecret | Summary
233
117
 
234
118
  You can use opensecret alone or you can use it to share secrets with colleagues, friends and family, even machines.
235
119
 
@@ -238,7 +122,6 @@ opensecret is simple and holistically secure. *Simple* means less mistakes, less
238
122
  Every domain is tied to backend storage which is accessible by you and others in your domain. You can use Git, S3, a networked filesystem or shared drive, a SSH accessible filesystem and soon, free storage from <tt>opensecret.io</tt>
239
123
 
240
124
 
241
-
242
125
  ### Development
243
126
 
244
127
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -249,6 +132,20 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
249
132
 
250
133
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/opensecret. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
251
134
 
135
+ ## How to Uninstall OpenSecret
136
+
137
+ Look to see where it is installed.
138
+
139
+ ``` bash
140
+ ls -lah /var/lib/gems/2.5.0/gems/
141
+ gem uninstall opensecret
142
+ ```
143
+
144
+ If more than one version is installed you will be prompted to select the ones to delete.
145
+
146
+ You will also be asked whether the **opensecret executables** (which are **ops** and **opensecret**) should be removed. If you say yes they are removed from **/usr/local/bin**
147
+
148
+
252
149
  License
253
150
  -------
254
151
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'interpreter'
3
+ require 'interprete'
4
4
 
5
- Interpreter.start(ARGV)
5
+ Interprete.start(ARGV)
data/bin/ops CHANGED
@@ -1,5 +1,20 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'interpreter'
3
+ require 'interprete'
4
4
 
5
- Interpreter.start(ARGV)
5
+ Interprete.start(ARGV)
6
+
7
+
8
+ # -- -------------------------- -- #
9
+ # -- Other names aside from ops -- #
10
+ # -- -------------------------- -- #
11
+ # stash
12
+ # keep
13
+ # safe
14
+ # box
15
+ # drop
16
+ # bag
17
+ # db
18
+ # devops
19
+ # hold (of a ship)
20
+ # -- -------------------------- -- #
@@ -187,46 +187,44 @@ class String
187
187
  end
188
188
 
189
189
 
190
- # Get the text [in between] this and that delimeter [exclusively].
190
+ # Get the text [in between] this and that delimiter [exclusively].
191
191
  # Exclusively means the returned text [does not] include either of
192
- # the matched delimeters (although an unmatched instance of [this]
193
- # delimeter may appear in the in-between text).
192
+ # the matched delimiters (although an unmatched instance of [this]
193
+ # delimiter may appear in the in-between text).
194
194
  #
195
195
  # ### Multiple Delimiters
196
196
  #
197
197
  # When multiple delimiters exist, the text returned is in between the
198
198
  #
199
- # - first occurrence of [this] delimeter AND the
200
- # - 1st occurrence of [that] delimeter [AFTER] the 1st delimiter
199
+ # - first occurrence of [this] delimiter AND the
200
+ # - 1st occurrence of [that] delimiter [AFTER] the 1st delimiter
201
201
  #
202
202
  # Instances of [that] delimiter occurring before [this] are ignored.
203
- # The text could contain [this] delimeter instances but is guaranteed
204
- # not to contain a [that] delimeter.
203
+ # The text could contain [this] delimiter instances but is guaranteed
204
+ # not to contain a [that] delimiter.
205
205
  #
206
206
  # @throw an exception (error) will be thrown if
207
207
  #
208
208
  # - any nil (or empties) exist in the input parameters
209
- # - **this** delimeter does not appear in the in_string
210
- # - **that** delimeter does not appear after [this] one
209
+ # - **this** delimiter does not appear in the in_string
210
+ # - **that** delimiter does not appear after [this] one
211
211
  #
212
- # @param this_delimeter [String] begin delimeter (not included in returned string)
213
- # @param that_delimeter [String] end delimeter (not included in returned string)
212
+ # @param this_delimiter [String] begin delimiter (not included in returned string)
213
+ # @param that_delimiter [String] end delimiter (not included in returned string)
214
214
  #
215
215
  # @return [String] the text in between (excluding) the two parameter delimiters
216
- def in_between this_delimeter, that_delimeter
216
+ def in_between this_delimiter, that_delimiter
217
217
 
218
218
  raise ArgumentError, "This string is NIL or empty." if self.nil? || self.empty?
219
219
  raise ArgumentError, "Begin delimiter is NIL or empty." if this_delimiter.nil? || this_delimiter.empty?
220
220
  raise ArgumentError, "End delimiter is NIL or empty." if that_delimiter.nil? || that_delimiter.empty?
221
221
 
222
222
  scanner_1 = StringScanner.new self
223
- scanner_1.scan_until /#{this_delimeter}/
223
+ scanner_1.scan_until /#{this_delimiter}/
224
224
  scanner_2 = StringScanner.new scanner_1.post_match
225
- scanner_2.scan_until /#{that_delimeter}/
225
+ scanner_2.scan_until /#{that_delimiter}/
226
226
 
227
227
  in_between_text = scanner_2.pre_match.strip
228
- log.info(ere){ in_between_text }
229
-
230
228
  return in_between_text
231
229
 
232
230
  end
@@ -29,7 +29,7 @@ OpenSession::RecursivelyRequire.now( __FILE__ )
29
29
  # - ensure that the parameter values are in range
30
30
  # - delegate processing to the registered handlers
31
31
  #
32
- class Interpreter < Thor
32
+ class Interprete < Thor
33
33
 
34
34
  log.info(x) {"opensecret session initiated at [#{OpenSession::Stamp.yyjjj_hhmm_sst}]." }
35
35
 
@@ -39,7 +39,7 @@ class Interpreter < Thor
39
39
  class_option :debug, :type => :boolean
40
40
 
41
41
  # Description of the init configuration call.
42
- desc "init <domain_name>, <base_path>", "initialize domain with (optional) frontend path"
42
+ desc "init <domain_name>, <base_path>", "initialize domain with keystore directory"
43
43
 
44
44
  # If confident that command history cannot be exploited to gain the
45
45
  # human password or if the agent running opensecret is itself a script,
@@ -60,52 +60,51 @@ class Interpreter < Thor
60
60
  end
61
61
 
62
62
 
63
- # Description of the seal use case command line call.
64
- desc "seal", "Seal away the (secret stuffed) envelope into key and crypt stores."
65
-
66
- # Seal away the (secret stuffed) envelope into key and crypt stores.
67
- def seal
68
- OpenSecret::Seal.new.flow_of_events
69
- end
70
-
71
-
72
- # Description of the begin use case command line call.
73
- desc "begin", "Begin interacting with your opensecret database."
63
+ # Description of the login use case command line call.
64
+ desc "login <domain_name>", "Login to an application domain."
74
65
 
75
66
  # If confident that command history cannot be exploited to gain the
76
67
  # human password or if the agent running opensecret is itself a script,
77
68
  # the <tt>with</tt> option can be used to convey the password.
78
69
  option :with
79
70
 
80
- # Begin interacting with your opensecret database.
81
- def begin
82
- begin_uc = OpenSecret::Begin.new
83
- begin_uc.master_p4ss = options[:with] if options[:with]
84
- begin_uc.flow_of_events
71
+ # Login in order to securely interact with your data.
72
+ # @param domain_name [String] the domain the software operates under
73
+ def login( domain_name = nil )
74
+ login_uc = OpenSecret::Login.new
75
+ login_uc.domain_name = domain_name unless domain_name.nil?
76
+ login_uc.master_p4ss = options[:with] if options[:with]
77
+ login_uc.flow_of_events
85
78
  end
86
79
 
87
80
 
88
- # Description of the opensecret key use case.
89
- desc "key", "Produce an encrypted session key tied to the workstation and shell environment."
90
81
 
91
- # The<b>key</b> use cases prints out an encrypted session key tied
82
+ # Description of the opensecret token use case.
83
+ desc "token", "Produce an encrypted session token tied to the workstation and shell environment."
84
+
85
+ # The<b>token</b> use cases prints out an encrypted session token tied
92
86
  # to the workstation and shell environment.
93
- def key
94
- OpenSecret::Key.new.flow_of_events
87
+ def token
88
+ OpenSecret::Token.new.flow_of_events
95
89
  end
96
90
 
97
91
 
92
+
98
93
  # Description of the open use case command.
99
- desc "open OPEN_PATH", "OPEN_PATH to envelope of secrets to stuff and then lock."
94
+ desc "open ENVELOPE_PATH", "KEY_PATH open a key path within the specified envelope."
100
95
 
101
- # Open up a conduit from which we can add, subtract, update and list secrets
102
- # before they are committed (and pushed) into permanent locked storage.
96
+ # Open up a conduit (path) to the place where we can issue read, create, update,
97
+ # and destroy commands.
103
98
  #
104
- # @param open_path [String] the path to USB key for storing encrypted keys
105
- def open open_path
99
+ # @param env_path [String]
100
+ # relative path to the obfuscated envelope
101
+ # @param key_path [String]
102
+ # path in envelope to the point of interest
103
+ def open env_path, key_path
106
104
 
107
105
  open_uc = OpenSecret::Open.new
108
- open_uc.open_path = open_path
106
+ open_uc.env_path = env_path
107
+ open_uc.key_path = key_path
109
108
  open_uc.flow_of_events
110
109
 
111
110
  end
@@ -162,4 +161,29 @@ class Interpreter < Thor
162
161
  end
163
162
 
164
163
 
164
+ # Description of the read secret command.
165
+ desc "read", "read and show secrets at the opened path."
166
+
167
+ # Read the secrets at the opened path. These secrets
168
+ # are simply written out to the shell console.
169
+ def read
170
+
171
+ read_uc = OpenSecret::Read.new
172
+ read_uc.flow_of_events
173
+
174
+ end
175
+
176
+
177
+ # Description of the print identifier command.
178
+ desc "id", "print multiple formats of the current timestamp."
179
+
180
+ # Print the multiple formats of the current timestamp.
181
+ def id
182
+
183
+ id_uc = OpenSecret::Id.new
184
+ id_uc.flow_of_events
185
+
186
+ end
187
+
188
+
165
189
  end