You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+82-66Lines changed: 82 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,14 +40,14 @@ Once the custom types and functions are installed, you can start using EQL in yo
40
40
41
41
1. Create a table with a column of type `cs_encrypted_v1` which will store your encrypted data.
42
42
1. Use EQL functions to add indexes for the columns you want to encrypt.
43
-
- Indexes are used by Cipherstash Proxy to understand what cryptography schemes are required for your use case.
43
+
- Indexes are used by Cipherstash Proxy to understand what cryptography schemes are required for your use case.
44
44
1. Initialize Cipherstash Proxy for cryptographic operations.
45
-
- The Proxy will dynamically encrypt data on the way in and decrypt data on the way out based on the indexes you have defined.
45
+
- The Proxy will dynamically encrypt data on the way in and decrypt data on the way out based on the indexes you have defined.
46
46
1. Insert data into the defined columns using a specific payload format.
47
-
- The payload format is defined in the [data format](#data-format) section.
47
+
- The payload format is defined in the [data format](#data-format) section.
48
48
1. Query the data using the EQL functions defined in the [querying data with EQL](#querying-data-with-eql) section.
49
-
- No modifications are required to simply `SELECT` data from your encrypted columns.
50
-
- In order to perform `WHERE` and `ORDER BY` queries, you must wrap the queries in the EQL functions defined in the [querying data with EQL](#querying-data-with-eql) section.
49
+
- No modifications are required to simply `SELECT` data from your encrypted columns.
50
+
- In order to perform `WHERE` and `ORDER BY` queries, you must wrap the queries in the EQL functions defined in the [querying data with EQL](#querying-data-with-eql) section.
51
51
1. Integrate with your application via the [helper packages](#helper-packages) to interact with the encrypted data.
52
52
53
53
You can find a full getting started guide in the [GETTINGSTARTED.md](GETTINGSTARTED.md) file.
@@ -150,13 +150,13 @@ Which will execute on the server as:
150
150
SELECT encrypted_email FROM users;
151
151
```
152
152
153
-
And is the EQL equivalent of the following plaintext query.
153
+
And is the EQL equivalent of the following plaintext query:
154
154
155
155
```sql
156
156
SELECT email FROM users;
157
157
```
158
158
159
-
All the data returned from the database is fully decrypted and an audit trail is generated.
159
+
All the data returned from the database is fully decrypted.
| `table_name` | Name of target table | Required |
352
+
| `column_name` | Name of target column | Required |
353
+
| `index_name` | The index kind | Required. |
354
+
| `cast_as` | The PostgreSQL type decrypted data will be cast to | Optional. Defaults to `text` |
355
+
| `opts` | Index options | Optional for `match` indexes, required for `ste_vec` indexes (see below) |
356
356
357
357
#### cast_as
358
358
359
359
Supported types:
360
-
- `text`
361
-
- `int`
362
-
- `small_int`
363
-
- `big_int`
364
-
- `boolean`
365
-
- `date`
366
-
- `jsonb`
360
+
361
+
- `text`
362
+
- `int`
363
+
- `small_int`
364
+
- `big_int`
365
+
- `boolean`
366
+
- `date`
367
+
- `jsonb`
367
368
368
369
#### match opts
369
370
@@ -428,13 +429,13 @@ An ste_vec index requires one piece of configuration: the `context` (a string) w
428
429
This ensures that all of the encrypted values are unique to that context.
429
430
It is generally recommended to use the table and column name as a the context (e.g. `users/name`).
430
431
431
-
Within a dataset, encrypted columns indexed using an `ste_vec` that use different contexts cannot be compared.
432
-
Containment queries that manage to mix index terms from multiple columns will never return a positive result.
432
+
Within a dataset, encrypted columns indexed using an `ste_vec` that use different contexts cannot be compared.
433
+
Containment queries that manage to mix index terms from multiple columns will never return a positive result.
433
434
This is by design.
434
435
435
436
The index is generated from a JSONB document by first flattening the structure of the document such that a hash can be generated for each unique path prefix to a node.
436
437
437
-
The complete set of JSON types is supported by the indexer.
438
+
The complete set of JSON types is supported by the indexer.
The expression `cs_ste_vec_v1(encrypted_account) @> cs_ste_vec_v1($query)` would match all records where the `encrypted_account` column contains a JSONB object with an "account" key containing an object with an "email" key where the value is the string "[email protected]".
@@ -510,11 +524,12 @@ When reduced to a prefix list, it would look like this:
| s | Schema version | JSON Schema version of this json document. |
594
+
| v | Version | The configuration version that generated this stored value. |
595
+
| k | Kind | The kind of the data (plaintext/pt, ciphertext/ct, encrypting/et). |
596
+
| i.t | Table identifier | Name of the table containing encrypted column. |
597
+
| i.c | Column identifier | Name of the encrypted column. |
598
+
| p | Plaintext | Plaintext value sent by database client. Required if kind is plaintext/pt or encrypting/et. |
599
+
| q | For query | Specifies that the plaintext should be encrypted for a specific query operation. If `null`, source encryption and encryption for all indexes will be performed. Valid values are `"match"`, `"ore"`, `"unique"`, `"ste_vec"`, `"ejson_path"`, and `"websearch_to_match"`. |
600
+
| c | Ciphertext | Ciphertext value. Encrypted by proxy. Required if kind is plaintext/pt or encrypting/et. |
601
+
| m | Match index | Ciphertext index value. Encrypted by proxy. |
602
+
| o | ORE index | Ciphertext index value. Encrypted by proxy. |
603
+
| u | Unique index | Ciphertext index value. Encrypted by proxy. |
604
+
| sv | STE vector index | Ciphertext index value. Encrypted by proxy. |
0 commit comments