@@ -18,7 +18,7 @@ cargo install streambed-confidant-cli
18
18
...or build it from this repo:
19
19
20
20
```
21
- cargo build --bin loggconfidanted --release
21
+ cargo build --bin confidant --release
22
22
```
23
23
24
24
...and make a build available on the PATH (only for ` cargo build ` and just once per shell session):
@@ -27,4 +27,49 @@ cargo build --bin loggconfidanted --release
27
27
export PATH="$PWD/target/release":$PATH
28
28
```
29
29
30
+ Before you can use ` confidant ` , you must provide it with a root secret and a "secret id" (password)
31
+ to authenticate the session. Here's an example with some dummy data:
32
+
33
+ ```
34
+ echo "1800af9b273e4b9ea71ec723426933a4" > /tmp/root-secret
35
+ echo "unused-id" > /tmp/ss-secret-id
36
+ ```
37
+
38
+ We also need to create a directory for ` confidant ` to read and write its secrets. A security feature
39
+ of the ` confidant ` library is that the directory must have a permission of ` 600 ` for the owner user.
40
+ ACLs should then be used to control access for individual processes. Here's how the directory can be
41
+ created:
42
+
43
+ ```
44
+ mkdir /tmp/confidant
45
+ chmod 700 /tmp/confidant
46
+ ```
47
+
48
+ You would normally source the above secrets from your production system, preferably without
49
+ them leaving your production system.
50
+
51
+ Given the root secret, encrypt some data :
52
+
53
+ ```
54
+ echo '{"value":"SGkgdGhlcmU="}' | \
55
+ confidant --root-path=/tmp/confidant encrypt --file - --path="default/my-secret-path"
56
+ ```
57
+
58
+ ...which would output:
59
+
60
+ ```
61
+ {"value":"EZy4HLnFC4c/W63Qtp288WWFj8U="}
62
+ ```
63
+
64
+ That value is now encrypted with a salt.
65
+
66
+ We can also decrypt in a similar fashion:
67
+
68
+ ```
69
+ echo '{"value":"EZy4HLnFC4c/W63Qtp288WWFj8U="}' | \
70
+ confidant --root-path=/tmp/confidant decrypt --file - --path="default/my-secret-path"
71
+ ```
72
+
73
+ ...which will yield the original BASE64 value that we encrypted.
74
+
30
75
Use ` --help ` to discover all of the options.
0 commit comments