Skip to content

Commit 62976ac

Browse files
authored
Merge pull request #11 from cipherstash/doc/prerequisites
Add prerequisites section to the README
2 parents bcb3f22 + 2fafe53 commit 62976ac

File tree

2 files changed

+48
-40
lines changed

2 files changed

+48
-40
lines changed

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,53 @@
55
Based on the CipherStash SDK and ZeroKMS key service, Cryptonamo provides a simple interface for
66
storing and retrieving encrypted data in DynamoDB.
77

8-
### Usage
8+
---
9+
10+
### Prerequisites
11+
12+
#### Install Stash CLI
13+
14+
The `stash` CLI tool is required for creating an account and security credentials so that Cryptonamo can interact with the ZeroKMS key server.
15+
16+
See [here](https://docs.cipherstash.com/reference/cli.html#install-the-cipherstash-cli) for instructions on how to download and install the `stash` CLI tool.
17+
18+
#### Sign up to create an account
19+
20+
Run `stash signup` and follow the on screen instructions.
21+
22+
#### Login and create a Dataset
23+
24+
*The pages linked to below contain information that is generally applicable even though it is framed within the context of a Rails application*
25+
26+
1. [Ensure `stash` is logged in](https://docs.cipherstash.com/tutorials/rails-getting-started/define.html#1-log-in)
27+
28+
2. [Create a Dataset](https://docs.cipherstash.com/tutorials/rails-getting-started/define.html#2-create-a-dataset)
29+
30+
In ZeroKMS, a Dataset contains a root key from which the cryptographic keys used to encrypt data and indexes are derived. Additionally, a Dataset describes the encryption settings for your data.
31+
32+
Since Cryptanamo manages the encryption & search settings itself using Rust traits and derive macros the ability to store encryption settings in a Dataset is not applicable.
33+
34+
**IMPORTANT** : the following step will generate a secret that must be retained and will not be displayed again. Please ensure that the instructions are followed.
35+
36+
3. [Create a Client](https://docs.cipherstash.com/tutorials/rails-getting-started/define.html#3-create-a-client)
37+
38+
#### Upload a dataset config
39+
40+
Cryptonamo fully manages the encrypted record and index settings.
41+
42+
However, ZeroKMS currently only initializes the the root key material on upload of a Dataset configuration. This step should not be necessary and we are planning on changing ZeroKMS to initialize the key material on creation of a Dataset.
43+
44+
For now, it is sufficient to upload an empty configuration.
45+
46+
There is an empty `dataset.yml` in the root of the repository, ready to be uploaded.
47+
48+
Upload it to ZeroKMS using the following command:
49+
50+
`stash datasets config upload --file dataset.yml --client-id $CS_CLIENT_ID --client-key $CS_CLIENT_KEY`
51+
52+
---
53+
54+
### Setup DynamoDB
955

1056
To use Cryptonamo, you must first create a table in DynamoDB.
1157
The table must have a primary key and sort key, both of type String.

dataset.yml

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1 @@
1-
tables:
2-
- path: user
3-
fields:
4-
- name: name
5-
in_place: false
6-
cast_type: utf8-str
7-
mode: encrypted
8-
indexes:
9-
- version: 1
10-
kind: match
11-
tokenizer:
12-
kind: edge-ngram
13-
max_gram: 10
14-
min_gram: 3
15-
token_filters:
16-
- kind: downcase
17-
k: 6
18-
m: 2048
19-
include_original: true
20-
- name: email
21-
in_place: false
22-
cast_type: utf8-str
23-
mode: encrypted
24-
indexes:
25-
- version: 1
26-
kind: unique
27-
- path: license
28-
fields:
29-
- name: number
30-
in_place: false
31-
cast_type: utf8-str
32-
mode: encrypted
33-
indexes: []
34-
- name: expires
35-
in_place: false
36-
cast_type: utf8-str
37-
mode: encrypted
38-
indexes: []
39-
1+
tables: []

0 commit comments

Comments
 (0)